Get a List of the Coverity Checkers Used in a Run

Coverity on Polaris

Version
latest
You can retrieve a list of the checkers used in a recent run of Coverity.

Sometimes the results of a scan give you reason to ask which Coverity checkers are being used during static analysis. Here's how to export a list of the checkers used in a recent run.

  1. Use a branch id to get the revision id from the v0/revisions endpoint.
    Request:
     curl -X GET https://{subdomain}.cop.blackduck.com/api/common/v0/revisions?page[limit]=100&filter[revision][branch][id][$eq]={branch_id}
    -H "accept: application/vnd.api+json"
    -H 'Authorization: Bearer {JWT}'
    In the preceding request and the following requests in this section:
    • Replace the variables in curly brackets with your own information.
    • Copy the square brackets exactly as they appear.

    Response:

    {
       "data":[
          {
             "type":"revision",
             "id":"1b5ae738-94e9-457b-9f5f-6aa26b546d17",
             "attributes":{
                "name":"807639",
                "modified-off-the-record":false,
                "timestamp":"2020-06-16T18:33:51Z"
             },
             "relationships":{
                "branch":{
                   "links":{
                   "self":"https://subdomain.cop.blackduck.com/api/common/v0/revisions/1b5ae738-94e9-457b-9f5f-6aa26b546d17/relationships/branch",
                           "related":"https://subdomain.cop.blackduck.com/api/common/v0/revisions/1b5ae738-94e9-457b-9f5f-6aa26b546d17/related/branch"
                   },
                   "data":{
                      "type":"branch",
                      "id":"06b1dd4c-6647-43b8-b084-3a4d4e230863"
                   }
                }
             },
             "links":{
                "self":{
                "href":"https://subdomain.cop.blackduck.com/api/common/v0/revisions/1b5ae738-94e9-457b-9f5f-6aa26b546d17",
                   "meta":{
                      "durable":"urn:x-swip:revisions:1b5ae738-94e9-457b-9f5f-6aa26b546d17"
                   }
                }
             },
             "meta":{
                "etag":"W/\"db8sn6nsgs4hpq83g4j4jddli64go01pglo25en9k8520upbsgd7n8o9leorni\
                gg9l9horjf9oalc5ot964n60640ubssm8hvq8p7f8l3oo6viudub1f4zgb2opa6c9\
                nj9drgareeoffm3hg\"",
                "organization-id":"b5ma5ppigp6673ublabcihhd9g",
                "in-trash":false
             }
          }
       ],
       "included":[
    
       ],
       "meta":{
          "offset":0,
          "limit":25,
          "total":1
       },
       "links":{
          "next":null,
          "prev":null,
          "first":"https://subdomain.cop.blackduck.com/v0/revisions?page%5Blimit%5D=25&page%5Boffset%5D=0&tenant-id=b5ma5ppigp6673ublabcihhd9g&filter%5Brevision%5D%5Bbranch%5D%5Bid%5D%5B%24eq%5D=06b1dd4c-6647-43b8-b084-3a4d4e230863",
                           "last":"https://subdomain.cop.blackduck.com/v0/revisions?page%5Blimit%5D=25&page%5Boffset%5D=0&tenant-id=b5ma5ppigp6673ublabcihhd9g&filter%5Brevision%5D%5Bbranch%5D%5Bid%5D%5B%24eq%5D=06b1dd4c-6647-43b8-b084-3a4d4e230863"
       }
    }                     
    The revision id is on line 5, and you can extract it using: data[0].id.
  2. Use the revision id to get a run id from the v0/runs endpoint.
    Request:
    curl -X GET  https://{subdomain}.cop.blackduck.com/api/common/v0/runs?page[limit]=1&filter[run][revision][id][$eq]={revision_id}
    -H "accept: application/vnd.api+json"
    -H 'Authorization: Bearer {JWT}'    
    Response:
     {
       "data":[
          {
             "type":"run",
             "id":"7078b2a5-4eeb-40da-840e-5dc82ceb822b",
             "attributes":{
                "segment":false,
                "creation-date":"2020-06-16T20:37:26.29Z",
                "run-type":"CodeAnalysisRun",
                "status":"Complete",
                "completed-date":"2020-06-16T20:37:32.949Z",
                "upload-id":"bd6d4629-db24-4380-b07e-27336a8f4fbc",
                "fingerprints":[
                   "urn:x-swip:artifacts-fingerprint:coverity:sha256:57485fb \
                   64f171a3642ddfd70aee0d2b1d4abc677a5e42f6a9dd8c7302866364c"
                ]
             },
             "relationships":{
                "tool-domain-service":{
                   "links":{
                      "self":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/relationships/tool-domain-service",
                      "related":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/related/tool-domain-service"
                   },
                   "data":{
                      "type":"tool-domain-service",
                      "id":"10b78709-8156-447e-ac28-8669e461f0c9"
                   }
                },
                "submitting-organization":{
                   "links":{
                      "self":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/relationships/submitting-organization",
                      "related":"https://subdomain.cop.blackduck.com/api/auth/latest/organizations/b5ma5ppigp6673ublabcihhd9g"
                   },
                   "data":{
                      "type":"organizations",
                      "id":"b5ma5ppigp6673ublabcihhd9g"
                   }
                },
                "submitting-user":{
                   "links":{
                      "self":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/relationships/submitting-user",
                      "related":"https://subdomain.cop.blackduck.com/api/auth/latest/users/plucqs4aut7uh0e3gonkiadp5s"
                   },
                   "data":{
                      "type":"users",
                      "id":"plucqs4aut7uh0e3gonkiadp5s"
                   }
                },
                "previous-run":{
                   "links":{
                      "self":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/relationships/previous-run",
                      "related":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/related/previous-run"
                   },
                   "data":null
                },
                "tool":{
                   "links":{
                      "self":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/relationships/tool",
                      "related":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/related/tool"
                   },
                   "data":{
                      "type":"tool",
                      "id":"652fef4e-1524-414e-87d0-2691a6cd5948"
                   }
                },
                "revision":{
                   "links":{
                      "self":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/relationships/revision",
                      "related":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/related/revision"
                   },
                   "data":{
                      "type":"revision",
                      "id":"1b5ae738-94e9-457b-9f5f-6aa26b546d17"
                   }
                },
                "project":{
                   "links":{
                      "self":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/relationships/project",
                      "related":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b/related/project"
                   },
                   "data":{
                      "type":"project",
                      "id":"1b18fd1f-f590-4d80-842d-6d9df80db532"
                   }
                }
             },
             "links":{
                "self":{
                   "href":"https://subdomain.cop.blackduck.com/api/common/v0/runs/7078b2a5-4eeb-40da-840e-5dc82ceb822b",
                   "meta":{
                      "durable":"urn:x-swip:runs:7078b2a5-4eeb-40da-840e-5dc82ceb822b"
                   }
                }
             },
             "meta":{
                "etag":"W/\
                "21htjncrjr8crekl0il794g07g83pnbqrt2t8rsod4clvpmn6528tr82m3lb8f\
                jivlg6l0hjsn6pf5lc7oin8mgv5924ekuuj19fb6gedp3g6znh4jrosedc29fau0\
                kaco7hpds0\"",
                "organization-id":"b5ma5ppigp6673ublabcihhd9g",
                "in-trash":false
             }
          },
          
       ],
       "included":[
    
       ],
       "meta":{
          "offset":0,
          "limit":25,
          "total":3
       },
       "links":{
          "next":null,
          "prev":null,
          "first":"https://subdomain.cop.blackduck.com/v0/runs?page%5Blimit%5D=25&page%5Boffset%5D=0&filter%5Brun%5D%5Brevision%5D%5Bid%5D%5B%24eq%5D=1b5ae738-94e9-457b-9f5f-6aa26b546d17&tenant-id=b5ma5ppigp6673ublabcihhd9g",
          "last":"https://subdomain.cop.blackduck.com/v0/runs?page%5Blimit%5D=25&page%5Boffset%5D=0&filter%5Brun%5D%5Brevision%5D%5Bid%5D%5B%24eq%5D=1b5ae738-94e9-457b-9f5f-6aa26b546d17&tenant-id=b5ma5ppigp6673ublabcihhd9g"
       }
    }                        

    The run id is on line 5, and you can extract it using: data[0].id.

  3. Use the run id to get run properties from the v0/run-properties endpoint.
    Request:
     curl -X GET https://{subdomain}.cop.blackduck.com/api/common/v0/run-properties?page[limit]=3&filter[run-property][run][id][$eq]={run_id}&filter[run-property][property-name][$eq]=enabled-checkers
    -H "accept: application/vnd.api+json"
    -H 'Authorization: Bearer {JWT}'
    Response:
    {
       "data":[
          {
             "type":"run-property",
             "id":"28287506-1479-485d-9c19-cd45c23c6b1f",
             "attributes":{
                "string-list-value":[
                   "ALLOC_FREE_MISMATCH",
                   "ANDROID_CAPABILITY_LEAK",
                   "ANDROID_DEBUG_MODE",
                   "ANGULAR_EXPRESSION_INJECTION",
                   "ANGULAR_SCE_DISABLED",
                   "ARRAY_VS_SINGLETON",
                   "ASPNET_MVC_VERSION_HEADER",
                   "WRONG_METHOD",
                   "XML_EXTERNAL_ENTITY",
                   "XPATH_INJECTION",
                   "XSS"
                ],
                "type":"string_list",
                "namespace":"tool-domain-service",
                "end-timestamp":null,
                "integer-list-value":null,
                "reference-value":null,
                "duration":null,
                "integer-value":null,
                "reference-list-value":null,
                "property-name":"enabled-checkers",
                "start-timestamp":null,
                "string-value":null
             },
             "relationships":{
                "run":{
                   "links":{
                      "self":"https://subdomain.cop.blackduck.com/api/common/v0/run-properties/28287506-1479-485d-9c19-cd45c23c6b1f/relationships/run",
                      "related":"https://subdomain.cop.blackduck.com/api/common/v0/run-properties/28287506-1479-485d-9c19-cd45c23c6b1f/related/run"
                   },
                   "data":{
                      "type":"run",
                      "id":"7078b2a5-4eeb-40da-840e-5dc82ceb822b"
                   }
                }
             },
             "links":{
                "self":{
                   "href":"https://subdomain.cop.blackduck.com/api/common/v0/run-properties/28287506-1479-485d-9c19-cd45c23c6b1f",
                   "meta":{
                      "durable":"urn:x-swip:run-properties:28287506-1479-485d-9c19-cd45c23c6b1f"
                   }
                }
             },
             "meta":{
                "etag":"W/\
                "ursv0t9778tumtflt7gn9aq2ciiajuf7rdbd83pjbiuj8ua6r13t3qquu5urgi8\
                3i8r40gf26ku50e7ntjj53v6hkmnatelkpl51d2d9htvt7ls6gf4v5l7ohczaba12\
                kr5dfp1s8qhv9ol41s4g8\"",
                "organization-id":"b5ma5ppigp6673ublabcihhd9g",
                "in-trash":false
             }
          }
       ],
       "included":[
    
       ],
       "meta":{
          "offset":0,
          "limit":25,
          "total":1
       },
       "links":{
          "next":null,
          "prev":null,
          "first":"https://subdomain.cop.blackduck.com/v0/run-properties?page%5Blimit%5D=25&filter%5Brun-property%5D%5Brun%5D%5Bid%5D%5B%24eq%5D=7078b2a5-4eeb-40da-840e-5dc82ceb822b&page%5Boffset%5D=0&tenant-id=b5ma5ppigp6673ublabcihhd9g",
          "last":"https://subdomain.cop.blackduck.com/v0/run-properties?page%5Blimit%5D=25&filter%5Brun-property%5D%5Brun%5D%5Bid%5D%5B%24eq%5D=7078b2a5-4eeb-40da-840e-5dc82ceb822b&page%5Boffset%5D=0&tenant-id=b5ma5ppigp6673ublabcihhd9g"
       }
    }                                   
    The list of checkers begins on line 8, and you can extract it using: data[0].attributes.string-list-value.