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
volume – The value can be the ID of a volume or a
Volume
instance.
One Volume
ResourceNotFound
when no resource can be found.
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.
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.
all_projects: Whether return the volumes in all projects
on “available” for example.
A generator of volume objects.
Create a new volume from attributes
attrs (dict) – Keyword arguments which will be used to create
a Volume
,
comprised of the properties on the Volume class.
The results of volume creation
Volume
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.
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
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.
direction combinations. If you omit the sort direction in a set, default is desc.
project_id: Project ID to query backups for.
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.
None
Restore a Backup to volume
Get a single type
type – The value can be the ID of a type or a
Type
instance.
One Type
ResourceNotFound
when no resource can be found.
Retrieve a generator of volume types
A generator of volume type objects.
Create a new type from attributes
attrs (dict) – Keyword arguments which will be used to create
a Type
,
comprised of the properties on the Type class.
The results of type creation
Type
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
snapshot – The value can be the ID of a snapshot or a
Snapshot
instance.
One Snapshot
ResourceNotFound
when no resource can be found.
Retrieve a generator of snapshots
details (bool) – When set to False
Snapshot
objects will be returned. The default, True
, will cause
more attributes to be returned.
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.
all_projects: Whether return the snapshots in all projects.
project_id: Filter the snapshots by project.
volume_id: volume id of a snapshot.
filter on “available” for example.
A generator of snapshot objects.
Create a new snapshot from attributes
attrs (dict) – Keyword arguments which will be used to create
a Snapshot
,
comprised of the properties on the Snapshot class.
The results of snapshot creation
Snapshot
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
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.