Hooks & APIs

Reindex

 

Call the Reindex REST API to have more control on indexing:

 
Reindex POST API
url
/rest/gitplugin/1.0/index.json

Starts the reindex process in a separate thread and returns the result immediately.
method
POST
parameters
repoId       Repository ID (long).  Query parameter.  Required.

Example: Form param (repoId: 12)
response
JSON

 

Example:
Example:
http://jira.yourorg.com/rest/gitplugin/1.0/index.json

Response:
{
  "success":true,
  "finished":true,
  "threadId":172,
  "messages": {
    "Indexing test-repo":100.0
    },
  "errors": {},
  "lastOperationPercent":100.0
}
 
Reindex GET API
url
/rest/gitplugin/1.0/index.json

Use this method to track messages for a particular thread.
method
GET
parameters
threadId     Indexer thread ID (UUID).  Query parameter.
Required.
Example: eafe58fc-d8de-42ff-8815-6fe5860b38d2
response
JSON

 

Example:
http://jira.yourorg.com/rest/gitplugin/1.0/index.json?threadId=eafe58fc-d8de-42ff-8815-6fe5860b38d2

Response:
{
  "success":true,
  "finished":true,
  "threadId":172,
  "messages": {
    "Indexing test-repo":100.0
    },
  "errors": {},
  "lastOperationPercent":100.0
}