Skip to content

Commit 7bcfb76

Browse files
authored
Merge pull request #81 from gonchik/master
Prepare new version and small polishes
2 parents 15593e5 + ec9d5e4 commit 7bcfb76

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

atlassian/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.10.2
1+
1.10.4

atlassian/bitbucket.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,3 +271,30 @@ def get_content_of_file(self, project, repository, filename):
271271
repository=repository,
272272
filename=filename)
273273
return self.get(url)
274+
275+
def reindex(self):
276+
"""
277+
Rebuild the bundled Elasticsearch indexes for Bitbucket Server
278+
:return:
279+
"""
280+
url = 'rest/indexing/latest/sync'
281+
return self.post(url)
282+
283+
def reindex_repo(self, project, repository):
284+
"""
285+
Reindex repo
286+
:param project:
287+
:param repository:
288+
:return:
289+
"""
290+
url = 'rest/indexing/1.0/projects/{projectKey}/repos/{repositorySlug}/sync'.format(projectKey=project,
291+
repositorySlug=repository)
292+
return self.post(url)
293+
294+
def check_reindexing_status(self):
295+
"""
296+
Check reindexing status
297+
:return:
298+
"""
299+
url = 'rest/indexing/latest/status'
300+
return self.get(url)

atlassian/confluence.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,24 @@ def cql(self, cql, start=0, limit=None):
564564
params['cql'] = cql
565565
return self.get('rest/api/search', params=params)
566566

567+
def get_page_as_pdf(self, page_id):
568+
"""
569+
Export page as standard pdf exporter
570+
:param page_id: Page ID
571+
:return: PDF File
572+
"""
573+
headers = {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'X-Atlassian-Token': 'no-check'}
574+
url = 'spaces/flyingpdf/pdfpageexport.action?pageId={pageId}'.format(pageId=page_id)
575+
return self.get(url, headers=headers, not_json_response=True)
576+
577+
def export_page(self, page_id):
578+
"""
579+
Alias method for export page as pdf
580+
:param page_id: Page ID
581+
:return: PDF File
582+
"""
583+
return self.get_page_as_pdf(page_id)
584+
567585
def get_descendant_page_id(self, space, parent_id, title):
568586
"""
569587
Provide space, parent_id and title of the descendant page, it will return the descendant page_id

0 commit comments

Comments
 (0)