Add FlavorPayload.description for versioned notifications

This adds the description field to the FlavorPayload
for versioned notifications on flavor create/update/delete
notifications.

Part of blueprint flavor-description

Change-Id: I9a5dc8b603b5e4e0d37c59cf2749e3ffc217580c
This commit is contained in:
Matt Riedemann 2017-10-24 14:28:00 -04:00
parent 50c23d8c86
commit 48259c2bd7
49 changed files with 146 additions and 96 deletions

View File

@ -15,8 +15,9 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description": null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
}

View File

@ -2,7 +2,7 @@
"priority": "INFO",
"payload": {
"nova_object.namespace": "nova",
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.name": "FlavorPayload",
"nova_object.data": {
"name": "test_flavor",
@ -17,7 +17,8 @@
"vcpu_weight": 0,
"flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3",
"extra_specs": null,
"projects": []
"projects": [],
"description":null
}
},
"event_type": "flavor.create",

View File

@ -2,7 +2,7 @@
"priority": "INFO",
"payload": {
"nova_object.namespace": "nova",
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.name": "FlavorPayload",
"nova_object.data": {
"name": "test_flavor",
@ -17,7 +17,8 @@
"vcpu_weight": 0,
"flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3",
"extra_specs": null,
"projects": null
"projects": null,
"description":null
}
},
"event_type": "flavor.delete",

View File

@ -2,7 +2,7 @@
"priority": "INFO",
"payload": {
"nova_object.namespace": "nova",
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.name": "FlavorPayload",
"nova_object.data": {
"name": "test_flavor",
@ -20,7 +20,8 @@
"is_public": false,
"root_gb": 10,
"vcpu_weight": 0,
"flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3"
"flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3",
"description":null
}
},
"event_type": "flavor.update",

View File

@ -73,9 +73,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"updated_at": "2012-10-29T13:42:11Z",

View File

@ -70,9 +70,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"updated_at": "2012-10-29T13:42:11Z",

View File

@ -60,9 +60,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"updated_at": null,

View File

@ -40,11 +40,12 @@
"rxtx_factor":1.0,
"swap":0,
"vcpu_weight":0,
"vcpus":1
"vcpus":1,
"description":null
},
"nova_object.name":"FlavorPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.3"
"nova_object.version":"1.4"
},
"host":"compute",
"host_name":"some-server",

View File

@ -40,11 +40,12 @@
"rxtx_factor":1.0,
"swap":0,
"vcpu_weight":0,
"vcpus":1
"vcpus":1,
"description":null
},
"nova_object.name":"FlavorPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.3"
"nova_object.version":"1.4"
},
"host":"compute",
"host_name":"some-server",

View File

@ -21,7 +21,7 @@
"reservation_id": "r-wczvhcla",
"flavor": {
"nova_object.namespace": "nova",
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.data": {
"disabled": false,
"ephemeral_gb": 0,
@ -35,7 +35,8 @@
"rxtx_factor": 1.0,
"swap": 0,
"vcpu_weight": 0,
"vcpus": 1
"vcpus": 1,
"description":null
},
"nova_object.name": "FlavorPayload"
},

View File

@ -66,9 +66,10 @@
"rxtx_factor": 1.0,
"swap": 0,
"vcpu_weight": 0,
"vcpus": 1
"vcpus": 1,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"reservation_id": "r-pfiic52h",

View File

@ -29,7 +29,7 @@
"flavor": {
"nova_object.name": "FlavorPayload",
"nova_object.namespace": "nova",
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.data": {
"disabled": false,
"ephemeral_gb": 0,
@ -43,7 +43,8 @@
"rxtx_factor": 1.0,
"swap": 0,
"vcpu_weight": 0,
"vcpus": 1
"vcpus": 1,
"description":null
}
},
"terminated_at": null,

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -37,11 +37,12 @@
"rxtx_factor":1.0,
"swap":0,
"vcpu_weight":0,
"vcpus":1
"vcpus":1,
"description":null
},
"nova_object.name":"FlavorPayload",
"nova_object.namespace":"nova",
"nova_object.version":"1.3"
"nova_object.version":"1.4"
},
"host":"compute",
"host_name":"some-server",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -58,9 +58,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"updated_at": "2012-10-29T13:42:11Z",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"updated_at": "2012-10-29T13:42:11Z",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -74,9 +74,10 @@
},
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id": "fake",

View File

@ -74,9 +74,10 @@
},
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id": "fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -71,9 +71,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"user_id":"fake",

View File

@ -34,10 +34,11 @@
"rxtx_factor": 1.0,
"swap": 0,
"vcpu_weight": 0,
"vcpus": 1},
"vcpus": 1,
"description":null},
"nova_object.name": "FlavorPayload",
"nova_object.namespace": "nova",
"nova_object.version": "1.3"},
"nova_object.version": "1.4"},
"host": "compute",
"host_name": "some-server",
"image_uuid": "155d900f-4e14-4e4c-a73d-069cbf4541e6",

View File

@ -65,9 +65,10 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"tags": [],

View File

@ -38,9 +38,10 @@
},
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"host": "compute",

View File

@ -48,9 +48,10 @@
},
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"host": "compute",

View File

@ -38,9 +38,10 @@
},
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"host": "compute",

View File

@ -38,9 +38,10 @@
},
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"host": "compute",

View File

@ -38,9 +38,10 @@
},
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.version": "1.3",
"nova_object.version": "1.4",
"nova_object.namespace": "nova"
},
"host": "compute",

View File

@ -37,11 +37,12 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.name": "FlavorPayload",
"nova_object.namespace": "nova",
"nova_object.version": "1.3"
"nova_object.version": "1.4"
},
"host": "compute",
"host_name": "some-server",

View File

@ -47,11 +47,12 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.name": "FlavorPayload",
"nova_object.namespace": "nova",
"nova_object.version": "1.3"
"nova_object.version": "1.4"
},
"host": "compute",
"host_name": "some-server",

View File

@ -37,11 +37,12 @@
"projects": null,
"swap": 0,
"is_public": true,
"vcpu_weight": 0
"vcpu_weight": 0,
"description":null
},
"nova_object.name": "FlavorPayload",
"nova_object.namespace": "nova",
"nova_object.version": "1.3"
"nova_object.version": "1.4"
},
"host": "compute",
"host_name": "some-server",

View File

@ -35,7 +35,8 @@ class FlavorPayload(base.NotificationPayloadBase):
# Version 1.2: Add extra_specs and projects fields
# Version 1.3: Make projects and extra_specs field nullable as they are
# not always available when a notification is emitted.
VERSION = '1.3'
# Version 1.4: Added description field.
VERSION = '1.4'
# NOTE: if we'd want to rename some fields(memory_mb->ram, root_gb->disk,
# ephemeral_gb: ephemeral), bumping to payload version 2.0 will be needed.
@ -53,6 +54,7 @@ class FlavorPayload(base.NotificationPayloadBase):
'is_public': ('flavor', 'is_public'),
'extra_specs': ('flavor', 'extra_specs'),
'projects': ('flavor', 'projects'),
'description': ('flavor', 'description')
}
fields = {
@ -69,6 +71,7 @@ class FlavorPayload(base.NotificationPayloadBase):
'is_public': fields.BooleanField(),
'extra_specs': fields.DictOfStringsField(nullable=True),
'projects': fields.ListOfStringsField(nullable=True),
'description': fields.StringField(nullable=True)
}
def __init__(self, flavor):

View File

@ -377,7 +377,7 @@ notification_object_data = {
'ExceptionNotification': '1.0-a73147b93b520ff0061865849d3dfa56',
'ExceptionPayload': '1.0-27db46ee34cd97e39f2643ed92ad0cc5',
'FlavorNotification': '1.0-a73147b93b520ff0061865849d3dfa56',
'FlavorPayload': '1.3-6335e626893d7df5f96f87e6731fef56',
'FlavorPayload': '1.4-2e7011b8b4e59167fe8b7a0a81f0d452',
'InstanceActionNotification': '1.0-a73147b93b520ff0061865849d3dfa56',
'InstanceActionPayload': '1.5-fb2804ce9b681bfb217e729153c22611',
'InstanceActionVolumeNotification': '1.0-a73147b93b520ff0061865849d3dfa56',