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

DescriptionGet a list of rules

URL

/api/rules

HTTP MethodGET
Response Formatsjson | xml | csv

Security

None

Examples

Use CaseExample Request
Get all the java rules

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

Get all the java rules from pmd and findbugs

GET http://nemo.sonarsource.org/api/rules?language=java&plugin=pmd,findbugs

Response Format

JSON

Parameters

Parameter

Description

Required

Default Value

Example Value

language

Key of the language

No

Nonejava

plugin

Comma-separated list of rules plugins

No

None

findbugs,pmd

searchtext

To filter on rules containing a specified text in their name, key or title

No

None

braces

profile

When this parameter is defined, a node 'status' is added for each 'rule' node with values 'INACTIVE' or 'ACTIVE'.
It is recommended to use the /api/profiles web service instead. 

No

None

Sonar%20way

priorities

List of INACTIVE, ACTIVE, BLOCKER, CRITICAL, MAJOR, MINOR, INFO.
It is recommended to use the /api/profiles web service instead of ACTIVE and INACTIVE.

No

None

BLOCKER,CRITICAL

format

Response format can be set through:

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