cinder.objects.service module¶
- class Service(context: Any = None, **kwargs: Any)¶
Bases:
CinderPersistentObject,CinderObject,CinderObjectDictCompat,CinderComparableObject,ClusteredObject- OPTIONAL_FIELDS = ('cluster',)¶
- VERSION: str = '1.6'¶
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 active_backend_id: Any¶
- property availability_zone: Any¶
- property binary: Any¶
- property cluster: Any¶
- property cluster_name: Any¶
- create()¶
- property created_at: Any¶
- property deleted: Any¶
- property deleted_at: Any¶
- destroy()¶
- property disabled: Any¶
- property disabled_reason: Any¶
- fields: MutableMapping[str, Field[Any]] = {'active_backend_id': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'availability_zone': String(default=cinder,nullable=True), 'binary': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'cluster': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'cluster_name': String(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), 'disabled': Boolean(default=False,nullable=True), 'disabled_reason': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'frozen': Boolean(default=False,nullable=False), 'host': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'modified_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'object_current_version': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'replication_status': ReplicationStatus(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True,valid_values=('error', 'enabled', 'disabled', 'not-capable', 'failover-error', 'failing-over', 'failed-over', 'enabling', 'disabling')), 'report_count': Integer(default=0,nullable=False), 'rpc_current_version': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'topic': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'uuid': String(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(), }
- property frozen: Any¶
- classmethod get_by_args(context, host, binary_key)¶
- classmethod get_by_host_and_topic(context, host, topic, disabled=False)¶
- classmethod get_by_uuid(context, service_uuid)¶
- classmethod get_minimum_obj_version(context, binary=None)¶
- classmethod get_minimum_rpc_version(context, binary)¶
- property host: Any¶
- property id: Any¶
- property is_up¶
Check whether a service is up based on last heartbeat.
- property modified_at: Any¶
- 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 object_current_version: Any¶
- property replication_status: Any¶
- property report_count: Any¶
- property rpc_current_version: Any¶
- save(retry=True)¶
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 topic: Any¶
- property updated_at: Any¶
- property uuid: Any¶
- class ServiceList(*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, filters=None)¶
- classmethod get_all_by_binary(context, binary, disabled=None)¶
- classmethod get_all_by_topic(context, topic, disabled=None)¶
- property objects: Any¶