Versions Compared

Key

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

...

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

curl -u admin:admin -X POST http://localhost:9000/api/properties?id=myProperty&value=myValue

Example to create a property with the content of a file:

curl -u <login>:<password> -X POST http://localhost:9000/api/properties/?id=<key> -v -T <path/to/file>

Create or update property 'myProperty' with value 'myValue' by user admin/admin on project 'org.codehaus.sonar:sonar'

curl -u admin:admin -X POST http://localhost:9000/api/properties?id=myProperty&value=myValue&resource=org.codehaus.sonar:sonar

Example to create a property with the content of a file:

curl -u <login>:<password> -X POST http://localhost:9000/api/properties/?id=<key>&resource=org.codehaus.sonar:sonar -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

resource

id or key of the project

No

None

org.codehaus.sonar:sonar

Delete a Property

DescriptionDelete a property

URL

/api/properties

HTTP MethodDELETE
Security

Requires Administer System permission

...

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

curl -u admin:admin -X DELETE http://localhost:9000/api/properties/myProperty

Delete property 'myProperty' by user admin/admin on project 'org.codehaus.sonar:sonar'

curl -u admin:admin -X DELETE http://localhost:9000/api/properties/myProperty?resource=org.codehaus.sonar:sonar

Parameters

Parameter

Description

Required

Default ValueExample Value

id

Key of the property

Yes

NonemyProperty

resource

id or key of the project

No

None

org.codehaus.sonar:sonar