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 4 Next »

Table of Contents

Get a List of Metrics

DescriptionGet a list of metrics

URL

/api/metrics

MethodGET

Security

None

Examples

  1. Get all the metrics from the Sonar Nemo instance:



  2. 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

formatResponse formats: xml or jsonNoxml 

Create a Metric

DescriptionCreate a metric

URL

/api/metrics

MethodPOST
 Security

Requires Global Administrator role

Examples

  1. 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  None

qualitative

Is it a qualitative metric?
Possible values: 0, 1

 None
val_type

Value type.
Possible values: PERCENT, INT, FLOAT, STRING, BOOL, MILLISEC

 None
user_definedCan user fill measures online?
Possible values: true, false 
 None

Update a Metric

DescriptionUpdate a metric

URL

/api/metrics

MethodPUT
 Security

Requires Global Administrator role

Examples

  1. Update metric 'myMetric':
    • ???
    • ???
    • ???
       

Parameters

Parameter

Description

Required

Default Value
idid of the metricYesNone

description

Description of the metric

No 

None

direction

Possible values: -1, 0, 1

No None

domain

 

No None
name NoNone

qualitative

Is it a qualitative metric?
Possible values: 0, 1

No None
val_type

Value type.
Possible values: PERCENT, INT, FLOAT, STRING, BOOL, MILLISEC

No None
user_definedCan user fill measures online?
Possible values: true, false 
No None

Delete a Metric

DescriptionDelete a metric

URL

/api/metrics

MethodDELETE
 Security

Requires Global Administrator role

Examples

  1. Update metric 'myMetric':
    • ???
    • ???
    • ???
       

Parameters

Parameter

Description

Required

Default Value
idid of the metricYesNone
  • No labels