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

Table of Contents

Get a List of Manual Measures

DescriptionGet a list of manual measures

URL

/api/manual_measures

HTTP MethodGET
Response Formatsjson

Security

Requires User role on the project

Examples

Use CaseExample Request
Get all the manual measures on project 'myProject'

GET http://localhost:9000/api/manual_measures?resource=myProject

Get the manual measure on metric 'business_value' on project 'myProject'

GET http://localhost:9000/api/manual_measures?resource=myProject&metric=business_value

Response Format

JSON

Parameters

Parameter

Description

Required

Default Value

Example Value

resourceid or key of the projectYesNoneorg.codehaus.sonar:sonar
metricid of the manual metricNoNonebusiness_value
formatResponse format: jsonNoNonejson

Create a Manual Measure

DescriptionCreate a manual measure

URL

/api/manual_measures

HTTP MethodPOST
Security

Requires Project Administrator role on the project

Examples

Use CaseExample Request
Create a manual measure on project 'myProject' being logged in as user 'admin/admin':
  • Manual metric: business_value
  • Value: 5000

curl -u admin:admin -d "resource=myProject&metric=business_value&val=5000" http://localhost:9000/api/manual_measures

Parameters

Parameter

Description

Required

Default Value

Example Value

resource

id or key of the project

Yes

None

org.codehaus.sonar:sonar

metric

Key of the manual metric

Yes

None

business_value 

val

Decimal value of the manual measure

Yes (or text is set)None10.0
textText value of the manual measureYes (or val is set)Noneabc

Delete a Manual Measure

DescriptionDelete a manual measure

URL

/api/manual_measures

HTTP MethodDELETE
Security

Requires Project Administrator role on the project

Examples

Use CaseExample Request
Delete manual measure 'business_value' on project 'myProject'

curl -u admin:admin -X DELETE "http://localhost:9000/api/manual_measures?resource=myProject&metric=business_value"

Parameters

Parameter

Description

Required

Default Value

Example Value

resource

id or key of the project

Yes

None

org.codehaus.sonar:sonar

metric

Key of the manual metric

Yes

None

business_value 

  • No labels