How to get SonarQube Metrics in JSON Response

628 views
Skip to first unread message

lavn...@gmail.com

unread,
May 1, 2018, 3:00:44 AM5/1/18
to SonarQube
Hi
I am trying to write a java code to read JSON response
I am using following URL
http://sonarqube.server.com:9000/web_api/api/metrics/domains/search&json=true
But i get 200 response and HTML output not JSON response , seems like my URL is wrong

Can someone guide me to correct URL

Julien Lancelot

unread,
May 1, 2018, 3:03:17 AM5/1/18
to lavn...@gmail.com, SonarQube
Hi,

The URL you're using is the URL of the web page that document all the web API.
You need to remove the "web_api" from the URL you are using.

Regards,

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/836b63b8-0c91-45d1-a24d-a3ac42f4f8ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Julien Lancelot | SonarSource

lavn...@gmail.com

unread,
May 1, 2018, 4:37:51 AM5/1/18
to SonarQube
Thanks ... it worked !!

lavn...@gmail.com

unread,
May 1, 2018, 4:39:24 AM5/1/18
to SonarQube
Any idea how to get the DELTA statistics ??
As in the new BUG count and old BUG count ... so that we can find delta

Julien Lancelot

unread,
May 1, 2018, 4:46:41 AM5/1/18
to lavn...@gmail.com, SonarQube
Hi,
 
Could you please elaborate more your demande please ? Maybe give a example or something like that.

Regards,


For more options, visit https://groups.google.com/d/optout.

Lavnish Lalchandani

unread,
May 1, 2018, 5:29:33 AM5/1/18
to Julien Lancelot, SonarQube
Hi
Using the Request As attached in Capture.jpg
I am able to get data in green ( see Image Capture2.jpg ) , but how to get data of previous build ( ones in red , data on Right Hand Side )

To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+unsubscribe@googlegroups.com.
Capture.JPG
Capture2.JPG

Lavnish Lalchandani

unread,
May 1, 2018, 5:30:12 AM5/1/18
to Julien Lancelot, SonarQube
Sorry Re attaching the 2nd pic

On 1 May 2018 at 14:59, Lavnish Lalchandani <lavn...@gmail.com> wrote:
Hi
Using the Request As attached in Capture.jpg
I am able to get data in green ( see Image Capture2.jpg ) , but how to get data of previous build ( ones in red , data on Right Hand Side )
Capture2.JPG

nicolas...@sonarsource.com

unread,
May 1, 2018, 6:15:06 AM5/1/18
to SonarQube
Hi Lavnish,

I recommend you explore this documentation : https://docs.sonarqube.org/display/SONAR/Metric+Definitions . It will help you discover the various metrics you can explore, including the ones about new code.

In case of remaining doubt, also note that the Browser Inspector is your friend when trying to obtain data you see in the UI. See this post for guidelines on this topic.

Best regards,
Nicolas


On Tuesday, 1 May 2018 11:30:12 UTC+2, Lavnish Lalchandani wrote:
Sorry Re attaching the 2nd pic
On 1 May 2018 at 14:59, Lavnish Lalchandani <lavn...@gmail.com> wrote:
Hi
Using the Request As attached in Capture.jpg
I am able to get data in green ( see Image Capture2.jpg ) , but how to get data of previous build ( ones in red , data on Right Hand Side )
Reply all
Reply to author
Forward
0 new messages