Fetch Metric results using REST API

1,035 views
Skip to first unread message

Priyanka S

unread,
Dec 21, 2016, 6:49:30 AM12/21/16
to SonarQube
Hi,

I am trying to publish SonarQube reports in Jenkins Server.
For that I added curl command in the end of job to fetch needed metrics and store it as .xml file in Jenkins like

curl http://localhost:9000/sonar/api/measures/component?componentKey=color&metricKeys=ncloc,complexity --output sonar-result.xml


I am getting error like

{"errors":[{"msg":"The 'metricKeys' parameter is missing"}]}

Please help me to solve this issue.
Thanks in advance.

Teryk Bellahsene

unread,
Dec 22, 2016, 9:05:27 AM12/22/16
to SonarQube
Hello,

It must be a typo, whitespace or something similar. See this example for instance. It works.

Sincerely,

Teryk
Reply all
Reply to author
Forward
0 new messages