diff --git a/doc/source/admin/notifications.rst b/doc/source/admin/notifications.rst index f1c2fea461..f836185029 100644 --- a/doc/source/admin/notifications.rst +++ b/doc/source/admin/notifications.rst @@ -132,7 +132,7 @@ Example of node CRUD notification:: "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodeCRUDPayload", - "ironic_object.version":"1.1", + "ironic_object.version":"1.2", "ironic_object.data":{ "chassis_uuid": "db0eef9d-45b2-4dc0-94a8-fc283c01171f", "clean_step": None, @@ -157,6 +157,7 @@ Example of node CRUD notification:: "network_interface": "flat", "power_interface": None, "raid_interface": None, + "storage_interface": None, "vendor_interface": None, "name": None, "power_state": "power off", @@ -351,7 +352,7 @@ node maintenance notification:: "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodePayload", - "ironic_object.version":"1.3", + "ironic_object.version":"1.4", "ironic_object.data":{ "clean_step": None, "console_enabled": False, @@ -373,6 +374,7 @@ node maintenance notification:: "network_interface": "flat", "power_interface": None, "raid_interface": None, + "storage_interface": None, "vendor_interface": None, "name": None, "power_state": "power off", @@ -426,7 +428,7 @@ notification:: "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodePayload", - "ironic_object.version":"1.3", + "ironic_object.version":"1.4", "ironic_object.data":{ "clean_step": None, "console_enabled": True, @@ -448,6 +450,7 @@ notification:: "network_interface": "flat", "power_interface": None, "raid_interface": None, + "storage_interface": None, "vendor_interface": None, "name": None, "power_state": "power off", @@ -494,7 +497,7 @@ ironic-conductor is attempting to change the node:: "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodeSetPowerStatePayload", - "ironic_object.version":"1.3", + "ironic_object.version":"1.4", "ironic_object.data":{ "clean_step": None, "console_enabled": False, @@ -515,6 +518,7 @@ ironic-conductor is attempting to change the node:: "network_interface": "flat", "power_interface": None, "raid_interface": None, + "storage_interface": None, "vendor_interface": None, "name": None, "power_state": "power off", @@ -556,7 +560,7 @@ prior to the correction:: "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodeCorrectedPowerStatePayload", - "ironic_object.version":"1.3", + "ironic_object.version":"1.4", "ironic_object.data":{ "clean_step": None, "console_enabled": False, @@ -577,6 +581,7 @@ prior to the correction:: "network_interface": "flat", "power_interface": None, "raid_interface": None, + "storage_interface": None, "vendor_interface": None, "name": None, "power_state": "power off", @@ -629,7 +634,7 @@ indicate a node's provision states before state change, "event" is the FSM "payload":{ "ironic_object.namespace":"ironic", "ironic_object.name":"NodeSetProvisionStatePayload", - "ironic_object.version":"1.3", + "ironic_object.version":"1.4", "ironic_object.data":{ "clean_step": None, "console_enabled": False, @@ -651,6 +656,7 @@ indicate a node's provision states before state change, "event" is the FSM "network_interface": "flat", "power_interface": None, "raid_interface": None, + "storage_interface": None, "vendor_interface": None, "name": None, "power_state": "power off", diff --git a/ironic/objects/node.py b/ironic/objects/node.py index 08ee649834..c651d4fb62 100644 --- a/ironic/objects/node.py +++ b/ironic/objects/node.py @@ -447,6 +447,7 @@ class NodePayload(notification.NotificationPayloadBase): 'network_interface': ('node', 'network_interface'), 'power_interface': ('node', 'power_interface'), 'raid_interface': ('node', 'raid_interface'), + 'storage_interface': ('node', 'storage_interface'), 'vendor_interface': ('node', 'vendor_interface'), 'power_state': ('node', 'power_state'), 'properties': ('node', 'properties'), @@ -458,17 +459,14 @@ class NodePayload(notification.NotificationPayloadBase): 'updated_at': ('node', 'updated_at'), 'uuid': ('node', 'uuid') } - # TODO(TheJulia): At a later point in time, once storage_interfaces - # are able to be leveraged, we need to add the sotrage_interface - # field to payload and increment the object versions for all objects - # that inherit the NodePayload object. # Version 1.0: Initial version, based off of Node version 1.18. # Version 1.1: Type of network_interface changed to just nullable string # similar to version 1.20 of Node. # Version 1.2: Add nullable to console_enabled and maintenance. # Version 1.3: Add dynamic interfaces fields exposed via API. - VERSION = '1.3' + # Version 1.4: Add storage interface field exposed via API. + VERSION = '1.4' fields = { 'clean_step': object_fields.FlexibleDictField(nullable=True), 'console_enabled': object_fields.BooleanField(nullable=True), @@ -489,6 +487,7 @@ class NodePayload(notification.NotificationPayloadBase): 'network_interface': object_fields.StringField(nullable=True), 'power_interface': object_fields.StringField(nullable=True), 'raid_interface': object_fields.StringField(nullable=True), + 'storage_interface': object_fields.StringField(nullable=True), 'vendor_interface': object_fields.StringField(nullable=True), 'name': object_fields.StringField(nullable=True), 'power_state': object_fields.StringField(nullable=True), @@ -525,7 +524,8 @@ class NodeSetPowerStatePayload(NodePayload): # Version 1.1: Parent NodePayload version 1.1 # Version 1.2: Parent NodePayload version 1.2 # Version 1.3: Parent NodePayload version 1.3 - VERSION = '1.3' + # Version 1.4: Parent NodePayload version 1.4 + VERSION = '1.4' fields = { # "to_power" indicates the future target_power_state of the node. A @@ -569,7 +569,8 @@ class NodeCorrectedPowerStatePayload(NodePayload): # Version 1.1: Parent NodePayload version 1.1 # Version 1.2: Parent NodePayload version 1.2 # Version 1.3: Parent NodePayload version 1.3 - VERSION = '1.3' + # Version 1.4: Parent NodePayload version 1.4 + VERSION = '1.4' fields = { 'from_power': object_fields.StringField(nullable=True) @@ -598,7 +599,8 @@ class NodeSetProvisionStatePayload(NodePayload): # Version 1.1: Parent NodePayload version 1.1 # Version 1.2: Parent NodePayload version 1.2 # Version 1.3: Parent NodePayload version 1.3 - VERSION = '1.3' + # Version 1.4: Parent NodePayload version 1.4 + VERSION = '1.4' SCHEMA = dict(NodePayload.SCHEMA, **{'instance_info': ('node', 'instance_info')}) @@ -633,7 +635,8 @@ class NodeCRUDPayload(NodePayload): """Payload schema for when ironic creates, updates or deletes a node.""" # Version 1.0: Initial version # Version 1.1: Parent NodePayload version 1.3 - VERSION = '1.1' + # Version 1.2: Parent NodePayload version 1.4 + VERSION = '1.2' SCHEMA = dict(NodePayload.SCHEMA, **{'instance_info': ('node', 'instance_info'), diff --git a/ironic/tests/unit/objects/test_objects.py b/ironic/tests/unit/objects/test_objects.py index 8280765964..678c11ef0a 100644 --- a/ironic/tests/unit/objects/test_objects.py +++ b/ironic/tests/unit/objects/test_objects.py @@ -669,21 +669,21 @@ expected_object_fingerprints = { 'Conductor': '1.2-5091f249719d4a465062a1b3dc7f860d', 'EventType': '1.1-aa2ba1afd38553e3880c267404e8d370', 'NotificationPublisher': '1.0-51a09397d6c0687771fb5be9a999605d', - 'NodePayload': '1.3-e54d6506953ad0aa0b965615b0aa38a0', + 'NodePayload': '1.4-1ab0efe090ee3b2bd48d280a5acec1d4', 'NodeSetPowerStateNotification': '1.0-59acc533c11d306f149846f922739c15', - 'NodeSetPowerStatePayload': '1.3-c9657ea90d565993219bdc34e7a64231', + 'NodeSetPowerStatePayload': '1.4-9ab5116c2c59dfb9e56dcc7ef660a431', 'NodeCorrectedPowerStateNotification': '1.0-59acc533c11d306f149846f922739c15', - 'NodeCorrectedPowerStatePayload': '1.3-db79d69db4212e3eaf51a8b50c1d171e', + 'NodeCorrectedPowerStatePayload': '1.4-d624154b8fb4e6cdda1554a8bf3f4cf5', 'NodeSetProvisionStateNotification': '1.0-59acc533c11d306f149846f922739c15', - 'NodeSetProvisionStatePayload': '1.3-96e85e927b10d96c79c27f5fb6727f86', + 'NodeSetProvisionStatePayload': '1.4-605c17b779aeedf0925937b2785d9f43', 'VolumeConnector': '1.0-3e0252c0ab6e6b9d158d09238a577d97', 'VolumeTarget': '1.0-0b10d663d8dae675900b2c7548f76f5e', 'ChassisCRUDNotification': '1.0-59acc533c11d306f149846f922739c15', 'ChassisCRUDPayload': '1.0-dce63895d8186279a7dd577cffccb202', 'NodeCRUDNotification': '1.0-59acc533c11d306f149846f922739c15', - 'NodeCRUDPayload': '1.1-35c16dd49d75812763e4e99bfebc3191', + 'NodeCRUDPayload': '1.2-b7a265a5e2fe47adada3c7c20c68e465', 'PortCRUDNotification': '1.0-59acc533c11d306f149846f922739c15', 'PortCRUDPayload': '1.1-1ecf2d63b68014c52cb52d0227f8b5b8', 'NodeMaintenanceNotification': '1.0-59acc533c11d306f149846f922739c15', diff --git a/releasenotes/notes/notify-node-storage-interface-7fd07ee7ee71cd22.yaml b/releasenotes/notes/notify-node-storage-interface-7fd07ee7ee71cd22.yaml new file mode 100644 index 0000000000..c7d556702b --- /dev/null +++ b/releasenotes/notes/notify-node-storage-interface-7fd07ee7ee71cd22.yaml @@ -0,0 +1,15 @@ +--- +features: + - | + Adds storage interface field to node-related notifications: + + Affected notifications are: + + * baremetal.node.create.*, new payload version 1.2 + * baremetal.node.update.*, new payload version 1.2 + * baremetal.node.delete.*, new payload version 1.2 + * baremetal.node.maintenance.*, new payload version 1.4 + * baremetal.node.console.*, new payload version 1.4 + * baremetal.node.power_set.*, new payload version 1.4 + * baremetal.node.power_state_corrected.*, new payload version 1.4 + * baremetal.node.provision_set.*, new payload version 1.4