At times, Awesome Graphs for Bitbucket users may face indexing issues that could necessitate a restart of the indexing process for repositories with FAILED, INVALID or TIMEOUT statuses. Although there are multiple ways to restart indexing and resolve this issue (also described in our FAQ), such methods may not always be convenient.

To address this problem in a faster and more efficient manner, you can use the REST API. Below on the page, you'll find the details about this option. 

Overview 

This REST API resource is available beginning with version 6.1.0 of the app. You can access the REST API reference documentation at the People page by clicking on Export → REST API or via the link:  <bitbucket-host>/plugins/servlet/graphs-api. If it's not available to you, then you'll need to update the app.

Via this REST API, you'll be able to restart the tickets in the indexing queue according to the passed ticket statuses.

Restart tickets in the indexing queue

POST /rest/awesome-graphs-api/latest/admin/indexing-queue/restart

Restarts tickets in the indexing queue according to the passed ticket statuses. Returns the number of restarted tickets.

Request Body Schema

Body

Value

Description

statuses

array of strings

Only the tickets with the specified statuses will be restarted. Defaults to FAILED, INVALID.

Request Example

curl -X POST  "https://%bitbucket-host%/rest/awesome-graphs-api/latest/admin/indexing-queue/restart" -H "Content-Type: application/json" -d '{"statuses": ["invalid", "failed"]}' -u username:password
CODE

Number of restarted tickets.

{
  "ticketsRestarted": 15
}
CODE

Unable to process request.

{
  "errors": [
    {
      "context": null,
      "message": "Unable to process request. Please check Awesome Graphs app logs for details (<Bitbucket home directory>/log/awesome-graphs.log).",
      "exceptionName": null
    }
  ]
}
CODE

Your Bitbucket instance doesn't have the license allowing to retrieve the requested data.

{
  "errors": [
    {
      "context": null,
      "message": "You don't have Bitbucket admin permissions to access the resource.",
      "exceptionName": null
    }
  ]
}
CODE