Does Coverity have Rest API

∥☆過路亽.° 提交于 2019-12-12 06:16:46

问题


I want to store results from Coverity® to InfluxDB and I was wondering does Coverity have REST API?


回答1:


If you're only trying to dump data to InfluxDB, you can curl data from REST API and insert resulting json to the database. I do something similar, but in CSV format.

  1. Create a view in coverity 'Issues: By Snapshot' that contains all your defects.
  2. Curl data from coverity view

    json format
    curl --user <userid>:<password> 
    "http://<coverity_url>/api/viewContents/issues/v1/<View Name>?projectId=<project ID>&rowCount=-1"
    
    csv format
    curl --header "Accept: text/csv" --user <userid>:<password> 
    "http://<coverity_url>/api/viewContents/issues/v1/<View Name>?projectId=<project ID>&rowCount=-1"
    

Example: If you created a view 'My Defects' in project 'My Project' the command would be

curl --user <userid>:<password> "http://<coverity_url>/api/viewContents/issues/v1/My%20Defects?projectId=My%20Project&rowCount=-1"

In above URL:

%20 -- URL encoded space

rowcount=-1 -- Download all rows in view. You can set it to desired limit.




回答2:


Not really, no.

There is a very limited REST api but it only covers a few very specific things. I'd recommend you use cov-manage-im where you can and only use the SOAP API if you need something more.




回答3:


cov-manage-im can help, it can be used to retrive defects for specific projects and streams. cov-manage-im --help can give you more info

cov-manage-im --host youcovhostname --user yourusername --password yourpassword --mode defects --show --project yourprojectname


来源:https://stackoverflow.com/questions/44119285/does-coverity-have-rest-api

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!