| Table of Contents |
Get a List of Metrics
| Description | Get a list of metrics |
URL | /api/metrics |
| Method | GET |
Security | None |
Examples
Get all the metrics from the Sonar Nemo instance:
Get the metric 'Lines of Code' (id = ncloc):
Parameters
Parameter | Description | Required | Default Value | Value |
|---|---|---|---|---|
id | id or key of the project | No. Get all metrics if not set | None | ncloc |
| format | Response formats: xml or json | No | xml |
Create a Metric
| Description | Create a metric |
URL | /api/metrics |
| Method | POST |
| Security | Requires Global Administrator role |
Examples
- Create a metric:
- ???
- ???
???
Parameters
Parameter | Description | Required | Default Value |
|---|---|---|---|
description | Description of the metric |
| None |
direction | Possible values: -1 | 0 | 1 | None | |
domain |
| None | |
| name | Yes | None | |
qualitative | Is it a qualitative metric? | None | |
| val_type | Value type. | Yes | None |
| user_defined | Can user fill measures online? Possible values: true | false | No | false |
Update a Metric
| Description | Update a metric |
URL | /api/metrics |
| Method | PUT |
| Security | Requires Global Administrator role |
Examples
- Update metric 'myMetric':
- ???
- ???
???
Parameters
Parameter | Description | Required | Default Value |
|---|---|---|---|
| id | id of the metric | Yes | None |
description | Description of the metric | No | None |
direction | Possible values: -1, 0, 1 | No | None |
domain |
| No | None |
| name | No | None | |
qualitative | Is it a qualitative metric? | No | None |
| val_type | Value type. | No | None |
| user_defined | Can user fill measures online? Possible values: true, false | No | None |
Delete a Metric
| Description | Delete a metric |
URL | /api/metrics |
| Method | DELETE |
| Security | Requires Global Administrator role |
Examples
Delete metric 'myMetric':
Parameters
Parameter | Description | Required | Default Value |
|---|---|---|---|
| id | id of the metric | Yes | None |

