From fd025e591b59be2af5e2dcf533931059bf897b26 Mon Sep 17 00:00:00 2001 From: Kevin_Zheng Date: Thu, 12 Apr 2018 11:33:05 +0800 Subject: [PATCH] Deduplicate notification samples Rocky - 5 This patch refactors the sample files of: * instance-live_migration_abort_start * instance-live_migration_abort_end * instance-shutdown-start * instance-shutdown-end notifications to use a common InstanceActionPayload sample data. refactors the sample files: * instance-snapshot-start * instance-snapshot-end notifications to use a common InstanceActionSnapshotPayload sample data. Change-Id: I762b619c4410e3ff4a3660fc318832f81f523c05 --- .../InstanceActionSnapshotPayload.json | 9 ++ .../instance-live_migration_abort-end.json | 93 +------------------ .../instance-live_migration_abort-start.json | 93 +------------------ .../instance-shutdown-end.json | 71 +------------- .../instance-shutdown-start.json | 85 +---------------- .../instance-snapshot-end.json | 85 +---------------- .../instance-snapshot-start.json | 86 +---------------- 7 files changed, 25 insertions(+), 497 deletions(-) create mode 100644 doc/notification_samples/common_payloads/InstanceActionSnapshotPayload.json diff --git a/doc/notification_samples/common_payloads/InstanceActionSnapshotPayload.json b/doc/notification_samples/common_payloads/InstanceActionSnapshotPayload.json new file mode 100644 index 000000000000..fa3655c48d8f --- /dev/null +++ b/doc/notification_samples/common_payloads/InstanceActionSnapshotPayload.json @@ -0,0 +1,9 @@ +{ + "$ref": "InstanceActionPayload.json", + "nova_object.data":{ + "snapshot_image_id": "d2aae36f-785c-4518-8016-bc9534d9fc7f" + }, + "nova_object.name":"InstanceActionSnapshotPayload", + "nova_object.namespace":"nova", + "nova_object.version":"1.6" +} diff --git a/doc/notification_samples/instance-live_migration_abort-end.json b/doc/notification_samples/instance-live_migration_abort-end.json index ce3a1666072b..d7409407a4f8 100644 --- a/doc/notification_samples/instance-live_migration_abort-end.json +++ b/doc/notification_samples/instance-live_migration_abort-end.json @@ -1,97 +1,10 @@ { "event_type":"instance.live_migration_abort.end", "payload":{ + "$ref": "common_payloads/InstanceActionPayload.json#", "nova_object.data":{ - "architecture":"x86_64", - "auto_disk_config":"MANUAL", - "availability_zone":"nova", - "block_devices":[ - { - "nova_object.data":{ - "boot_index":null, - "delete_on_termination":false, - "device_name":"/dev/sdb", - "tag":null, - "volume_id":"a07f71dc-8151-4e7d-a0cc-cd24a3f11113" - }, - "nova_object.name":"BlockDevicePayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.0" - } - ], - "created_at":"2012-10-29T13:42:11Z", - "deleted_at":null, - "display_description":"some-server", - "display_name":"some-server", - "fault":null, - "flavor":{ - "nova_object.data":{ - "disabled":false, - "ephemeral_gb":0, - "extra_specs":{ - "hw:watchdog_action":"disabled" - }, - "flavorid":"a22d5517-147c-4147-a0d1-e698df5cd4e3", - "is_public":true, - "memory_mb":512, - "name":"test_flavor", - "projects":null, - "root_gb":1, - "rxtx_factor":1.0, - "swap":0, - "vcpu_weight":0, - "vcpus":1, - "description":null - }, - "nova_object.name":"FlavorPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.4" - }, - "host":"compute", - "host_name":"some-server", - "image_uuid":"155d900f-4e14-4e4c-a73d-069cbf4541e6", - "ip_addresses":[ - { - "nova_object.data":{ - "address":"192.168.1.3", - "device_name":"tapce531f90-19", - "label":"private-network", - "mac":"fa:16:3e:4c:2c:30", - "meta":{ - - }, - "port_uuid":"ce531f90-199f-48c0-816c-13e38010b442", - "version":4 - }, - "nova_object.name":"IpPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.0" - } - ], - "kernel_id":"", - "key_name":"my-key", - "launched_at":"2012-10-29T13:42:11Z", - "locked":false, - "metadata":{ - - }, - "node":"fake-mini", - "os_type":null, - "power_state":"running", - "progress":0, - "ramdisk_id":"", - "reservation_id":"r-v3dru799", - "state":"active", - "task_state":"migrating", - "tenant_id":"6f70656e737461636b20342065766572", - "terminated_at":null, - "updated_at": "2012-10-29T13:42:11Z", - "user_id":"fake", - "uuid":"a57417b7-5d78-4b39-95de-4ba9505ba40e" - }, - "nova_object.name":"InstanceActionPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.5" + "task_state": "migrating" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute" diff --git a/doc/notification_samples/instance-live_migration_abort-start.json b/doc/notification_samples/instance-live_migration_abort-start.json index 69291cfdb872..140037d08753 100644 --- a/doc/notification_samples/instance-live_migration_abort-start.json +++ b/doc/notification_samples/instance-live_migration_abort-start.json @@ -1,97 +1,10 @@ { "event_type":"instance.live_migration_abort.start", "payload":{ + "$ref": "common_payloads/InstanceActionPayload.json#", "nova_object.data":{ - "architecture":"x86_64", - "auto_disk_config":"MANUAL", - "availability_zone":"nova", - "block_devices":[ - { - "nova_object.data":{ - "boot_index":null, - "delete_on_termination":false, - "device_name":"/dev/sdb", - "tag":null, - "volume_id":"a07f71dc-8151-4e7d-a0cc-cd24a3f11113" - }, - "nova_object.name":"BlockDevicePayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.0" - } - ], - "created_at":"2012-10-29T13:42:11Z", - "deleted_at":null, - "display_description":"some-server", - "display_name":"some-server", - "fault":null, - "flavor":{ - "nova_object.data":{ - "disabled":false, - "ephemeral_gb":0, - "extra_specs":{ - "hw:watchdog_action":"disabled" - }, - "flavorid":"a22d5517-147c-4147-a0d1-e698df5cd4e3", - "is_public":true, - "memory_mb":512, - "name":"test_flavor", - "projects":null, - "root_gb":1, - "rxtx_factor":1.0, - "swap":0, - "vcpu_weight":0, - "vcpus":1, - "description":null - }, - "nova_object.name":"FlavorPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.4" - }, - "host":"compute", - "host_name":"some-server", - "image_uuid":"155d900f-4e14-4e4c-a73d-069cbf4541e6", - "ip_addresses":[ - { - "nova_object.data":{ - "address":"192.168.1.3", - "device_name":"tapce531f90-19", - "label":"private-network", - "mac":"fa:16:3e:4c:2c:30", - "meta":{ - - }, - "port_uuid":"ce531f90-199f-48c0-816c-13e38010b442", - "version":4 - }, - "nova_object.name":"IpPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.0" - } - ], - "kernel_id":"", - "key_name":"my-key", - "launched_at":"2012-10-29T13:42:11Z", - "locked":false, - "metadata":{ - - }, - "node":"fake-mini", - "os_type":null, - "power_state":"running", - "progress":0, - "ramdisk_id":"", - "reservation_id":"r-n223ckb3", - "state":"active", - "task_state":"migrating", - "tenant_id":"6f70656e737461636b20342065766572", - "terminated_at":null, - "updated_at": "2012-10-29T13:42:11Z", - "user_id":"fake", - "uuid":"82468110-e659-40ab-a0eb-496df936e6ff" - }, - "nova_object.name":"InstanceActionPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.5" + "task_state": "migrating" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute" diff --git a/doc/notification_samples/instance-shutdown-end.json b/doc/notification_samples/instance-shutdown-end.json index 2b7186102cc4..4693c7be9928 100644 --- a/doc/notification_samples/instance-shutdown-end.json +++ b/doc/notification_samples/instance-shutdown-end.json @@ -1,76 +1,11 @@ { "event_type":"instance.shutdown.end", "payload":{ + "$ref": "common_payloads/InstanceActionPayload.json#", "nova_object.data":{ - "architecture":"x86_64", - "availability_zone": "nova", - "block_devices": [{ - "nova_object.data": { - "boot_index": null, - "delete_on_termination": false, - "device_name": "/dev/sdb", - "tag": null, - "volume_id": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113" - }, - "nova_object.name": "BlockDevicePayload", - "nova_object.namespace": "nova", - "nova_object.version": "1.0" - }], - "created_at":"2012-10-29T13:42:11Z", - "deleted_at":null, - "display_name":"some-server", - "display_description":"some-server", - "fault":null, - "host":"compute", - "host_name":"some-server", - "key_name": "my-key", "ip_addresses": [], - "kernel_id":"", - "launched_at":"2012-10-29T13:42:11Z", - "image_uuid": "155d900f-4e14-4e4c-a73d-069cbf4541e6", - "metadata":{}, - "locked":false, - "node":"fake-mini", - "os_type":null, - "progress":0, - "ramdisk_id":"", - "reservation_id":"r-npxv0e40", - "state":"active", - "task_state":"deleting", - "power_state":"running", - "tenant_id":"6f70656e737461636b20342065766572", - "terminated_at":null, - "auto_disk_config":"MANUAL", - "flavor": { - "nova_object.name": "FlavorPayload", - "nova_object.data": { - "flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3", - "name": "test_flavor", - "root_gb": 1, - "vcpus": 1, - "ephemeral_gb": 0, - "memory_mb": 512, - "disabled": false, - "rxtx_factor": 1.0, - "extra_specs": { - "hw:watchdog_action": "disabled" - }, - "projects": null, - "swap": 0, - "is_public": true, - "vcpu_weight": 0, - "description":null - }, - "nova_object.version": "1.4", - "nova_object.namespace": "nova" - }, - "user_id":"fake", - "uuid":"178b0921-8f85-4257-88b6-2e743b5a975c", - "updated_at": "2012-10-29T13:42:11Z" - }, - "nova_object.name":"InstanceActionPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.5" + "task_state": "deleting" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute" diff --git a/doc/notification_samples/instance-shutdown-start.json b/doc/notification_samples/instance-shutdown-start.json index 161ab1260d72..4ba17c2d21a8 100644 --- a/doc/notification_samples/instance-shutdown-start.json +++ b/doc/notification_samples/instance-shutdown-start.json @@ -1,89 +1,10 @@ { "event_type":"instance.shutdown.start", "payload":{ + "$ref": "common_payloads/InstanceActionPayload.json#", "nova_object.data":{ - "architecture":"x86_64", - "availability_zone": "nova", - "block_devices": [{ - "nova_object.data": { - "boot_index": null, - "delete_on_termination": false, - "device_name": "/dev/sdb", - "tag": null, - "volume_id": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113" - }, - "nova_object.name": "BlockDevicePayload", - "nova_object.namespace": "nova", - "nova_object.version": "1.0" - }], - "created_at":"2012-10-29T13:42:11Z", - "deleted_at":null, - "display_name":"some-server", - "display_description":"some-server", - "fault":null, - "host":"compute", - "host_name":"some-server", - "ip_addresses": [{ - "nova_object.name": "IpPayload", - "nova_object.namespace": "nova", - "nova_object.version": "1.0", - "nova_object.data": { - "mac": "fa:16:3e:4c:2c:30", - "address": "192.168.1.3", - "port_uuid": "ce531f90-199f-48c0-816c-13e38010b442", - "meta": {}, - "version": 4, - "label": "private-network", - "device_name": "tapce531f90-19" - } - }], - "key_name": "my-key", - "kernel_id":"", - "launched_at":"2012-10-29T13:42:11Z", - "image_uuid": "155d900f-4e14-4e4c-a73d-069cbf4541e6", - "metadata":{}, - "locked":false, - "node":"fake-mini", - "os_type":null, - "progress":0, - "ramdisk_id":"", - "reservation_id":"r-npxv0e40", - "state":"active", - "task_state":"deleting", - "power_state":"running", - "tenant_id":"6f70656e737461636b20342065766572", - "terminated_at":null, - "auto_disk_config":"MANUAL", - "flavor": { - "nova_object.name": "FlavorPayload", - "nova_object.data": { - "flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3", - "name": "test_flavor", - "root_gb": 1, - "vcpus": 1, - "ephemeral_gb": 0, - "memory_mb": 512, - "disabled": false, - "rxtx_factor": 1.0, - "extra_specs": { - "hw:watchdog_action": "disabled" - }, - "projects": null, - "swap": 0, - "is_public": true, - "vcpu_weight": 0, - "description":null - }, - "nova_object.version": "1.4", - "nova_object.namespace": "nova" - }, - "user_id":"fake", - "uuid":"178b0921-8f85-4257-88b6-2e743b5a975c", - "updated_at": "2012-10-29T13:42:11Z" - }, - "nova_object.name":"InstanceActionPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.5" + "task_state": "deleting" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute" diff --git a/doc/notification_samples/instance-snapshot-end.json b/doc/notification_samples/instance-snapshot-end.json index c032a2a994b0..c53068aad7d2 100644 --- a/doc/notification_samples/instance-snapshot-end.json +++ b/doc/notification_samples/instance-snapshot-end.json @@ -1,90 +1,7 @@ { "event_type":"instance.snapshot.end", "payload":{ - "nova_object.data":{ - "architecture":"x86_64", - "availability_zone": "nova", - "block_devices": [{ - "nova_object.data": { - "boot_index": null, - "delete_on_termination": false, - "device_name": "/dev/sdb", - "tag": null, - "volume_id": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113" - }, - "nova_object.name": "BlockDevicePayload", - "nova_object.namespace": "nova", - "nova_object.version": "1.0" - }], - "created_at":"2012-10-29T13:42:11Z", - "deleted_at":null, - "display_name":"some-server", - "display_description":"some-server", - "fault":null, - "host":"compute", - "host_name":"some-server", - "ip_addresses": [{ - "nova_object.name": "IpPayload", - "nova_object.namespace": "nova", - "nova_object.version": "1.0", - "nova_object.data": { - "mac": "fa:16:3e:4c:2c:30", - "address": "192.168.1.3", - "port_uuid": "ce531f90-199f-48c0-816c-13e38010b442", - "meta": {}, - "version": 4, - "label": "private-network", - "device_name": "tapce531f90-19" - } - }], - "key_name": "my-key", - "kernel_id":"", - "launched_at":"2012-10-29T13:42:11Z", - "image_uuid": "155d900f-4e14-4e4c-a73d-069cbf4541e6", - "metadata":{}, - "locked":false, - "node":"fake-mini", - "os_type":null, - "progress":0, - "ramdisk_id":"", - "reservation_id":"r-npxv0e40", - "state":"active", - "task_state":null, - "power_state":"running", - "tenant_id":"6f70656e737461636b20342065766572", - "terminated_at":null, - "auto_disk_config":"MANUAL", - "flavor": { - "nova_object.name": "FlavorPayload", - "nova_object.data": { - "flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3", - "name": "test_flavor", - "root_gb": 1, - "vcpus": 1, - "ephemeral_gb": 0, - "memory_mb": 512, - "disabled": false, - "rxtx_factor": 1.0, - "extra_specs": { - "hw:watchdog_action": "disabled" - }, - "projects": null, - "swap": 0, - "is_public": true, - "vcpu_weight": 0, - "description":null - }, - "nova_object.version": "1.4", - "nova_object.namespace": "nova" - }, - "user_id":"fake", - "uuid":"178b0921-8f85-4257-88b6-2e743b5a975c", - "updated_at": "2012-10-29T13:42:11Z", - "snapshot_image_id": "d2aae36f-785c-4518-8016-bc9534d9fc7f" - }, - "nova_object.name":"InstanceActionSnapshotPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.6" + "$ref": "common_payloads/InstanceActionSnapshotPayload.json#" }, "priority":"INFO", "publisher_id":"nova-compute:compute" diff --git a/doc/notification_samples/instance-snapshot-start.json b/doc/notification_samples/instance-snapshot-start.json index d02790d5b077..df775e281222 100644 --- a/doc/notification_samples/instance-snapshot-start.json +++ b/doc/notification_samples/instance-snapshot-start.json @@ -1,90 +1,10 @@ { "event_type":"instance.snapshot.start", "payload":{ + "$ref": "common_payloads/InstanceActionSnapshotPayload.json#", "nova_object.data":{ - "architecture":"x86_64", - "availability_zone": "nova", - "block_devices": [{ - "nova_object.data": { - "boot_index": null, - "delete_on_termination": false, - "device_name": "/dev/sdb", - "tag": null, - "volume_id": "a07f71dc-8151-4e7d-a0cc-cd24a3f11113" - }, - "nova_object.name": "BlockDevicePayload", - "nova_object.namespace": "nova", - "nova_object.version": "1.0" - }], - "created_at":"2012-10-29T13:42:11Z", - "deleted_at":null, - "display_name":"some-server", - "display_description":"some-server", - "fault":null, - "host":"compute", - "host_name":"some-server", - "ip_addresses": [{ - "nova_object.name": "IpPayload", - "nova_object.namespace": "nova", - "nova_object.version": "1.0", - "nova_object.data": { - "mac": "fa:16:3e:4c:2c:30", - "address": "192.168.1.3", - "port_uuid": "ce531f90-199f-48c0-816c-13e38010b442", - "meta": {}, - "version": 4, - "label": "private-network", - "device_name": "tapce531f90-19" - } - }], - "key_name": "my-key", - "kernel_id":"", - "launched_at":"2012-10-29T13:42:11Z", - "image_uuid": "155d900f-4e14-4e4c-a73d-069cbf4541e6", - "metadata":{}, - "locked":false, - "node":"fake-mini", - "os_type":null, - "progress":0, - "ramdisk_id":"", - "reservation_id":"r-npxv0e40", - "state":"active", - "task_state":"image_snapshot", - "power_state":"running", - "tenant_id":"6f70656e737461636b20342065766572", - "terminated_at":null, - "auto_disk_config":"MANUAL", - "flavor": { - "nova_object.name": "FlavorPayload", - "nova_object.data": { - "flavorid": "a22d5517-147c-4147-a0d1-e698df5cd4e3", - "name": "test_flavor", - "root_gb": 1, - "vcpus": 1, - "ephemeral_gb": 0, - "memory_mb": 512, - "disabled": false, - "rxtx_factor": 1.0, - "extra_specs": { - "hw:watchdog_action": "disabled" - }, - "projects": null, - "swap": 0, - "is_public": true, - "vcpu_weight": 0, - "description":null - }, - "nova_object.version": "1.4", - "nova_object.namespace": "nova" - }, - "user_id":"fake", - "uuid":"178b0921-8f85-4257-88b6-2e743b5a975c", - "updated_at": "2012-10-29T13:42:11Z", - "snapshot_image_id": "d2aae36f-785c-4518-8016-bc9534d9fc7f" - }, - "nova_object.name":"InstanceActionSnapshotPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.6" + "task_state":"image_snapshot" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute"