cinder.objects.cluster module¶
- class Cluster(context: Any = None, **kwargs: Any)¶
Bases:
CinderPersistentObject,CinderObject,CinderComparableObjectCluster Versioned Object.
- Method get_by_id supports as additional named arguments:
get_services: If we want to load all services from this cluster.
- services_summary: If we want to load num_nodes and num_down_nodes
fields.
is_up: Boolean value to filter based on the cluster’s up status.
read_deleted: Filtering based on delete status. Default value “no”.
Any other cluster field will be used as a filter.
- OPTIONAL_FIELDS = ('num_hosts', 'num_down_hosts', 'services')¶
- 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.
- property active_backend_id: Any¶
- property binary: 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), 'binary': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), '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), 'id': Integer(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'last_heartbeat': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'name': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'num_down_hosts': Integer(default=0,nullable=False), 'num_hosts': Integer(default=0,nullable=False), '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')), 'services': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'updated_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True)}¶
The fields present in this object as
key:fieldpairs.For example:
fields = { 'foo': obj_fields.IntegerField(), 'bar': obj_fields.StringField(), }
- property frozen: Any¶
- property id: Any¶
- property is_up¶
- property last_heartbeat: Any¶
- property name: Any¶
- property num_down_hosts: Any¶
- property num_hosts: Any¶
- obj_load_attr(attrname)¶
Lazy load services attribute.
- property replication_status: Any¶
- reset_service_replication()¶
Reset service replication flags on promotion.
When an admin promotes a cluster, each service member requires an update to maintain database consistency.
- 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 services: Any¶
- property updated_at: Any¶
- class ClusterList(*args: Any, **kwargs: Any)¶
Bases:
ObjectListBase,CinderObject- VERSION: str = '1.0'¶
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, is_up=None, get_services=False, services_summary=False, read_deleted='no', **filters)¶
Get all clusters that match the criteria.
- Parameters:
is_up – Boolean value to filter based on the cluster’s up status.
get_services – If we want to load all services from this cluster.
services_summary – If we want to load num_nodes and num_down_nodes fields.
read_deleted – Filtering based on delete status. Default value is “no”.
filters – Field based filters in the form of key/value.
- property objects: Any¶