My question:
I would like to obtain the current status of the quality gate for my projects in SonarQube via the SonarQube web api, but I do not see quality gate as an available metric in the documentation. What is the best way to access this information to include in a report?
Background:
I am using the SonarQube API to access information about project analyses. The output from the API is used to generate a weekly report. I can access the information about each project with the following SonarQube API call.
http://my-sonar-site/api/resources/index/?resource=$PROJECT_KEY&metrics=$METRIC_LIST
The metric list is populated from the SonarQube API documentation at
http://docs.sonarqube.org/display/SONAR/Metric+definitions
This gets me everything I want with the exception of the status of the quality gate.
What I've tried:
- I have looked through the documentation for metrics at the above link, but failed to find quality gate status in that part of the api.
- I have also looked at the quality gate API documented at http://nemo.sonarqube.org/api_documentation#api/qualitygates - but the quality gate API seems to be used for creating and managing quality gates and project associations rather than obtaining the current status of the gate on a per-project basis.
api/resources
API is deprecated since Sonarqube 5.4 – Feathercut