Add dynamic interfaces fields to base node notification

This patch adds dynamic interface fields which are exposed via API
to base node notification object.

Change-Id: If761fb73357d940afe42b329f413ff0228434586
Partial-Bug: #1524745
This commit is contained in:
Yuriy Zveryanskyy 2017-02-01 13:36:49 +02:00 committed by Jay Faulkner
parent 7194d0d135
commit d361d756ad
4 changed files with 117 additions and 24 deletions

View File

@ -106,7 +106,7 @@ Example of chassis CRUD notification::
"description": "bare 28", "description": "bare 28",
"extra": {}, "extra": {},
"updated_at": "2016-04-27T21:11:03+00:00", "updated_at": "2016-04-27T21:11:03+00:00",
"uuid": "1910f669-ce8b-43c2-b1d8-cf3d65be815e", "uuid": "1910f669-ce8b-43c2-b1d8-cf3d65be815e"
} }
}, },
"event_type":"baremetal.chassis.update.end", "event_type":"baremetal.chassis.update.end",
@ -132,7 +132,7 @@ Example of node CRUD notification::
"payload":{ "payload":{
"ironic_object.namespace":"ironic", "ironic_object.namespace":"ironic",
"ironic_object.name":"NodeCRUDPayload", "ironic_object.name":"NodeCRUDPayload",
"ironic_object.version":"1.0", "ironic_object.version":"1.1",
"ironic_object.data":{ "ironic_object.data":{
"chassis_uuid": "db0eef9d-45b2-4dc0-94a8-fc283c01171f", "chassis_uuid": "db0eef9d-45b2-4dc0-94a8-fc283c01171f",
"clean_step": None, "clean_step": None,
@ -149,7 +149,15 @@ Example of node CRUD notification::
"last_error": None, "last_error": None,
"maintenance": False, "maintenance": False,
"maintenance_reason": None, "maintenance_reason": None,
"boot_interface": None,
"console_interface": None,
"deploy_interface": None,
"inspect_interface": None,
"management_interface": None,
"network_interface": "flat", "network_interface": "flat",
"power_interface": None,
"raid_interface": None,
"vendor_interface": None,
"name": None, "name": None,
"power_state": "power off", "power_state": "power off",
"properties": { "properties": {
@ -163,7 +171,7 @@ Example of node CRUD notification::
"target_power_state": None, "target_power_state": None,
"target_provision_state": "active", "target_provision_state": "active",
"updated_at": "2016-01-27T20:41:03+00:00", "updated_at": "2016-01-27T20:41:03+00:00",
"uuid": "1be26c0b-03f2-4d2e-ae87-c02d7f33c123", "uuid": "1be26c0b-03f2-4d2e-ae87-c02d7f33c123"
} }
}, },
"event_type":"baremetal.node.update.end", "event_type":"baremetal.node.update.end",
@ -198,7 +206,7 @@ Example of port CRUD notification::
"local_link_connection": {}, "local_link_connection": {},
"pxe_enabled": True, "pxe_enabled": True,
"updated_at": "2016-03-27T20:41:03+00:00", "updated_at": "2016-03-27T20:41:03+00:00",
"uuid": "1be26c0b-03f2-4d2e-ae87-c02d7f33c123", "uuid": "1be26c0b-03f2-4d2e-ae87-c02d7f33c123"
} }
}, },
"event_type":"baremetal.port.update.end", "event_type":"baremetal.port.update.end",
@ -223,7 +231,7 @@ node maintenance notification::
"payload":{ "payload":{
"ironic_object.namespace":"ironic", "ironic_object.namespace":"ironic",
"ironic_object.name":"NodePayload", "ironic_object.name":"NodePayload",
"ironic_object.version":"1.0", "ironic_object.version":"1.3",
"ironic_object.data":{ "ironic_object.data":{
"clean_step": None, "clean_step": None,
"console_enabled": False, "console_enabled": False,
@ -237,7 +245,15 @@ node maintenance notification::
"last_error": None, "last_error": None,
"maintenance": True, "maintenance": True,
"maintenance_reason": "hw upgrade", "maintenance_reason": "hw upgrade",
"boot_interface": None,
"console_interface": None,
"deploy_interface": None,
"inspect_interface": None,
"management_interface": None,
"network_interface": "flat", "network_interface": "flat",
"power_interface": None,
"raid_interface": None,
"vendor_interface": None,
"name": None, "name": None,
"power_state": "power off", "power_state": "power off",
"properties": { "properties": {
@ -251,7 +267,7 @@ node maintenance notification::
"target_power_state": None, "target_power_state": None,
"target_provision_state": None, "target_provision_state": None,
"updated_at": "2016-01-27T20:41:03+00:00", "updated_at": "2016-01-27T20:41:03+00:00",
"uuid": "1be26c0b-03f2-4d2e-ae87-c02d7f33c123", "uuid": "1be26c0b-03f2-4d2e-ae87-c02d7f33c123"
} }
}, },
"event_type":"baremetal.node.maintenance_set.start", "event_type":"baremetal.node.maintenance_set.start",
@ -290,7 +306,7 @@ notification::
"payload":{ "payload":{
"ironic_object.namespace":"ironic", "ironic_object.namespace":"ironic",
"ironic_object.name":"NodePayload", "ironic_object.name":"NodePayload",
"ironic_object.version":"1.0", "ironic_object.version":"1.3",
"ironic_object.data":{ "ironic_object.data":{
"clean_step": None, "clean_step": None,
"console_enabled": True, "console_enabled": True,
@ -304,7 +320,15 @@ notification::
"last_error": None, "last_error": None,
"maintenance": False, "maintenance": False,
"maintenance_reason": None, "maintenance_reason": None,
"boot_interface": None,
"console_interface": None,
"deploy_interface": None,
"inspect_interface": None,
"management_interface": None,
"network_interface": "flat", "network_interface": "flat",
"power_interface": None,
"raid_interface": None,
"vendor_interface": None,
"name": None, "name": None,
"power_state": "power off", "power_state": "power off",
"properties": { "properties": {
@ -318,7 +342,7 @@ notification::
"target_power_state": None, "target_power_state": None,
"target_provision_state": None, "target_provision_state": None,
"updated_at": "2016-01-27T20:41:03+00:00", "updated_at": "2016-01-27T20:41:03+00:00",
"uuid": "1be26c0b-03f2-4d2e-ae87-c02d7f33c123", "uuid": "1be26c0b-03f2-4d2e-ae87-c02d7f33c123"
} }
}, },
"event_type":"baremetal.node.console_set.end", "event_type":"baremetal.node.console_set.end",
@ -350,7 +374,7 @@ ironic-conductor is attempting to change the node::
"payload":{ "payload":{
"ironic_object.namespace":"ironic", "ironic_object.namespace":"ironic",
"ironic_object.name":"NodeSetPowerStatePayload", "ironic_object.name":"NodeSetPowerStatePayload",
"ironic_object.version":"1.0", "ironic_object.version":"1.3",
"ironic_object.data":{ "ironic_object.data":{
"clean_step": None, "clean_step": None,
"console_enabled": False, "console_enabled": False,
@ -363,7 +387,15 @@ ironic-conductor is attempting to change the node::
"last_error": None, "last_error": None,
"maintenance": False, "maintenance": False,
"maintenance_reason": None, "maintenance_reason": None,
"boot_interface": None,
"console_interface": None,
"deploy_interface": None,
"inspect_interface": None,
"management_interface": None,
"network_interface": "flat", "network_interface": "flat",
"power_interface": None,
"raid_interface": None,
"vendor_interface": None,
"name": None, "name": None,
"power_state": "power off", "power_state": "power off",
"properties": { "properties": {
@ -404,7 +436,7 @@ prior to the correction::
"payload":{ "payload":{
"ironic_object.namespace":"ironic", "ironic_object.namespace":"ironic",
"ironic_object.name":"NodeCorrectedPowerStatePayload", "ironic_object.name":"NodeCorrectedPowerStatePayload",
"ironic_object.version":"1.0", "ironic_object.version":"1.3",
"ironic_object.data":{ "ironic_object.data":{
"clean_step": None, "clean_step": None,
"console_enabled": False, "console_enabled": False,
@ -417,7 +449,15 @@ prior to the correction::
"last_error": None, "last_error": None,
"maintenance": False, "maintenance": False,
"maintenance_reason": None, "maintenance_reason": None,
"boot_interface": None,
"console_interface": None,
"deploy_interface": None,
"inspect_interface": None,
"management_interface": None,
"network_interface": "flat", "network_interface": "flat",
"power_interface": None,
"raid_interface": None,
"vendor_interface": None,
"name": None, "name": None,
"power_state": "power off", "power_state": "power off",
"properties": { "properties": {
@ -469,7 +509,7 @@ indicate a node's provision states before state change, "event" is the FSM
"payload":{ "payload":{
"ironic_object.namespace":"ironic", "ironic_object.namespace":"ironic",
"ironic_object.name":"NodeSetProvisionStatePayload", "ironic_object.name":"NodeSetProvisionStatePayload",
"ironic_object.version":"1.0", "ironic_object.version":"1.3",
"ironic_object.data":{ "ironic_object.data":{
"clean_step": None, "clean_step": None,
"console_enabled": False, "console_enabled": False,
@ -483,7 +523,15 @@ indicate a node's provision states before state change, "event" is the FSM
"last_error": None, "last_error": None,
"maintenance": False, "maintenance": False,
"maintenance_reason": None, "maintenance_reason": None,
"boot_interface": None,
"console_interface": None,
"deploy_interface": None,
"inspect_interface": None,
"management_interface": None,
"network_interface": "flat", "network_interface": "flat",
"power_interface": None,
"raid_interface": None,
"vendor_interface": None,
"name": None, "name": None,
"power_state": "power off", "power_state": "power off",
"properties": { "properties": {

View File

@ -433,7 +433,15 @@ class NodePayload(notification.NotificationPayloadBase):
'maintenance': ('node', 'maintenance'), 'maintenance': ('node', 'maintenance'),
'maintenance_reason': ('node', 'maintenance_reason'), 'maintenance_reason': ('node', 'maintenance_reason'),
'name': ('node', 'name'), 'name': ('node', 'name'),
'boot_interface': ('node', 'boot_interface'),
'console_interface': ('node', 'console_interface'),
'deploy_interface': ('node', 'deploy_interface'),
'inspect_interface': ('node', 'inspect_interface'),
'management_interface': ('node', 'management_interface'),
'network_interface': ('node', 'network_interface'), 'network_interface': ('node', 'network_interface'),
'power_interface': ('node', 'power_interface'),
'raid_interface': ('node', 'raid_interface'),
'vendor_interface': ('node', 'vendor_interface'),
'power_state': ('node', 'power_state'), 'power_state': ('node', 'power_state'),
'properties': ('node', 'properties'), 'properties': ('node', 'properties'),
'provision_state': ('node', 'provision_state'), 'provision_state': ('node', 'provision_state'),
@ -453,7 +461,8 @@ class NodePayload(notification.NotificationPayloadBase):
# Version 1.1: Type of network_interface changed to just nullable string # Version 1.1: Type of network_interface changed to just nullable string
# similar to version 1.20 of Node. # similar to version 1.20 of Node.
# Version 1.2: Add nullable to console_enabled and maintenance. # Version 1.2: Add nullable to console_enabled and maintenance.
VERSION = '1.2' # Version 1.3: Add dynamic interfaces fields exposed via API.
VERSION = '1.3'
fields = { fields = {
'clean_step': object_fields.FlexibleDictField(nullable=True), 'clean_step': object_fields.FlexibleDictField(nullable=True),
'console_enabled': object_fields.BooleanField(nullable=True), 'console_enabled': object_fields.BooleanField(nullable=True),
@ -466,7 +475,15 @@ class NodePayload(notification.NotificationPayloadBase):
'last_error': object_fields.StringField(nullable=True), 'last_error': object_fields.StringField(nullable=True),
'maintenance': object_fields.BooleanField(nullable=True), 'maintenance': object_fields.BooleanField(nullable=True),
'maintenance_reason': object_fields.StringField(nullable=True), 'maintenance_reason': object_fields.StringField(nullable=True),
'boot_interface': object_fields.StringField(nullable=True),
'console_interface': object_fields.StringField(nullable=True),
'deploy_interface': object_fields.StringField(nullable=True),
'inspect_interface': object_fields.StringField(nullable=True),
'management_interface': object_fields.StringField(nullable=True),
'network_interface': object_fields.StringField(nullable=True), 'network_interface': object_fields.StringField(nullable=True),
'power_interface': object_fields.StringField(nullable=True),
'raid_interface': object_fields.StringField(nullable=True),
'vendor_interface': object_fields.StringField(nullable=True),
'name': object_fields.StringField(nullable=True), 'name': object_fields.StringField(nullable=True),
'power_state': object_fields.StringField(nullable=True), 'power_state': object_fields.StringField(nullable=True),
'properties': object_fields.FlexibleDictField(nullable=True), 'properties': object_fields.FlexibleDictField(nullable=True),
@ -501,7 +518,8 @@ class NodeSetPowerStatePayload(NodePayload):
# Version 1.0: Initial version # Version 1.0: Initial version
# Version 1.1: Parent NodePayload version 1.1 # Version 1.1: Parent NodePayload version 1.1
# Version 1.2: Parent NodePayload version 1.2 # Version 1.2: Parent NodePayload version 1.2
VERSION = '1.2' # Version 1.3: Parent NodePayload version 1.3
VERSION = '1.3'
fields = { fields = {
# "to_power" indicates the future target_power_state of the node. A # "to_power" indicates the future target_power_state of the node. A
@ -544,7 +562,8 @@ class NodeCorrectedPowerStatePayload(NodePayload):
# Version 1.0: Initial version # Version 1.0: Initial version
# Version 1.1: Parent NodePayload version 1.1 # Version 1.1: Parent NodePayload version 1.1
# Version 1.2: Parent NodePayload version 1.2 # Version 1.2: Parent NodePayload version 1.2
VERSION = '1.2' # Version 1.3: Parent NodePayload version 1.3
VERSION = '1.3'
fields = { fields = {
'from_power': object_fields.StringField(nullable=True) 'from_power': object_fields.StringField(nullable=True)
@ -572,7 +591,8 @@ class NodeSetProvisionStatePayload(NodePayload):
# Version 1.0: Initial version # Version 1.0: Initial version
# Version 1.1: Parent NodePayload version 1.1 # Version 1.1: Parent NodePayload version 1.1
# Version 1.2: Parent NodePayload version 1.2 # Version 1.2: Parent NodePayload version 1.2
VERSION = '1.2' # Version 1.3: Parent NodePayload version 1.3
VERSION = '1.3'
SCHEMA = dict(NodePayload.SCHEMA, SCHEMA = dict(NodePayload.SCHEMA,
**{'instance_info': ('node', 'instance_info')}) **{'instance_info': ('node', 'instance_info')})
@ -606,7 +626,8 @@ class NodeCRUDNotification(notification.NotificationBase):
class NodeCRUDPayload(NodePayload): class NodeCRUDPayload(NodePayload):
"""Payload schema for when ironic creates, updates or deletes a node.""" """Payload schema for when ironic creates, updates or deletes a node."""
# Version 1.0: Initial version # Version 1.0: Initial version
VERSION = '1.0' # Version 1.1: Parent NodePayload version 1.3
VERSION = '1.1'
SCHEMA = dict(NodePayload.SCHEMA, SCHEMA = dict(NodePayload.SCHEMA,
**{'instance_info': ('node', 'instance_info'), **{'instance_info': ('node', 'instance_info'),

View File

@ -412,23 +412,22 @@ expected_object_fingerprints = {
'Conductor': '1.2-5091f249719d4a465062a1b3dc7f860d', 'Conductor': '1.2-5091f249719d4a465062a1b3dc7f860d',
'EventType': '1.1-aa2ba1afd38553e3880c267404e8d370', 'EventType': '1.1-aa2ba1afd38553e3880c267404e8d370',
'NotificationPublisher': '1.0-51a09397d6c0687771fb5be9a999605d', 'NotificationPublisher': '1.0-51a09397d6c0687771fb5be9a999605d',
'NodePayload': '1.2-f4e7a1def3b2a5784863eeed46e3a25f', 'NodePayload': '1.3-e54d6506953ad0aa0b965615b0aa38a0',
'NodeSetPowerStateNotification': '1.0-59acc533c11d306f149846f922739c15', 'NodeSetPowerStateNotification': '1.0-59acc533c11d306f149846f922739c15',
'NodeSetPowerStatePayload': '1.2-06b6daec792fdef69c672ab5899c6a07', 'NodeSetPowerStatePayload': '1.3-c9657ea90d565993219bdc34e7a64231',
'NodeCorrectedPowerStateNotification': '1.0-59acc533c11d306f149846f922739' 'NodeCorrectedPowerStateNotification':
'c15', '1.0-59acc533c11d306f149846f922739c15',
'NodeCorrectedPowerStatePayload': '1.2-ef6515d2f20944f4ed3d3e06a6476396', 'NodeCorrectedPowerStatePayload': '1.3-db79d69db4212e3eaf51a8b50c1d171e',
'NodeSetProvisionStateNotification': 'NodeSetProvisionStateNotification':
'1.0-59acc533c11d306f149846f922739c15', '1.0-59acc533c11d306f149846f922739c15',
'NodeSetProvisionStatePayload': '1.2-2695d18d1eccbb0f5d3bbcb0575630dc', 'NodeSetProvisionStatePayload': '1.3-96e85e927b10d96c79c27f5fb6727f86',
'VolumeConnector': '1.0-3e0252c0ab6e6b9d158d09238a577d97', 'VolumeConnector': '1.0-3e0252c0ab6e6b9d158d09238a577d97',
'VolumeTarget': '1.0-0b10d663d8dae675900b2c7548f76f5e', 'VolumeTarget': '1.0-0b10d663d8dae675900b2c7548f76f5e',
'ChassisCRUDNotification': '1.0-59acc533c11d306f149846f922739c15', 'ChassisCRUDNotification': '1.0-59acc533c11d306f149846f922739c15',
'ChassisCRUDPayload': '1.0-dce63895d8186279a7dd577cffccb202', 'ChassisCRUDPayload': '1.0-dce63895d8186279a7dd577cffccb202',
'NodeCRUDNotification': '1.0-59acc533c11d306f149846f922739c15', 'NodeCRUDNotification': '1.0-59acc533c11d306f149846f922739c15',
'NodeCRUDPayload': '1.0-37bb4cdd2c84b59fd6ad0547dbf713a0', 'NodeCRUDPayload': '1.1-35c16dd49d75812763e4e99bfebc3191',
'PortCRUDNotification': '1.0-59acc533c11d306f149846f922739c15', 'PortCRUDNotification': '1.0-59acc533c11d306f149846f922739c15',
'PortCRUDPayload': '1.0-88acd98c9b08b4c8810e77793152057b', 'PortCRUDPayload': '1.0-88acd98c9b08b4c8810e77793152057b',
'NodeMaintenanceNotification': '1.0-59acc533c11d306f149846f922739c15', 'NodeMaintenanceNotification': '1.0-59acc533c11d306f149846f922739c15',
'NodeConsoleNotification': '1.0-59acc533c11d306f149846f922739c15' 'NodeConsoleNotification': '1.0-59acc533c11d306f149846f922739c15'

View File

@ -0,0 +1,25 @@
---
features:
- |
Adds dynamic interface fields to node-related notifications:
* boot_interface
* console_interface
* deploy_interface
* inspect_interface
* management_interface
* power_interface
* raid_interface
* vendor_interface
Affected notifications are:
* baremetal.node.create.*, new payload version 1.1
* baremetal.node.update.*, new payload version 1.1
* baremetal.node.delete.*, new payload version 1.1
* baremetal.node.maintenance.*, new payload version 1.3
* baremetal.node.console.*, new payload version 1.3
* baremetal.node.power_set.*, new payload version 1.3
* baremetal.node.power_state_corrected.*, new payload version 1.3
* baremetal.node.provision_set.*, new payload version 1.3