使用 Sonar REST 获取添加的违规计数 api
Get count of added violations using Sonar REST api
我需要从之前的分析中获取添加的违规计数。我可以从仪表板获得相同的信息,但我需要 Sonar 提供的其余部分 api 来完成这项工作。
您可以使用下面的 api 来实现同样的效果。
http://host:port/api/issues/search?createdAfter=2015-09-17T13:00:00+0100&statuses=OPEN&componentKeys=passyourprojectKey
您也可以传递上次分析的时间戳
您可以使用下面的 api
找到最后的分析时间戳
http://host:portapi/resources?resource=projectKey&includetrends=true
做了一些研究,发现这个
http://host/api/resources?resource=419370&metrics=new_violations&includetrends=true
达到目的。
我需要从之前的分析中获取添加的违规计数。我可以从仪表板获得相同的信息,但我需要 Sonar 提供的其余部分 api 来完成这项工作。
您可以使用下面的 api 来实现同样的效果。
http://host:port/api/issues/search?createdAfter=2015-09-17T13:00:00+0100&statuses=OPEN&componentKeys=passyourprojectKey
您也可以传递上次分析的时间戳 您可以使用下面的 api
找到最后的分析时间戳http://host:portapi/resources?resource=projectKey&includetrends=true
做了一些研究,发现这个
http://host/api/resources?resource=419370&metrics=new_violations&includetrends=true
达到目的。