For details on how to use block_storage, see Using OpenStack Block Storage
The block_storage high-level interface is available through the
block_storage
member of a Connection
object.
The block_storage
member will only be added if the service is detected.
Get a single volume
Retrieve a generator of volumes
details (bool) – When set to False
no extended attributes
will be returned. The default, True
, will cause objects with
additional attributes to be returned.
all_projects (bool) – When set to True
, list volumes from all
projects. Admin-only by default.
query (kwargs) –
Optional query parameters to be sent to limit the volumes being returned. Available parameters include:
name: Name of the volume as a string.
status: Value of the status of the volume so that you can filter on “available” for example.
A generator of volume objects.
Create a new volume from attributes
Delete a volume
volume – The value can be either the ID of a volume or a
Volume
instance.
ignore_missing (bool) – When set to False
ResourceNotFound
will be raised
when the volume does not exist. When set to True
, no
exception will be set when attempting to delete a nonexistent
volume.
force (bool) – Whether to try forcing volume deletion.
None
Retrieve a generator of backups
details (bool) – When set to False
no additional details will
be returned. The default, True
, will cause objects with
additional attributes to be returned.
query (dict) –
Optional query parameters to be sent to limit the resources being returned:
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.
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.
A generator of backup objects.
Get a backup
Create a new Backup from attributes with native API
Delete a CloudBackup
backup – The value can be the ID of a backup or a
Backup
instance
ignore_missing (bool) – When set to False
ResourceNotFound
will be raised when
the zone does not exist.
When set to True
, no exception will be set when attempting to
delete a nonexistent zone.
force (bool) – Whether to try forcing backup deletion
None
Restore a Backup to volume
Get a single type
Retrieve a generator of volume types
A generator of volume type objects.
Create a new type from attributes
Delete a type
type – The value can be either the ID of a type or a
Type
instance.
ignore_missing (bool) – When set to False
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.
None
Get a single snapshot
Retrieve a generator of snapshots
details (bool) – When set to False
Snapshot
objects will be returned. The default, True
, will cause
SnapshotDetail
objects to be returned.
all_projects (bool) – When set to True
, list snapshots from all
projects. Admin-only by default.
query (kwargs) –
Optional query parameters to be sent to limit the snapshots being returned. Available parameters include:
name: Name of the snapshot as a string.
volume_id: volume id of a snapshot.
status: Value of the status of the snapshot so that you can filter on “available” for example.
A generator of snapshot objects.
Create a new snapshot from attributes
Delete a snapshot
snapshot – The value can be either the ID of a snapshot or a
Snapshot
instance.
ignore_missing (bool) – When set to False
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.
None
Returns a generator of cinder Back-end storage pools
query (kwargs) – Optional query parameters to be sent to limit the resources being returned.
:returns A generator of cinder Back-end storage pools objects
Show QuotaSet information for the project
project – ID or instance of
Project
of the project for
which the quota should be retrieved
usage (bool) – When set to True
quota usage and reservations
would be filled.
query (dict) – Additional query parameters to use.
One QuotaSet
ResourceNotFound
when no resource can be found.
Show QuotaSet defaults for the project
project – ID or instance of
Project
of the project for
which the quota should be retrieved
One QuotaSet
ResourceNotFound
when no resource can be found.
Reset Quota for the project/user.
project – ID or instance of
Project
of the project for
which the quota should be resetted.
query (dict) – Additional parameters to be used.
None
Update a QuotaSet.
Wait for a resource to be in a particular status.
res – The resource to wait on to reach the specified status.
The resource must have a status
attribute.
status – Desired status.
failures (list
) – Statuses that would be interpreted as failures.
interval – Number of seconds to wait before to consecutive checks. Default to 2.
wait – Maximum number of seconds to wait before the change. Default to 120.
The resource is returned on success.
ResourceTimeout
if transition
to the desired status failed to occur in specified seconds.
ResourceFailure
if the resource
has transited to one of the failure statuses.
AttributeError
if the resource does not have a
status
attribute.
Wait for a resource to be deleted.
res – The resource to wait on to be deleted.
interval – Number of seconds to wait before to consecutive checks. Default to 2.
wait – Maximum number of seconds to wait before the change. Default to 120.
The resource is returned on success.
ResourceTimeout
if transition
to delete failed to occur in the specified seconds.
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.