| Info | ||||
|---|---|---|---|---|
| ||||
|
Get a List of Metrics
| Description | Get a list of metrics |
URL | /api/metrics |
| HTTP Method | GET |
| Response Formats | json | xml |
Security | None |
Examples
| Use Case | Example Request |
|---|---|
| Get all the metrics from the Sonar Nemo instance | |
| Get the metric 'Lines of Code' (id = ncloc) |
...
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. Possible values: xml | json | No | None | json |
Create a Metric
| Description | Create a metric |
URL | /api/metrics |
| HTTP Method | POST |
| Security | Requires Global Administrator role |
Examples
| Use Case | Example Request |
|---|---|
| Create a metric | ?Q? |
Parameters
Parameter | Description | Required | Default Value | Example Value |
|---|---|---|---|---|
description | Description of the metric |
| None | My metric blabla |
direction | Possible values: -1 | 0 | 1 | None | -1 | |
domain | Domain of the metric | None | Size | |
| name | Name of the metric | Yes | None | myMetric |
qualitative | Is it a qualitative metric? | None | 1 | |
| val_type | Value type. | Yes | None | PERCENT |
| user_defined | Can user fill measures online? Possible values: true | false | No | false | true |
Update a Metric
| Description | Update a metric |
URL | /api/metrics |
| HTTP Method | PUT |
| Security | Requires Global Administrator role |
Examples
| Use Case | Example Request |
|---|---|
| Create a metric | ?Q? |
Parameters
?Q?
...
| Description | Delete a metric |
URL | /api/metrics |
| HTTP Method | DELETE |
| Security | Requires Global Administrator role |
Examples
| Use Case | Example Request |
|---|---|
| Delete metric 'myMetric' |
|
Parameters
Parameter | Description | Required | Default Value | Example Value |
|---|---|---|---|---|
| id | id of the metric | Yes | None | myMetric |

