每个项目主页: http://example.sonar.com/dashboard?id=growth_client:restful-api-seller
最近一次current扫描时间信息: http://example.sonar.com/api/ce/component?component=projectGroup1:projectNameExample
{
"queue":[
],
"current":{
"id":"AW7LG4x5rEHtiKcxk1nN",
"type":"REPORT",
"componentId":"AWvpaqUHahV-mFVL-A1-",
"componentKey":"projectGroup1:projectNameExample",
"componentName":"projectGroup1:projectNameExample",
"componentQualifier":"TRK",
"analysisId":"AW7LG5GFQzwg82DVBAfm",
"status":"SUCCESS",
"submittedAt":"2019-12-03T17:33:30+0800",
"submitterLogin":"admin",
"startedAt":"2019-12-03T17:33:31+0800",
"executedAt":"2019-12-03T17:33:33+0800",
"executionTimeMs":1694,
"logs":false,
"hasScannerContext":true,
"organization":"default-organization",
"warningCount":1,
"warnings":[
]
}
}
查询metric的历史数据:ps参数表示返回几次的数据 http://example.sonar.com/api/measures/search_history?component=projectGroup1:projectNameExample&metrics=sqale_index,duplicated_lines_density,ncloc,coverage,bugs,code_smells,vulnerabilities&ps=1000
{
"paging":{
"pageIndex":1,
"pageSize":1000,
"total":20
},
"measures":[
{
"metric":"bugs",
"history":Array[20]
},
{
"metric":"code_smells",
"history":Array[20]
},
{
"metric":"coverage",
"history":Array[20]
},
{
"metric":"duplicated_lines_density",
"history":Array[20]
},
{
"metric":"ncloc",
"history":Array[20]
},
{
"metric":"sqale_index",
"history":Array[20]
},
{
"metric":"vulnerabilities",
"history":Array[20]
}
]
}
扫描历史数据:ps参数表示返回几次的数据 http://example.sonar.com/api/project_analyses/search?project=projectGroup1:projectNameExample&ps=3
{
"paging":{
"pageIndex":1,
"pageSize":3,
"total":20
},
"analyses":[
{
"key":"AW7LG5GFQzwg82DVBAfm",
"date":"2019-12-03T17:33:15+0800",
"events":[
{
"key":"AW7LG5bjQzwg82DVBAfo",
"category":"VERSION",
"name":"master"
}
]
},
{
"key":"AW61nn_9Qzwg82DV8pVB",
"date":"2019-11-29T13:24:42+0800",
"events":[
]
},
{
"key":"AW6xeRnRQzwg82DV8DFL",
"date":"2019-11-28T18:05:22+0800",
"events":[
]
}
]
}
comments powered by Disqus