Merge "Add image tasks schema methods"
This commit is contained in:
commit
eb5766916e
|
@ -52,3 +52,15 @@ Task Operations
|
|||
.. automethod:: openstack.image.v2._proxy.Proxy.create_task
|
||||
.. automethod:: openstack.image.v2._proxy.Proxy.get_task
|
||||
.. automethod:: openstack.image.v2._proxy.Proxy.wait_for_task
|
||||
|
||||
Schema Operations
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. autoclass:: openstack.image.v2._proxy.Proxy
|
||||
|
||||
.. automethod:: openstack.image.v2._proxy.Proxy.get_images_schema
|
||||
.. automethod:: openstack.image.v2._proxy.Proxy.get_image_schema
|
||||
.. automethod:: openstack.image.v2._proxy.Proxy.get_members_schema
|
||||
.. automethod:: openstack.image.v2._proxy.Proxy.get_member_schema
|
||||
.. automethod:: openstack.image.v2._proxy.Proxy.get_tasks_schema
|
||||
.. automethod:: openstack.image.v2._proxy.Proxy.get_task_schema
|
||||
|
|
|
@ -640,3 +640,23 @@ class Proxy(_base_proxy.BaseImageProxy):
|
|||
failures = ['failure'] if failures is None else failures
|
||||
return resource.wait_for_status(
|
||||
self, task, status, failures, interval, wait)
|
||||
|
||||
def get_tasks_schema(self):
|
||||
"""Get image tasks schema
|
||||
|
||||
:returns: One :class:`~openstack.image.v2.schema.Schema`
|
||||
:raises: :class:`~openstack.exceptions.ResourceNotFound`
|
||||
when no resource can be found.
|
||||
"""
|
||||
return self._get(_schema.Schema, requires_id=False,
|
||||
base_path='/schemas/tasks')
|
||||
|
||||
def get_task_schema(self):
|
||||
"""Get image task schema
|
||||
|
||||
:returns: One :class:`~openstack.image.v2.schema.Schema`
|
||||
:raises: :class:`~openstack.exceptions.ResourceNotFound`
|
||||
when no resource can be found.
|
||||
"""
|
||||
return self._get(_schema.Schema, requires_id=False,
|
||||
base_path='/schemas/task')
|
||||
|
|
|
@ -215,3 +215,17 @@ class TestImageProxy(test_proxy_base.TestProxyBase):
|
|||
self.proxy.wait_for_task,
|
||||
method_args=[value],
|
||||
expected_args=[value, 'success', ['failure'], 2, 120])
|
||||
|
||||
def test_tasks_schema_get(self):
|
||||
self._verify2("openstack.proxy.Proxy._get",
|
||||
self.proxy.get_tasks_schema,
|
||||
expected_args=[schema.Schema],
|
||||
expected_kwargs={'base_path': '/schemas/tasks',
|
||||
'requires_id': False})
|
||||
|
||||
def test_task_schema_get(self):
|
||||
self._verify2("openstack.proxy.Proxy._get",
|
||||
self.proxy.get_task_schema,
|
||||
expected_args=[schema.Schema],
|
||||
expected_kwargs={'base_path': '/schemas/task',
|
||||
'requires_id': False})
|
||||
|
|
Loading…
Reference in New Issue