ironic.objects.notification module
updated: 2023-10-15 11:09
ironic.objects.notification module
-
class ironic.objects.notification.EventType(context=None, **kwargs)[source]
Bases: IronicObject
Defines 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'
-
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)}
-
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: IronicObject
Base class for versioned notifications.
Subclasses must define the “payload” field, which must be a subclass of
NotificationPayloadBase.
-
VERSION = '1.0'
-
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)}
-
property level
-
property publisher
-
property updated_at
-
class ironic.objects.notification.NotificationPayloadBase(*args, **kwargs)[source]
Bases: IronicObject
Base class for the payload of versioned notifications.
-
SCHEMA = {}
-
VERSION = '1.0'
-
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)}
-
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
-
property updated_at
-
class ironic.objects.notification.NotificationPublisher(context=None, **kwargs)[source]
Bases: IronicObject
-
VERSION = '1.0'
-
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)}
-
property host
-
property service
-
property updated_at
-
ironic.objects.notification.mask_secrets(payload)[source]
Remove secrets from payload object.
updated: 2023-10-15 11:09