Reputation: 481
I am trying to use Sonar API for getting multiple metrices. When I am trying to get single Metric it is working fine but when giving a comma separated list it is returning blank response. E.g.
https://localhost/sonar/api/resources?format=json&metrics=tests [Works fine and returns response] https://localhost/sonar/api/resources?format=json&metrics=ncloc [Works fine and returns response]
https://tools.publicis.sapient.com/sonar/api/resources?format=json&metrics=ncloc,tests [Returns blank reponse i.e [] json ]
Am I doing it wrong. I have used comma separated list previously and it used to work fine. But now I am not able to figure out what is the issue
My Sonar version is 5.6
Upvotes: 0
Views: 1381
Reputation: 1
for me api/resources works fine with multiples metrics, i call like that
Upvotes: 0
Reputation: 7321
api/resources is deprecated. Its metrics parameter does accept comma-separated values (test it in a browser first, and careful with any reverse-proxy that may rewrite URLs), but you're better off using the most modern and up-to-date API: api/measures (documentation embedded in your SonarQube server), which also supports multiple values for metricKeys parameter.
Upvotes: 1