cinderlib.persistence.base module

class DB(persistence_driver)[source]

Bases: object

Replacement for DB access methods.

This will serve as replacement for methods used by:

  • Drivers

  • OVOs’ get_by_id and save methods

  • DB implementation

Data will be retrieved using the persistence driver we setup.

GET_METHODS_PER_DB_MODEL = {cinder.objects.Volume.model: 'volume_get', cinder.objects.VolumeType.model: 'volume_type_get', cinder.objects.Snapshot.model: 'snapshot_get', cinder.objects.QualityOfServiceSpecs.model: 'qos_specs_get'}
get_by_id(context, model, id, *args, **kwargs)[source]
classmethod image_volume_cache_get_by_volume_id(context, volume_id)[source]
qos_specs_get(context, qos_specs_id, inactive=False)[source]
snapshot_get(context, snapshot_id, *args, **kwargs)[source]
volume_admin_metadata_delete(context, volume_id, key)[source]
volume_get(context, volume_id, *args, **kwargs)[source]
volume_get_all_by_host(context, host, filters=None)[source]
volume_type_get(context, id, inactive=False, expected_fields=None)[source]
class PersistenceDriverBase(**kwargs)[source]

Bases: object

Provide Metadata Persistency for our resources.

This class will be used to store new resources as they are created, updated, and removed, as well as provide a mechanism for users to retrieve volumes, snapshots, and connections.

property db
delete_connection(connection)[source]
delete_key_value(key)[source]
delete_snapshot(snapshot)[source]
delete_volume(volume)[source]
get_changed_fields(resource)[source]
get_connections(connection_id=None, volume_id=None)[source]
get_fields(resource)[source]
get_key_values(key)[source]
get_snapshots(snapshot_id=None, snapshot_name=None, volume_id=None)[source]
get_volumes(volume_id=None, volume_name=None, backend_name=None)[source]
reset_change_tracker(resource, fields=None)[source]
set_connection(connection)[source]
set_key_value(key_value)[source]
set_snapshot(snapshot)[source]
set_volume(volume)[source]
vol_type_to_dict(volume_type)[source]