Handles all requests relating to volumes.
-
class API(db_driver=None, image_service=None)
Bases: cinder.db.base.Base
API for interacting with the volume manager.
-
accept_transfer(context, target_obj, *args, **kwargs)
-
attach(context, target_obj, *args, **kwargs)
-
begin_detaching(context, target_obj, *args, **kwargs)
-
check_attach(context, target_obj, *args, **kwargs)
-
check_detach(context, target_obj, *args, **kwargs)
-
copy_volume_to_image(context, target_obj, *args, **kwargs)
Create a new image from the specified volume.
-
create(context, size, name, description, snapshot=None, image_id=None, volume_type=None, metadata=None, availability_zone=None, source_volume=None, scheduler_hints=None, backup_source_volume=None)
-
create_snapshot(context, volume, name, description, metadata=None)
-
create_snapshot_force(context, volume, name, description, metadata=None)
-
delete(context, target_obj, *args, **kwargs)
-
delete_snapshot(context, target_obj, *args, **kwargs)
-
delete_snapshot_metadata(context, snapshot, key)
Delete the given metadata item from a snapshot.
-
delete_volume_admin_metadata(context, target_obj, *args, **kwargs)
Delete the given administration metadata item from a volume.
-
delete_volume_metadata(context, target_obj, *args, **kwargs)
Delete the given metadata item from a volume.
-
detach(context, target_obj, *args, **kwargs)
-
extend(context, target_obj, *args, **kwargs)
-
get(context, volume_id)
-
get_all(context, marker=None, limit=None, sort_key='created_at', sort_dir='desc', filters={})
-
get_all_snapshots(context, search_opts=None)
-
get_snapshot(context, snapshot_id)
-
get_snapshot_metadata(context, snapshot)
Get all metadata associated with a snapshot.
-
get_snapshot_metadata_value(snapshot, key)
-
get_volume(context, volume_id)
-
get_volume_admin_metadata(context, target_obj, *args, **kwargs)
Get all administration metadata associated with a volume.
-
get_volume_image_metadata(context, target_obj, *args, **kwargs)
-
get_volume_metadata(context, target_obj, *args, **kwargs)
Get all metadata associated with a volume.
-
get_volume_metadata_value(volume, key)
Get value of particular metadata key.
-
initialize_connection(context, target_obj, *args, **kwargs)
-
list_availability_zones()
Describe the known availability zones
:retval list of dicts, each with a ‘name’ and ‘available’ key
-
migrate_volume(context, target_obj, *args, **kwargs)
Migrate the volume to the specified host.
-
migrate_volume_completion(context, target_obj, *args, **kwargs)
-
reserve_volume(context, target_obj, *args, **kwargs)
-
roll_detaching(context, target_obj, *args, **kwargs)
-
terminate_connection(context, target_obj, *args, **kwargs)
-
unreserve_volume(context, target_obj, *args, **kwargs)
-
update(context, target_obj, *args, **kwargs)
-
update_readonly_flag(context, target_obj, *args, **kwargs)
-
update_snapshot(context, target_obj, *args, **kwargs)
-
update_snapshot_metadata(context, snapshot, metadata, delete=False)
Updates or creates snapshot metadata.
If delete is True, metadata items that are not specified in the
metadata argument will be deleted.
-
update_volume_admin_metadata(context, target_obj, *args, **kwargs)
Updates or creates volume administration metadata.
If delete is True, metadata items that are not specified in the
metadata argument will be deleted.
-
update_volume_metadata(context, target_obj, *args, **kwargs)
Updates or creates volume metadata.
If delete is True, metadata items that are not specified in the
metadata argument will be deleted.
-
class HostAPI
Bases: cinder.db.base.Base
-
get_host_uptime(context, host)
Returns the result of calling “uptime” on the target host.
-
host_power_action(context, host, action)
-
set_host_enabled(context, host, enabled)
Sets the specified host’s ability to accept new volumes.
-
set_host_maintenance(context, host, mode)
Start/Stop host maintenance window. On start, it triggers
volume evacuation.
-
check_policy(context, action, target_obj=None)
-
wrap_check_policy(func)
Check policy corresponding to the wrapped methods prior to execution
This decorator requires the first 3 args of the wrapped function
to be (self, context, volume)