From 10d3e240c26495c313a1987afb9744495268d355 Mon Sep 17 00:00:00 2001 From: Balazs Gibizer Date: Tue, 20 Jun 2017 18:18:37 +0200 Subject: [PATCH] Deduplicate instance.power-off notification samples This patch refactors the sample files of instance.power-off and power-on notifications to use the previously introduced common sample data. Change-Id: Ifead36ba0dcef86e98e82819c48255d2d9f06d37 --- .../instance-power_off-end.json | 83 +----------------- .../instance-power_off-start.json | 84 +----------------- .../instance-power_on-end.json | 85 +------------------ .../instance-power_on-start.json | 84 +----------------- 4 files changed, 11 insertions(+), 325 deletions(-) diff --git a/doc/notification_samples/instance-power_off-end.json b/doc/notification_samples/instance-power_off-end.json index 925103903d74..52dbdf83c37f 100644 --- a/doc/notification_samples/instance-power_off-end.json +++ b/doc/notification_samples/instance-power_off-end.json @@ -1,88 +1,11 @@ { "event_type":"instance.power_off.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":"stopped", - "task_state":null, - "power_state":"shutdown", - "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 - }, - "nova_object.version": "1.3", - "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" + "power_state":"shutdown" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute" diff --git a/doc/notification_samples/instance-power_off-start.json b/doc/notification_samples/instance-power_off-start.json index 8aacfd95ed86..36f1608559a0 100644 --- a/doc/notification_samples/instance-power_off-start.json +++ b/doc/notification_samples/instance-power_off-start.json @@ -1,88 +1,10 @@ { "event_type":"instance.power_off.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":"powering-off", - "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 - }, - "nova_object.version": "1.3", - "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" + "task_state":"powering-off" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute" diff --git a/doc/notification_samples/instance-power_on-end.json b/doc/notification_samples/instance-power_on-end.json index c93c2317ad27..f19688e7d320 100644 --- a/doc/notification_samples/instance-power_on-end.json +++ b/doc/notification_samples/instance-power_on-end.json @@ -1,89 +1,6 @@ { "event_type":"instance.power_on.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 - }, - "nova_object.version": "1.3", - "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" - }, + "payload":{"$ref": "common_payloads/InstanceActionPayload.json#"}, "priority":"INFO", "publisher_id":"nova-compute:compute" } diff --git a/doc/notification_samples/instance-power_on-start.json b/doc/notification_samples/instance-power_on-start.json index 4da4d3e3bac8..f6de878ab332 100644 --- a/doc/notification_samples/instance-power_on-start.json +++ b/doc/notification_samples/instance-power_on-start.json @@ -1,88 +1,12 @@ { "event_type":"instance.power_on.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":"stopped", "task_state":"powering-on", - "power_state":"shutdown", - "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 - }, - "nova_object.version": "1.3", - "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" + "state":"stopped", + "power_state":"shutdown" + } }, "priority":"INFO", "publisher_id":"nova-compute:compute"