def freeze(self, ro_uri): rosrs = ROSRS_Session(ro_test_config.ROSRS_URI, ro_test_config.ROSRS_ACCESS_TOKEN) service_uri = urljoin(ro_test_config.ROSRS_URI, "../evo/finalize/") body = { 'target': ro_uri, } body = json.dumps(body) reqheaders = {} (status, reason, headers, data) = rosrs.doRequest(uripath=service_uri, method="POST", body=body, ctype="application/json", reqheaders=reqheaders) job_location = get_location(headers) status = "RUNNING" while status == "RUNNING": (status, id) = parse_job(rosrs, job_location) return status
def createArchive(self, live_name,sp_name,freeze = True): service_uri = urljoin(ro_test_config.ROSRS_URI, "../evo/copy/") body = { 'copyfrom': live_name, 'target': sp_name, 'type': "ARCHIVE", 'finalize': ( "%s" % freeze).lower() } body = json.dumps(body) reqheaders = { 'token': ro_test_config.ROSRS_ACCESS_TOKEN, 'Slug' : sp_name, } rosrs = ROSRS_Session(ro_test_config.ROSRS_URI, ro_test_config.ROSRS_ACCESS_TOKEN) (status, reason, headers, data) = rosrs.doRequest(uripath=service_uri, method="POST", body=body, ctype="application/json", reqheaders=reqheaders) job_location = get_location(headers) status = "RUNNING" while status == "RUNNING": (status, id) = parse_job(rosrs, job_location) return (status, id)