From f54fe375b2964c4db41edd86350573d370ae7025 Mon Sep 17 00:00:00 2001 From: Andrew Stockman Date: Fri, 7 Feb 2020 08:53:50 -0700 Subject: [PATCH] Adding requestScopeOrg to update and create --- caspyr/blueprint.py | 46 +++++---------------------------------------- 1 file changed, 5 insertions(+), 41 deletions(-) diff --git a/caspyr/blueprint.py b/caspyr/blueprint.py index 90d322e..e023675 100644 --- a/caspyr/blueprint.py +++ b/caspyr/blueprint.py @@ -105,6 +105,7 @@ def create(cls, bp_name, description, version, + request_scope_org, content ): """Creates a blueprint from a valid YAML input. @@ -136,6 +137,7 @@ def create(cls, 'description': description, 'tags': [], 'content': content, + 'requestScopeOrg': request_scope_org, 'version': version } i = session._request(f'{session.baseurl}{uri}', @@ -153,6 +155,7 @@ def update(cls, bp_name, description, version, + request_scope_org, content ): """Updates a blueprint from a valid YAML input. @@ -186,6 +189,7 @@ def update(cls, 'description': description, 'tags': [], 'content': content, + 'requestScopeOrg': request_scope_org, 'version': version } i = session._request(f'{session.baseurl}{uri}', @@ -370,44 +374,4 @@ def versions(cls, uri = f'/blueprint/api/blueprints/{blueprint_id}/versions' return session._request(f'{session.baseurl}{uri}', - request_method='GET')['content'] - - @classmethod - def release(cls, session, blueprint_id, version): - """Releases a version of the blueprint to the catalog - - :param session: The session object. - :type session: object - :param blueprint_id: The id of the blueprint that you want the details - of. - :type blueprint_id: string - :param version: the new version of the blueprint. - :type version: string - :return: Returns the HTTP status code. - :rtype: int - """ - - uri = f'/blueprint/api/blueprints/{blueprint_id}/versions/{version}/actions/release' - - return session._request(f'{session.baseurl}{uri}', - request_method='POST') - - @classmethod - def unrelease(cls, session, blueprint_id, version): - """Unreleases a version of the blueprint from the catalog. - - :param session: The session object. - :type session: object - :param blueprint_id: The id of the blueprint that you want the details - of. - :type blueprint_id: string - :param version: the new version of the blueprint. - :type version: string - :return: Returns the HTTP status code. - :rtype: int - """ - - uri = f'/blueprint/api/blueprints/{blueprint_id}/versions/{version}/actions/unrelease' - - return session._request(f'{session.baseurl}{uri}', - request_method='POST') \ No newline at end of file + request_method='GET')['content'] \ No newline at end of file