Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DescriptionGet a list of properties

URL

/api/properties

HTTP MethodGET
Format Responsesjson | xml

Security

Optional (to see get secured properties)

Examples

Use CaseExample Request
Get the list of all the properties

...

...

languagenone

GET

...

 

 

Get the global property 'sonar.core.codeCoveragePlugin'

...

languagenone

...

...

...

coveragePlugin

Get the property 'sonar.core.codeCoveragePlugin' on project 'org.codehaus.sonar:sonar'

...

...

languagenone

GET

...

...

...

Response Format

Code Block
titleJSON
languagejavascript
[
  {
    "key":"sonar.core.treemap.colormetric",
    "value":"violations_density"
  },
  ...
]

Parameters

Parameter

Description

Required

Default Value

Example Value

id

Key of the property

No

Get all properties if not set

sonar.core.codeCoveragePlugin

resource

id or key of the project

No

None

org.codehaus.sonar:sonar

format

Response

formats: xml or json
Noxml 

format can be set through:

  • Parameter format: xml | json
  • Or the 'Accept' property in the HTTP header:
    • Accept:text/xml
    • Accept:application/json
If nothing is set, json is used.
NoNonejson

Create or Update a Property

DescriptionCreate or update a property

URL

/api/properties

HTTP MethodPOST
Security

Requires Global Administrator roleAdminister System permission

Examples

Use CaseExample Request
Create or update property 'myProperty' with value 'myValue' by user admin/admin

...

...

languagenone

curl

...

-u

...

admin:admin

...

-X

...

POST

...

http://localhost:9000/api/properties?id=myProperty&value=myValue

...

...

...

...

...

...

...

...

...

...

...

...

curl

...

-u

...

<login>:<password>

...

-X

...

POST

...

http://localhost:9000/api/properties/?id=<key>

...

-v

...

-T

...

<path/to/file>

Parameters

Parameter

Description

Required

Default ValueExample Value

id

Key of the property

Yes

NonemyProperty

value

Value of the property

Yes

NonemyValue

Delete a Property

DescriptionDelete a property

URL

/api/properties

HTTP MethodDELETE
Security

Requires Global Administrator roleAdminister System permission

Examples

Use CaseExample Request
Delete property 'myProperty' by user admin/admin

...

...

languagenone

curl

...

-u

...

admin:admin

...

-X

...

DELETE

...

http://localhost:9000/api/properties/myProperty

Parameters

Parameter

Description

Required

Default ValueExample Value

id

Key of the property

Yes

NonemyProperty