Appriciate if I can get help for the below scenario. My issues to identify how to extract/export all java rules on SonarQube 4.5.7. I tried the below two API calls but I get a "The page you were looking for doesn't exist".
The sonarqube version I have shows 781 java rules my objective is to extract them to an excel or a csv file
[1]curl -X GET -v -u admin:admin http://localhost:9000/api/rules?language=java
[2]curl -X GET -v -u admin:admin http://localhost:9000/api/rules/search?languages=java >> java.json
The second option seems to generate an output but not all 781 rules are extracted thanks,shavantha
http://localhost:9000/api/rules/search?languages=java
the url parameter is languages rather language
URL
api/rules/search?languages=java
is the correct way to get all Java rules. Response is paginated, so only 10 rules are returned by default :{ "total": 781, "p": 1, "ps": 10, "rules": [ <here are 10 rules ] }
Use pagination parameter
p
(page index) for traversing all results. Note that the page size can be changed with parameterps
(defaults 10).