Skip to content

Commit e1bb795

Browse files
Gonchik TsymzhitovGonchik Tsymzhitov
authored andcommitted
Bitbucket: reindex specific methods
1 parent 5a25bbc commit e1bb795

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

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)

0 commit comments

Comments
 (0)