How to use the blackduck.HubRestApi.HubInstance.VERSION_PHASES 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_project_version(self, project_obj, new_version_name, clone_version=None, parameters={}):
        url = self.get_link(project_obj, "versions")

        version_phase = parameters.get("phase", "PLANNING")
        if version_phase not in HubInstance.VERSION_PHASES:
            raise InvalidVersionPhase("The phase given {} is not in the list of valid phases ({})".format(
                version_phase, HubInstance.VERSION_PHASES))

        post_data = {
            "versionUrl": url,
            "cloneCategories": [
                "VULN_DATA",
                "COMPONENT_DATA"
            ],
            "versionName": new_version_name,
            "phase": version_phase,
            "distribution": parameters.get("distribution", "EXTERNAL")
        }
        if clone_version:
            post_data["cloneFromReleaseUrl"] = clone_version['_meta']['href']
        response = self.execute_post(url, data=post_data)
        return response
github blackducksoftware / hub-rest-api-python / blackduck / HubRestApi.py View on Github external
def create_project_version(self, project_obj, new_version_name, parameters={}):
        url = self.get_link(project_obj, "versions")

        version_phase = parameters.get("phase", "PLANNING")
        if version_phase not in HubInstance.VERSION_PHASES:
            raise InvalidVersionPhase("The phase given {} is not in the list of valid phases ({})".format(
                version_phase, HubInstance.VERSION_PHASES))

        post_data = {
            "versionUrl": url,
            "cloneCategories": [
                "VULN_DATA",
                "COMPONENT_DATA"
            ],
            "versionName": new_version_name,
            "phase": parameters.get("phase", "PLANNING"),
            "distribution": parameters.get("distribution", "EXTERNAL")
        }
        response = self.execute_post(url, data=post_data)
        return response
github blackducksoftware / hub-rest-api-python / blackduck / HubRestApi.py View on Github external
def create_project_version(self, project_obj, new_version_name, clone_version=None, parameters={}):
        url = self.get_link(project_obj, "versions")

        version_phase = parameters.get("phase", "PLANNING")
        if version_phase not in HubInstance.VERSION_PHASES:
            raise InvalidVersionPhase("The phase given {} is not in the list of valid phases ({})".format(
                version_phase, HubInstance.VERSION_PHASES))

        post_data = {
            "versionUrl": url,
            "cloneCategories": [
                "VULN_DATA",
                "COMPONENT_DATA"
            ],
            "versionName": new_version_name,
            "phase": version_phase,
            "distribution": parameters.get("distribution", "EXTERNAL")
        }
        if clone_version:
            post_data["cloneFromReleaseUrl"] = clone_version['_meta']['href']
        response = self.execute_post(url, data=post_data)
github blackducksoftware / hub-rest-api-python / blackduck / HubRestApi.py View on Github external
def create_project_version(self, project_obj, new_version_name, parameters={}):
        url = self.get_link(project_obj, "versions")

        version_phase = parameters.get("phase", "PLANNING")
        if version_phase not in HubInstance.VERSION_PHASES:
            raise InvalidVersionPhase("The phase given {} is not in the list of valid phases ({})".format(
                version_phase, HubInstance.VERSION_PHASES))

        post_data = {
            "versionUrl": url,
            "cloneCategories": [
                "VULN_DATA",
                "COMPONENT_DATA"
            ],
            "versionName": new_version_name,
            "phase": parameters.get("phase", "PLANNING"),
            "distribution": parameters.get("distribution", "EXTERNAL")
        }
        response = self.execute_post(url, data=post_data)
        return response