cinder.objects.volume_attachment module¶
- class VolumeAttachment(context: Any = None, **kwargs: Any)¶
Bases:
CinderPersistentObject,CinderObject,CinderObjectDictCompat,CinderComparableObject- OPTIONAL_FIELDS = ('volume',)¶
- VERSION: str = '1.3'¶
Object version field
Each service has its set of objects, each with a version attached. When a client attempts to call an object method, the server checks to see if the version of that object matches (in a compatible way) its object implementation. If so, cool, and if not, fail.
This version is allowed to have three parts,
X.Y.Z, where the.Zelement is reserved for stable branch backports. The.Zis ignored for the purposes of triggering a backport, which means anything changed under a.Zmust be additive and non-destructive such that a node that knows aboutX.Ycan considerX.Y.Zequivalent.
- property attach_mode: Any¶
- property attach_status: Any¶
- property attach_time: Any¶
- property attached_host: Any¶
- property connection_info: Any¶
- property connector: Any¶
- create()¶
- property created_at: Any¶
- property deleted: Any¶
- property deleted_at: Any¶
- destroy()¶
- property detach_time: Any¶
- fields: MutableMapping[str, Field[Any]] = {'attach_mode': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'attach_status': VolumeAttachStatus(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True,valid_values=('attached', 'attaching', 'detached', 'error_attaching', 'error_detaching', 'reserved', 'deleted')), 'attach_time': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'attached_host': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'connection_info': Dict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'connector': Dict(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'deleted': Boolean(default=False,nullable=True), 'deleted_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'detach_time': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'instance_uuid': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'mountpoint': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'volume': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'volume_id': UUID(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}¶
The fields present in this object as
key:fieldpairs.For example:
fields = { 'foo': obj_fields.IntegerField(), 'bar': obj_fields.StringField(), }
- finish_attach(instance_uuid, host_name, mount_point, attach_mode='rw')¶
- property id: Any¶
- property instance_uuid: Any¶
- model¶
alias of
VolumeAttachment
- property mountpoint: Any¶
- obj_extra_fields: Sequence[str] = ['project_id', 'volume_host']¶
List of additional object attributes to expose alongside
fields.Names listed here are typically implemented as Python properties and are included in
obj_fieldsand exposed through iteration, but they are not versioned and not serialized during RPC:class MyObject(VersionedObject): fields = {'foo': obj_fields.IntegerField()} obj_extra_fields = ['bar'] @property def bar(self): return self.foo * 2
- obj_load_attr(attrname)¶
Load an additional attribute from the real object.
This should load self.$attrname and cache any data that might be useful for future load operations.
- property project_id¶
- save()¶
Save the changed fields back to the store.
This is optional for subclasses, but is presented here in the base class for consistency among those that do.
- property updated_at: Any¶
- property volume: Any¶
- property volume_host¶
- property volume_id: Any¶
- class VolumeAttachmentList(*args: Any, **kwargs: Any)¶
Bases:
ObjectListBase,CinderObject- VERSION: str = '1.1'¶
Object version field
Each service has its set of objects, each with a version attached. When a client attempts to call an object method, the server checks to see if the version of that object matches (in a compatible way) its object implementation. If so, cool, and if not, fail.
This version is allowed to have three parts,
X.Y.Z, where the.Zelement is reserved for stable branch backports. The.Zis ignored for the purposes of triggering a backport, which means anything changed under a.Zmust be additive and non-destructive such that a node that knows aboutX.Ycan considerX.Y.Zequivalent.
- fields: MutableMapping[str, Field[Any]] = {'objects': List(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False)}¶
The fields present in this object as
key:fieldpairs.For example:
fields = { 'foo': obj_fields.IntegerField(), 'bar': obj_fields.StringField(), }
- classmethod get_all(context, search_opts=None, marker=None, limit=None, offset=None, sort_keys=None, sort_direction=None)¶
- classmethod get_all_by_host(context, host, search_opts=None)¶
- classmethod get_all_by_instance_uuid(context, instance_uuid, search_opts=None)¶
- classmethod get_all_by_project(context, project_id, search_opts=None, marker=None, limit=None, offset=None, sort_keys=None, sort_direction=None)¶
- classmethod get_all_by_volume_id(context, volume_id)¶
- property objects: Any¶