cinderlib.objects module

class Connection(*args, **kwargs)[source]

Bases: cinderlib.objects.Object, cinderlib.objects.LazyVolumeAttr

Cinderlib Connection info that maps to VolumeAttachment.

On Pike we don’t have the connector field on the VolumeAttachment ORM instance so we use the connection_info to store everything.

We’ll have a dictionary:
{‘conn’: connection info

‘connector’: connector dictionary ‘device’: result of connect_volume}

OVO_CLASS
SIMPLE_JSON_IGNORE = ('volume',)
attach()[source]
property attached
property backend
property conn_info
classmethod connect(volume, connector, **kwargs)[source]
property connected
property connector
property connector_info
detach(force=False, ignore_errors=False, exc=None)[source]
property device
device_attached(device)[source]
disconnect(force=False)[source]
extend()[source]
classmethod get_by_id(connection_id)[source]
property path
property protocol
save()[source]
class KeyValue(key=None, value=None)[source]

Bases: object

class LazyVolumeAttr(volume)[source]

Bases: object

LAZY_PROPERTIES = ('volume',)
refresh()[source]
property volume
class NamedObject(backend, **fields_data)[source]

Bases: cinderlib.objects.Object

property description
property name
property name_in_storage
class Object(backend, **fields_data)[source]

Bases: object

Base class for our resource representation objects.

CONTEXT
DEFAULT_FIELDS_VALUES = {}
LAZY_PROPERTIES = ()
SIMPLE_JSON_IGNORE = ()
backend_class

alias of cinderlib.cinderlib.Backend

property dump
property dumps
property json
property jsons
classmethod load(json_src, save=False)[source]
static new_uuid()[source]
classmethod setup(persistence_driver, backend_class, project_id, user_id, non_uuid_ids)[source]
to_dict()[source]
to_json(simplified=True)[source]
to_jsons(simplified=True)[source]
class Snapshot(volume, **kwargs)[source]

Bases: cinderlib.objects.NamedObject, cinderlib.objects.LazyVolumeAttr

DEFAULT_FIELDS_VALUES = {'metadata': {}, 'status': 'creating'}
OVO_CLASS
SIMPLE_JSON_IGNORE = ('volume',)
create()[source]
create_volume(**new_vol_params)[source]
delete()[source]
classmethod get_by_id(snapshot_id)[source]
classmethod get_by_name(snapshot_name)[source]
save()[source]
class Volume(backend_or_vol, pool_name=None, **kwargs)[source]

Bases: cinderlib.objects.NamedObject

DEFAULT_FIELDS_VALUES = {'admin_metadata': {}, 'attach_status': 'detached', 'glance_metadata': {}, 'metadata': {}, 'project_id': cinder.context.RequestContext.project_id, 'size': 1, 'status': 'creating', 'user_id': cinder.context.RequestContext.user_id}
LAZY_PROPERTIES = ('snapshots', 'connections')
OVO_CLASS
SIMPLE_JSON_IGNORE = ('snapshots', 'volume_attachment')
attach()[source]
cleanup()[source]
clone(**new_vol_attrs)[source]
connect(connector_dict, **ovo_fields)[source]
property connections
create()[source]
create_snapshot(name='', description='', **kwargs)[source]
delete()[source]
detach(force=False, ignore_errors=False)[source]
disconnect(connection, force=False)[source]
extend(size)[source]
classmethod get_by_id(volume_id)[source]
classmethod get_by_name(volume_name)[source]
refresh()[source]
save()[source]
property snapshots
setup(persistence_driver, backend_class, project_id, user_id, non_uuid_ids)