Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SonarQube REST APIs : Read Metrics

I am using SonarQube version 6.7.1

I am trying to get JSON Response for our projects sonarQube statistics Just want simple details like

  • Bug count, vulnerability count , % code duplication , code coverage
  • Tried URL http://sonar-server:9000/api/metrics&json=true but got error Unknown url, can someone point out correct URL
  • End Aim is to store Above counts for each run in time series DB .. any suggestions how to do it ?

May be i am not reading / understanding documentation clearly , possibly a pointer to tutorial or example or some other pointers will help me,

like image 391
Lav Avatar asked Mar 07 '23 09:03

Lav


1 Answers

Try to use sonarqube.server.com:9000/api/metrics/domains, I am able to get json response from this.

APIs that you can use are listed at:

sonarqube.server.com:9000/web_api/api/metrics/domains/search

but just remove "web_api" while calling, to get json response.

like image 169
Amit Boora Avatar answered Mar 11 '23 15:03

Amit Boora