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 2 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 to create a metric

Examples

  1. Create a metric:
    • Category: Alert
    • Name: myAlertName
    • Description: myAlertDescription
       

Parameters

Parameter

Description

Required

Default Value

id

id of the metric

Yes

 None

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
  • No labels