2014-07-03 80 views
1

我想使用SonarQube Web服務API檢索項目上給定規則的違規次數。如何通過API檢索Sonar中特定規則的違規次數?

當瀏覽the documentation時,resources API以及rules參數似乎是答案。

隨着作爲http://mysonar:9000/api/resources?resource=1&rules=truehttp://mysonar:9000/api/resources?resource=1&rules=checkstyle:com.puppycrawl.tools.checkstyle.checks.coding.IllegalCatchCheck這樣的URL,我得到以下XML:

<resources> 
    <resource> 
     <id>1</id> 
     <key>foo:bar</key> 
     <name>Foo</name> 
     <lname>Foo</lname> 
     <scope>PRJ</scope> 
     <qualifier>TRK</qualifier> 
     <version>1.0-SNAPSHOT</version> 
     <date>2014-05-26T15:42:14+0200</date> 
     <creationDate>2014-05-26T15:42:14+0200</creationDate> 
    </resource> 
</resources> 

那麼,怎樣才能找回我這樣的信息?

回答