Full documentation for SonarQube has moved to a new location: http://docs.sonarqube.org/display/SONAR

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 Coding Rules Activated in a Quality Profile

DescriptionGet the list of coding rules activated in a quality profile

URL

/api/profiles

HTTP MethodGET
Response Formatsjson | xml

Security

None

Examples

Use CaseExample Request
Get all the coding rules activated on the default java quality profile

GET http://nemo.sonarsource.org/api/profiles?language=java

Get all the coding rules activated on the java quality profile 'Common rules'

GET http://nemo.sonarsource.org/api/profiles?language=java&name=Common%20rules

Response Format

JSON

Parameters

Parameter

Description

Required

Default Value

Example Value

language

Project language

Yes

None

java

name

Profile name. If not set, the default profile for the selected language is used.

No

None

Sonar%20way

rule_repositories

Comma-separated list of rules repository keys.

No

None

pmd,findbugs

rule_severities

Comma-separated list of rule severities.
Possible values: BLOCKER | CRITICAL | MAJOR | MINOR | INFO.

No

None

BLOCKER,CRITICAL

formatResponse formats.
Possible values: xml | json
NoNonejson

Backup a Quality Profile

Available since Sonar 3.1

Icon

 

DescriptionBackup a quality profile

URL

/api/profiles/backup

HTTP MethodGET
Response Formatsjson | xml
Security

Requires Global Administrator role

Examples

Use CaseExample Request
Backup the default java quality profile

GET http://localhost:9000/api/profiles/backup?language=java

Backup the java quality profile 'Sonar%20way'

GET http://localhost:9000/api/profiles/backup?language=java&name=Sonar%20way

Response Format

JSON

Parameters

Parameter

Description

Required

Default Value

Value

language

Project language

Yes

None

java

name

Profile name. If not set, the default profile for the selected language is used.

No

None

Sonar%20way

format

Response formats.
Possible values: json | xml

NoNonejson

Restore a Quality Profile

Available since Sonar 3.1

Icon

 

DescriptionRestore a quality profile

URL

/api/profiles/restore

HTTP MethodPOST
Security

Requires Global Administrator role

Examples

Use CaseExample Request
Restore the quality profile defined in ?Q?

curl -X POST -u <login>:<password> -F 'backup=<my>backup</my>' -v http://localhost:9000/api/profiles/restore -v

  • No labels