From a687748cec0cfbcb3eedd03f283d306b71dbfafe Mon Sep 17 00:00:00 2001 From: Kevin_Zheng Date: Thu, 12 Apr 2018 11:40:13 +0800 Subject: [PATCH] Deduplicate notification samples Rocky - 6 This patch refactors the sample files of: * instance-soft_delete-start * instance-soft_delete-end * instance-suspend-start * instance-suspend-end * instance-trigger_crash_dump-start * instance-trigger_crash_dump-end notifications to use a common InstanceActionPayload sample data. Change-Id: I8c31f44a3a3460e044ff73e0779a08ae49133f64 --- .../instance-soft_delete-end.json | 88 ++----------------- .../instance-soft_delete-start.json | 88 ++----------------- .../instance-suspend-end.json | 85 +----------------- .../instance-suspend-start.json | 85 +----------------- .../instance-trigger_crash_dump-end.json | 88 +------------------ .../instance-trigger_crash_dump-start.json | 88 +------------------ 6 files changed, 20 insertions(+), 502 deletions(-) diff --git a/doc/notification_samples/instance-soft_delete-end.json b/doc/notification_samples/instance-soft_delete-end.json index 750114613d51..632a18369d02 100644 --- a/doc/notification_samples/instance-soft_delete-end.json +++ b/doc/notification_samples/instance-soft_delete-end.json @@ -1,89 +1,11 @@ { "event_type":"instance.soft_delete.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":"2012-10-29T13:42:11Z", - "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":"soft-delete", - "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" - }, - "updated_at": "2012-10-29T13:42:11Z", - "user_id":"fake", - "uuid":"178b0921-8f85-4257-88b6-2e743b5a975c" - }, - "nova_object.name":"InstanceActionPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.5" + "$ref": "common_payloads/InstanceActionPayload.json#", + "nova_object.data": { + "deleted_at": "2012-10-29T13:42:11Z", + "state": "soft-delete" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute" diff --git a/doc/notification_samples/instance-soft_delete-start.json b/doc/notification_samples/instance-soft_delete-start.json index a424f7555888..8557860aa81e 100644 --- a/doc/notification_samples/instance-soft_delete-start.json +++ b/doc/notification_samples/instance-soft_delete-start.json @@ -1,89 +1,11 @@ { "event_type":"instance.soft_delete.start", "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":"2012-10-29T13:42:11Z", - "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": "soft-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" - }, - "updated_at": "2012-10-29T13:42:11Z", - "user_id":"fake", - "uuid":"178b0921-8f85-4257-88b6-2e743b5a975c" - }, - "nova_object.name":"InstanceActionPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.5" + "$ref": "common_payloads/InstanceActionPayload.json#", + "nova_object.data": { + "deleted_at": "2012-10-29T13:42:11Z", + "task_state": "soft-deleting" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute" diff --git a/doc/notification_samples/instance-suspend-end.json b/doc/notification_samples/instance-suspend-end.json index 70d20c2ba2c9..668e4f5dc378 100644 --- a/doc/notification_samples/instance-suspend-end.json +++ b/doc/notification_samples/instance-suspend-end.json @@ -1,89 +1,10 @@ { "event_type":"instance.suspend.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", - "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":"suspended", - "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" - }, - "nova_object.name":"InstanceActionPayload", - "nova_object.namespace":"nova", - "nova_object.version":"1.5" + "state": "suspended" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute" diff --git a/doc/notification_samples/instance-suspend-start.json b/doc/notification_samples/instance-suspend-start.json index 95c3fb76f428..bfbc03dd60c3 100644 --- a/doc/notification_samples/instance-suspend-start.json +++ b/doc/notification_samples/instance-suspend-start.json @@ -1,89 +1,10 @@ { "event_type":"instance.suspend.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":"suspending", - "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": "suspending" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute" diff --git a/doc/notification_samples/instance-trigger_crash_dump-end.json b/doc/notification_samples/instance-trigger_crash_dump-end.json index 2c27a3c3b58e..9b405d35e98b 100644 --- a/doc/notification_samples/instance-trigger_crash_dump-end.json +++ b/doc/notification_samples/instance-trigger_crash_dump-end.json @@ -1,91 +1,7 @@ { "event_type":"instance.trigger_crash_dump.end", - "payload": { - "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_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" - } - }], - "kernel_id": "", - "key_name": "my-key", - "launched_at": "2012-10-29T13:42:11Z", - "updated_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, - "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, - "projects": null, - "rxtx_factor": 1.0, - "extra_specs": { - "hw:watchdog_action": "disabled" - }, - "swap": 0, - "is_public": true, - "vcpu_weight": 0, - "description":null - }, - "nova_object.version": "1.4", - "nova_object.namespace": "nova" - }, - "user_id": "fake", - "uuid": "0ab886d0-7443-4107-9265-48371bfa662b" - }, - "nova_object.name": "InstanceActionPayload", - "nova_object.namespace": "nova", - "nova_object.version": "1.5" + "payload":{ + "$ref": "common_payloads/InstanceActionPayload.json#" }, "priority": "INFO", "publisher_id": "nova-compute:compute" diff --git a/doc/notification_samples/instance-trigger_crash_dump-start.json b/doc/notification_samples/instance-trigger_crash_dump-start.json index ca731966dec2..dca12d8e2636 100644 --- a/doc/notification_samples/instance-trigger_crash_dump-start.json +++ b/doc/notification_samples/instance-trigger_crash_dump-start.json @@ -1,91 +1,7 @@ { "event_type":"instance.trigger_crash_dump.start", - "payload": { - "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_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" - } - }], - "kernel_id": "", - "key_name": "my-key", - "launched_at": "2012-10-29T13:42:11Z", - "updated_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, - "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, - "projects": null, - "rxtx_factor": 1.0, - "extra_specs": { - "hw:watchdog_action": "disabled" - }, - "swap": 0, - "is_public": true, - "vcpu_weight": 0, - "description":null - }, - "nova_object.version": "1.4", - "nova_object.namespace": "nova" - }, - "user_id": "fake", - "uuid": "0ab886d0-7443-4107-9265-48371bfa662b" - }, - "nova_object.name": "InstanceActionPayload", - "nova_object.namespace": "nova", - "nova_object.version": "1.5" + "payload":{ + "$ref": "common_payloads/InstanceActionPayload.json#" }, "priority": "INFO", "publisher_id": "nova-compute:compute"