Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Table of Contents

DescriptionGet a list of metrics

URL

/api/metrics

HTTP MethodGET
Response Formatsjson | xml

Security

None

 

Examples

Use CaseExample Request
Get all the metrics from the Sonar Nemo instance

GET http://nemo.sonarsource.org/api/metrics

Get the metric 'Lines of Code' (id = ncloc)

GET http://nemo.sonarsource.org/api/metrics/ncloc

Response Format

JSON

Parameters

Parameter

Description

Required

Default Value

Example Value

id

id or key of the metric

No. Get all metrics if not set

None

ncloc

format

Response format can be set through:

  • Parameter format: xml | json
  • Or the 'Accept' property in the HTTP header:
    • Accept:text/xml
    • Accept:application/json
If nothing is set, json is used.
NoNonejson
  • No labels