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

Table of Contents

Get a List of Resources

DescriptionGet a list of resources

URL

/api/resources

MethodGET

Security

 

Examples

  1. Get all the versions from project Sonar (key = org.codehaus.sonar:sonar):



  2. Get all the versions and alerts from project Sonar (key = org.codehaus.sonar:sonar between January 1st, 2012 and August 31st, 2012):



  3. Get global events from October 8th, 2012:



Parameters

Parameter

Values

Default Value

Description

Required

resource

resource key/id

 

Filter on a specific resource

 

metrics

comma-separated list of metric keys/ids

 

Load measures on selected metrics. If only one metric is set, then measures are ordered by value. 
Example : lines,blocker_violations

 

depth

integer

0

Used only when resource is set. 
0: only selected resource 
-1: all childhood, including selected resource 
>0: depth toward the selected resource

 

scopes

comma-separated list of scopes

 

Filter on scopes: 
PRJ: project/module 
DIR: directory (like Java package) 
FIL: file

 

qualifiers

comma-separated list of qualifiers

 

Filter on qualifiers: 
TRK: project 
BRC: module 
CLA: class 
UTS: unit test 
DIR: directory 
FIL: file

 

verbose

true|false

false

Add some data to response 

 

limit

integer

 

Limit the number of results. Only used if one metric, and only one, is set.

 

includetrends

true|false

false

Include trends and period variations in response: add <trend> (1 if better, else worse), <var> (1 if measure value increases) and nodes <p*> for period variations

 

includealerts

true|false

false

Include alerts data: add nodes <alert> (ERROR, WARN, OK) and <alert_text>

 

rules

true|false|list of rule ids

false

Filter on rules: setting it to true will return rules id and rule name for measure having such info (such as 'blocker_violations', 'critical_violations', ..., 'new_blocker_violations', ...)

 

rule_categories

true|false|list of category ids

false

Filter on rule ISO categories: setting it to true will return rules category id and rule category name for measure having such info (such as 'blocker_violations', 'critical_violations', ..., 'new_blocker_violations', ...)

 

rule_priorities

true|false|list of priorities

false

Filter on rule priority: setting it to true or to a list of priorities (BLOCKER,CRITICAL,MAJOR,MINOR,INFO) will return measures having such info (such as 'blocker_violations', 'critical_violations', ..., 'new_blocker_violations', ...). Since version 1.10.

 

 

 

  • No labels