I want to be able to extract, for example, just the Technical Debt numbers out of my sonar instance for all the projects I have, and display them on a page.
Does Sonar provide an api that I can utilize and achieve this?
SonarQube lets you get exhaustive data using its Web API. Taking your example of project's measures:
Use api/measures
Web API (see parameters in documentation ). Example for project postgresql :
Get the component ID:
https://nemo.sonarqube.org/api/components/show?key=postgresql
Get the desired metrics:
Use api/resources
Web API:
http://sonarqube_url/api/resources?resource=your_resource&metrics=metric_key
Use api/metrics/search
(documented here ), see also Metric Definitions .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.