Merge "Block storage - reindentation of the docstrings" into feature/r1
This commit is contained in:
@@ -28,12 +28,12 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
"""Get a single snapshot
|
||||
|
||||
:param snapshot: The value can be the ID of a snapshot or a
|
||||
:class:`~openstack.block_storage.v2.snapshot.Snapshot`
|
||||
instance.
|
||||
:class:`~openstack.block_storage.v2.snapshot.Snapshot`
|
||||
instance.
|
||||
|
||||
:returns: One :class:`~openstack.block_storage.v2.snapshot.Snapshot`
|
||||
:raises: :class:`~openstack.exceptions.ResourceNotFound`
|
||||
when no resource can be found.
|
||||
when no resource can be found.
|
||||
"""
|
||||
return self._get(_snapshot.Snapshot, snapshot)
|
||||
|
||||
@@ -41,10 +41,10 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
"""Retrieve a generator of snapshots
|
||||
|
||||
:param bool details: When set to ``False``
|
||||
:class:`~openstack.block_storage.v2.snapshot.Snapshot`
|
||||
objects will be returned. The default, ``True``, will cause
|
||||
:class:`~openstack.block_storage.v2.snapshot.SnapshotDetail`
|
||||
objects to be returned.
|
||||
:class:`~openstack.block_storage.v2.snapshot.Snapshot`
|
||||
objects will be returned. The default, ``True``, will cause
|
||||
:class:`~openstack.block_storage.v2.snapshot.SnapshotDetail`
|
||||
objects to be returned.
|
||||
:param kwargs query: Optional query parameters to be sent to limit
|
||||
the snapshots being returned. Available parameters include:
|
||||
|
||||
@@ -52,7 +52,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
* all_projects: Whether return the snapshots in all projects.
|
||||
* volume_id: volume id of a snapshot.
|
||||
* status: Value of the status of the snapshot so that you can
|
||||
filter on "available" for example.
|
||||
filter on "available" for example.
|
||||
|
||||
:returns: A generator of snapshot objects.
|
||||
"""
|
||||
@@ -75,13 +75,13 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
"""Delete a snapshot
|
||||
|
||||
:param snapshot: The value can be either the ID of a snapshot or a
|
||||
:class:`~openstack.block_storage.v2.snapshot.Snapshot`
|
||||
instance.
|
||||
:class:`~openstack.block_storage.v2.snapshot.Snapshot`
|
||||
instance.
|
||||
:param bool ignore_missing: When set to ``False``
|
||||
:class:`~openstack.exceptions.ResourceNotFound` will be
|
||||
raised when the snapshot does not exist.
|
||||
When set to ``True``, no exception will be set when
|
||||
attempting to delete a nonexistent snapshot.
|
||||
:class:`~openstack.exceptions.ResourceNotFound` will be
|
||||
raised when the snapshot does not exist.
|
||||
When set to ``True``, no exception will be set when
|
||||
attempting to delete a nonexistent snapshot.
|
||||
|
||||
:returns: ``None``
|
||||
"""
|
||||
@@ -106,11 +106,11 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
"""Get a single type
|
||||
|
||||
:param type: The value can be the ID of a type or a
|
||||
:class:`~openstack.block_storage.v2.type.Type` instance.
|
||||
:class:`~openstack.block_storage.v2.type.Type` instance.
|
||||
|
||||
:returns: One :class:`~openstack.block_storage.v2.type.Type`
|
||||
:raises: :class:`~openstack.exceptions.ResourceNotFound`
|
||||
when no resource can be found.
|
||||
when no resource can be found.
|
||||
"""
|
||||
return self._get(_type.Type, type)
|
||||
|
||||
@@ -125,8 +125,8 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
"""Create a new type from attributes
|
||||
|
||||
:param dict attrs: Keyword arguments which will be used to create
|
||||
a :class:`~openstack.block_storage.v2.type.Type`,
|
||||
comprised of the properties on the Type class.
|
||||
a :class:`~openstack.block_storage.v2.type.Type`,
|
||||
comprised of the properties on the Type class.
|
||||
|
||||
:returns: The results of type creation
|
||||
:rtype: :class:`~openstack.block_storage.v2.type.Type`
|
||||
@@ -137,12 +137,12 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
"""Delete a type
|
||||
|
||||
:param type: The value can be either the ID of a type or a
|
||||
:class:`~openstack.block_storage.v2.type.Type` instance.
|
||||
:class:`~openstack.block_storage.v2.type.Type` instance.
|
||||
:param bool ignore_missing: When set to ``False``
|
||||
:class:`~openstack.exceptions.ResourceNotFound` will be
|
||||
raised when the type does not exist.
|
||||
When set to ``True``, no exception will be set when
|
||||
attempting to delete a nonexistent type.
|
||||
:class:`~openstack.exceptions.ResourceNotFound` will be
|
||||
raised when the type does not exist.
|
||||
When set to ``True``, no exception will be set when
|
||||
attempting to delete a nonexistent type.
|
||||
|
||||
:returns: ``None``
|
||||
"""
|
||||
@@ -209,7 +209,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
|
||||
:returns: One :class:`~openstack.block_storage.v2.volume.Volume`
|
||||
:raises: :class:`~openstack.exceptions.ResourceNotFound`
|
||||
when no resource can be found.
|
||||
when no resource can be found.
|
||||
"""
|
||||
return self._find(_volume.Volume, name_or_id,
|
||||
ignore_missing=ignore_missing)
|
||||
@@ -226,7 +226,7 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
* name: Name of the volume as a string.
|
||||
* all_projects: Whether return the volumes in all projects
|
||||
* status: Value of the status of the volume so that you can filter
|
||||
on "available" for example.
|
||||
on "available" for example.
|
||||
|
||||
:returns: A generator of volume objects.
|
||||
"""
|
||||
@@ -363,7 +363,8 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
:param volume: The value can be either the ID of a volume or a
|
||||
:class:`~openstack.block_storage.v2.volume.Volume` instance.
|
||||
|
||||
:returns: None """
|
||||
:returns: None
|
||||
"""
|
||||
volume = self._get_resource(_volume.Volume, volume)
|
||||
volume.unmanage(self)
|
||||
|
||||
@@ -431,13 +432,13 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
* offset: pagination marker
|
||||
* limit: pagination limit
|
||||
* sort_key: Sorts by an attribute. A valid value is
|
||||
name, status, container_format, disk_format, size, id,
|
||||
created_at, or updated_at. Default is created_at.
|
||||
The API uses the natural sorting direction of the
|
||||
sort_key attribute value.
|
||||
name, status, container_format, disk_format, size, id,
|
||||
created_at, or updated_at. Default is created_at.
|
||||
The API uses the natural sorting direction of the
|
||||
sort_key attribute value.
|
||||
* sort_dir: Sorts by one or more sets of attribute and sort
|
||||
direction combinations. If you omit the sort direction
|
||||
in a set, default is desc.
|
||||
direction combinations. If you omit the sort direction
|
||||
in a set, default is desc.
|
||||
|
||||
:returns: A generator of backup objects.
|
||||
"""
|
||||
@@ -521,22 +522,22 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
"""Wait for a resource to be in a particular status.
|
||||
|
||||
:param res: The resource to wait on to reach the specified status.
|
||||
The resource must have a ``status`` attribute.
|
||||
The resource must have a ``status`` attribute.
|
||||
:type resource: A :class:`~openstack.resource.Resource` object.
|
||||
:param status: Desired status.
|
||||
:param failures: Statuses that would be interpreted as failures.
|
||||
:type failures: :py:class:`list`
|
||||
:param interval: Number of seconds to wait before to consecutive
|
||||
checks. Default to 2.
|
||||
checks. Default to 2.
|
||||
:param wait: Maximum number of seconds to wait before the change.
|
||||
Default to 120.
|
||||
Default to 120.
|
||||
:returns: The resource is returned on success.
|
||||
:raises: :class:`~openstack.exceptions.ResourceTimeout` if transition
|
||||
to the desired status failed to occur in specified seconds.
|
||||
to the desired status failed to occur in specified seconds.
|
||||
:raises: :class:`~openstack.exceptions.ResourceFailure` if the resource
|
||||
has transited to one of the failure statuses.
|
||||
has transited to one of the failure statuses.
|
||||
:raises: :class:`~AttributeError` if the resource does not have a
|
||||
``status`` attribute.
|
||||
``status`` attribute.
|
||||
"""
|
||||
failures = ['error'] if failures is None else failures
|
||||
return resource.wait_for_status(
|
||||
@@ -548,12 +549,12 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
:param res: The resource to wait on to be deleted.
|
||||
:type resource: A :class:`~openstack.resource.Resource` object.
|
||||
:param interval: Number of seconds to wait before to consecutive
|
||||
checks. Default to 2.
|
||||
checks. Default to 2.
|
||||
:param wait: Maximum number of seconds to wait before the change.
|
||||
Default to 120.
|
||||
Default to 120.
|
||||
:returns: The resource is returned on success.
|
||||
:raises: :class:`~openstack.exceptions.ResourceTimeout` if transition
|
||||
to delete failed to occur in the specified seconds.
|
||||
to delete failed to occur in the specified seconds.
|
||||
"""
|
||||
return resource.wait_for_delete(self, res, interval, wait)
|
||||
|
||||
|
||||
@@ -743,13 +743,13 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
* offset: pagination marker
|
||||
* limit: pagination limit
|
||||
* sort_key: Sorts by an attribute. A valid value is
|
||||
name, status, container_format, disk_format, size, id,
|
||||
created_at, or updated_at. Default is created_at.
|
||||
The API uses the natural sorting direction of the
|
||||
sort_key attribute value.
|
||||
name, status, container_format, disk_format, size, id,
|
||||
created_at, or updated_at. Default is created_at.
|
||||
The API uses the natural sorting direction of the
|
||||
sort_key attribute value.
|
||||
* sort_dir: Sorts by one or more sets of attribute and sort
|
||||
direction combinations. If you omit the sort direction
|
||||
in a set, default is desc.
|
||||
direction combinations. If you omit the sort direction
|
||||
in a set, default is desc.
|
||||
* project_id: Project ID to query backups for.
|
||||
|
||||
:returns: A generator of backup objects.
|
||||
@@ -914,15 +914,15 @@ class Proxy(_base_proxy.BaseBlockStorageProxy):
|
||||
resources being returned:
|
||||
|
||||
* sort: Comma-separated list of sort keys and optional sort
|
||||
directions in the form of <key> [:<direction>]. A valid
|
||||
direction is asc (ascending) or desc (descending).
|
||||
directions in the form of <key> [:<direction>]. A valid
|
||||
direction is asc (ascending) or desc (descending).
|
||||
* limit: Requests a page size of items. Returns a number of items
|
||||
up to a limit value. Use the limit parameter to make an
|
||||
initial limited request and use the ID of the last-seen item
|
||||
from the response as the marker parameter value in a
|
||||
subsequent limited request.
|
||||
up to a limit value. Use the limit parameter to make an
|
||||
initial limited request and use the ID of the last-seen item
|
||||
from the response as the marker parameter value in a
|
||||
subsequent limited request.
|
||||
* offset: Used in conjunction with limit to return a slice of
|
||||
items. Is where to start in the list.
|
||||
items. Is where to start in the list.
|
||||
* marker: The ID of the last-seen item.
|
||||
|
||||
:returns: A generator of group type objects.
|
||||
|
||||
Reference in New Issue
Block a user