modify 'v1' in the comment to 'v2'
Change-Id: Ib1b44aefdaf527532367b80a14a24ae545c7c97a
This commit is contained in:
@@ -27,7 +27,7 @@ FREEZER_SERVICE_TYPE = 'backup'
|
|||||||
|
|
||||||
|
|
||||||
class Client(object):
|
class Client(object):
|
||||||
"""Client for the OpenStack Disaster Recovery v1 API.
|
"""Client for the OpenStack Disaster Recovery v2 API.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, token=None, username=None, password=None,
|
def __init__(self, token=None, username=None, password=None,
|
||||||
@@ -37,7 +37,7 @@ class Client(object):
|
|||||||
project_domain_name=None, project_domain_id=None,
|
project_domain_name=None, project_domain_id=None,
|
||||||
cert=None, cacert=None, insecure=False, project_id=None):
|
cert=None, cacert=None, insecure=False, project_id=None):
|
||||||
"""
|
"""
|
||||||
Initialize a new client for the Disaster Recovery v1 API.
|
Initialize a new client for the Disaster Recovery v2 API.
|
||||||
:param token: keystone token
|
:param token: keystone token
|
||||||
:param username: openstack username
|
:param username: openstack username
|
||||||
:param password: openstack password
|
:param password: openstack password
|
||||||
|
@@ -96,7 +96,7 @@ class JobManager(object):
|
|||||||
result: string 'success' or 'already started'
|
result: string 'success' or 'already started'
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
# endpoint /v1/jobs/{job_id}/event
|
# endpoint /v2/jobs/{job_id}/event
|
||||||
endpoint = '{0}{1}/event'.format(self.endpoint, job_id)
|
endpoint = '{0}{1}/event'.format(self.endpoint, job_id)
|
||||||
doc = {"start": None}
|
doc = {"start": None}
|
||||||
r = requests.post(endpoint,
|
r = requests.post(endpoint,
|
||||||
@@ -117,7 +117,7 @@ class JobManager(object):
|
|||||||
result: string 'success' or 'already stopped'
|
result: string 'success' or 'already stopped'
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
# endpoint /v1/jobs/{job_id}/event
|
# endpoint /v2/jobs/{job_id}/event
|
||||||
endpoint = '{0}{1}/event'.format(self.endpoint, job_id)
|
endpoint = '{0}{1}/event'.format(self.endpoint, job_id)
|
||||||
doc = {"stop": None}
|
doc = {"stop": None}
|
||||||
r = requests.post(endpoint,
|
r = requests.post(endpoint,
|
||||||
@@ -138,7 +138,7 @@ class JobManager(object):
|
|||||||
result: string 'success' or 'already stopped'
|
result: string 'success' or 'already stopped'
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
# endpoint /v1/jobs/{job_id}/event
|
# endpoint /v2/jobs/{job_id}/event
|
||||||
endpoint = '{0}{1}/event'.format(self.endpoint, job_id)
|
endpoint = '{0}{1}/event'.format(self.endpoint, job_id)
|
||||||
doc = {"abort": None}
|
doc = {"abort": None}
|
||||||
r = requests.post(endpoint,
|
r = requests.post(endpoint,
|
||||||
|
@@ -84,7 +84,7 @@ class SessionManager(object):
|
|||||||
return r.json()['version']
|
return r.json()['version']
|
||||||
|
|
||||||
def add_job(self, session_id, job_id):
|
def add_job(self, session_id, job_id):
|
||||||
# endpoint /v1/sessions/{sessions_id}/jobs/{job_id}
|
# endpoint /v2/sessions/{sessions_id}/jobs/{job_id}
|
||||||
endpoint = '{0}{1}/jobs/{2}'.format(self.endpoint, session_id, job_id)
|
endpoint = '{0}{1}/jobs/{2}'.format(self.endpoint, session_id, job_id)
|
||||||
r = requests.put(endpoint,
|
r = requests.put(endpoint,
|
||||||
headers=self.headers, verify=self.verify)
|
headers=self.headers, verify=self.verify)
|
||||||
@@ -93,7 +93,7 @@ class SessionManager(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
def remove_job(self, session_id, job_id):
|
def remove_job(self, session_id, job_id):
|
||||||
# endpoint /v1/sessions/{sessions_id}/jobs/{job_id}
|
# endpoint /v2/sessions/{sessions_id}/jobs/{job_id}
|
||||||
endpoint = '{0}{1}/jobs/{2}'.format(self.endpoint, session_id, job_id)
|
endpoint = '{0}{1}/jobs/{2}'.format(self.endpoint, session_id, job_id)
|
||||||
retry = 5
|
retry = 5
|
||||||
r = ''
|
r = ''
|
||||||
@@ -122,7 +122,7 @@ class SessionManager(object):
|
|||||||
{ result: string 'running' or 'error',
|
{ result: string 'running' or 'error',
|
||||||
'session_tag': the new session_tag )
|
'session_tag': the new session_tag )
|
||||||
"""
|
"""
|
||||||
# endpoint /v1/sessions/{sessions_id}/action
|
# endpoint /v2/sessions/{sessions_id}/action
|
||||||
endpoint = '{0}{1}/action'.format(self.endpoint, session_id)
|
endpoint = '{0}{1}/action'.format(self.endpoint, session_id)
|
||||||
doc = {"start": {
|
doc = {"start": {
|
||||||
"job_id": job_id,
|
"job_id": job_id,
|
||||||
@@ -147,7 +147,7 @@ class SessionManager(object):
|
|||||||
:param result:
|
:param result:
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
# endpoint /v1/sessions/{sessions_id}/action
|
# endpoint /v2/sessions/{sessions_id}/action
|
||||||
endpoint = '{0}{1}/action'.format(self.endpoint, session_id)
|
endpoint = '{0}{1}/action'.format(self.endpoint, session_id)
|
||||||
doc = {"end": {
|
doc = {"end": {
|
||||||
"job_id": job_id,
|
"job_id": job_id,
|
||||||
|
Reference in New Issue
Block a user