简体   繁体   English

SonarQube - 是否有API可以为您拥有的所有项目获取部分分析?

[英]SonarQube - Is there an API to grab a part of analysis for all projects you have?

I want to be able to extract, for example, just the Technical Debt numbers out of my sonar instance for all the projects I have, and display them on a page. 例如,我希望能够从我的声纳实例中提取所有项目的技术债务编号,并将其显示在页面上。

Does Sonar provide an api that I can utilize and achieve this? Sonar是否提供了我可以利用并实现这一目标的api?

SonarQube lets you get exhaustive data using its Web API. SonarQube可让您使用其Web API获取详尽的数据。 Taking your example of project's measures: 以你的项目措施为例:

Since SonarQube 5.4 自SonarQube 5.4起

Use api/measures Web API (see parameters in documentation ). 使用api/measures Web API(请参阅文档中的参数)。 Example for project postgresql : 项目postgresql的示例:

Before SonarQube 5.4 在SonarQube 5.4之前

Use api/resources Web API: 使用api/resources Web API:

http://sonarqube_url/api/resources?resource=your_resource&metrics=metric_key HTTP:// sonarqube_url / API /资源资源= your_resource&指标= metric_key

Listing metric keys 列出度量标准键

Use api/metrics/search (documented here ), see also Metric Definitions . 使用api/metrics/search此处记录 ),另请参阅度量标准定义

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM