How to use the blackduck.HubRestApi.HubInstance.valid_vuln_status_report_formats function in blackduck

To help you get started, we’ve selected a few blackduck examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github blackducksoftware / hub-rest-api-python / blackduck / HubRestApi.py View on Github external
def create_vuln_status_report(self, format="CSV"):
        assert format in HubInstance.valid_vuln_status_report_formats, "Format must be one of {}".format(HubInstance.valid_vuln_status_report_formats)

        post_data = {
            "reportFormat": format,
            "locale": "en_US"
        }
        url = self.get_apibase() + "/vulnerability-status-reports"
        custom_headers = {
            'Content-Type': 'application/vnd.blackducksoftware.report-4+json',
            'Accept': 'application/vnd.blackducksoftware.report-4+json'
        }
        return self.execute_post(url, custom_headers=custom_headers, data=post_data)