ironic.objects.notification module¶
- class ironic.objects.notification.EventType(context=None, **kwargs)[source]¶
Bases:
IronicObjectDefines the event_type to be sent on the wire.
An EventType must specify the object being acted on, a string describing the action being taken on the notification, and the status of the action.
- VERSION = '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 action¶
- property created_at¶
- fields = {'action': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'object': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'status': NotificationStatus(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False,valid_values=('start', 'end', 'error', 'success')), '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 object¶
- property status¶
- to_event_type_field()[source]¶
Constructs string for event_type to be sent on the wire.
The string is in the format: baremetal.<object>.<action>.<status>
- Raises:
ValueError if self.status is not one of
fields.NotificationStatusField- Returns:
event_type string
- property updated_at¶
- class ironic.objects.notification.NotificationBase(context=None, **kwargs)[source]¶
Bases:
IronicObjectBase class for versioned notifications.
Subclasses must define the “payload” field, which must be a subclass of NotificationPayloadBase.
- VERSION = '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.
- property created_at¶
- emit(context)[source]¶
Send the notification.
- Raises:
NotificationPayloadError
- Raises:
oslo_versionedobjects.exceptions.MessageDeliveryFailure
- property event_type¶
- fields = {'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'event_type': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'level': NotificationLevel(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False,valid_values=('debug', 'info', 'warning', 'error', 'critical')), 'publisher': Object(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), '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 level¶
- property publisher¶
- property updated_at¶
- class ironic.objects.notification.NotificationPayloadBase(*args, **kwargs)[source]¶
Bases:
IronicObjectBase class for the payload of versioned notifications.
- SCHEMA = {}¶
- VERSION = '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.
- property created_at¶
- fields = {'created_at': DateTime(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(), }
- populate_schema(**kwargs)[source]¶
Populate the object based on the SCHEMA and the source objects
- Parameters:
kwargs – A dict contains the source object and the keys defined in the SCHEMA
- Raises:
NotificationSchemaObjectError
- Raises:
NotificationSchemaKeyError
- redact_sensitive_fields()[source]¶
Withhold fields the REST API does not hand out unconditionally.
Called by mask_secrets() on every payload just before it goes on the notification bus. Subscribers are authenticated by the message broker rather than by oslo.policy, so a payload holding data that the API gates behind a policy check or a sensitivity flag cannot assume that check has happened and has to withhold the field here.
Masking key by key does not cover these fields: the API withholds them whole, and their secrets do not always sit under a key that oslo’s mask_dict_password() recognises. Overrides replace the whole field with redacted_contents().
- property updated_at¶
- class ironic.objects.notification.NotificationPublisher(context=None, **kwargs)[source]¶
Bases:
IronicObject- VERSION = '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.
- property created_at¶
- fields = {'created_at': DateTime(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=True), 'host': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), 'service': String(default=<class 'oslo_versionedobjects.fields.UnspecifiedDefault'>,nullable=False), '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 host¶
- property service¶
- property updated_at¶