Manas
Manas

Reputation: 177

SonarQube Web Api Changes from 6.0 to 6.4

I was using "http://sonarserver:9000/api/resources?metrics=ncloc,bugs,vulnerabilities" to get the details of all the projects for sonar 6.0.

After upgrading to 6.4 this url does not work and I am not able to find the alternative for this under the web_api changes page.

Please let me know if anyone knows about an alternative to this.

Error: {"errors":[{"msg":"Unknown url : /api/resources"}]}

Upvotes: 0

Views: 2122

Answers (1)

Nicolas B.
Nicolas B.

Reputation: 7321

Per WebAPI documentation (embedded in your own SonarQube server, linked at the footer): api/resources/index is deprecated since 5.4 (i.e. a super long time ago).

The documentation even provides some guidance:

if you need one component with measures: api/measures/component

That will get you the measures you need for a given project. You can use other APIs to get the list of projects (e.g. api/components/search). See Web API docs for the full listing of possibilities.

Upvotes: 1

Related Questions