From 00140e0931798df30b9501bf5f6abce8e6fcc520 Mon Sep 17 00:00:00 2001 From: Lajos Katona Date: Thu, 4 Jan 2018 15:27:59 +0100 Subject: [PATCH] Deduplicate aggregate notification samples This patch refactors the sample files of aggregate-add_host, aggregate-delete, aggregate-create and aggregate-remove_host notifications to use a common AggregatePayload sample data. Change-Id: I50382f4d829693412bbfe47ffd08a24e69342715 --- .../aggregate-add_host-end.json | 12 ++---------- .../aggregate-add_host-start.json | 13 +------------ doc/notification_samples/aggregate-create-end.json | 13 +------------ .../aggregate-create-start.json | 11 ++--------- doc/notification_samples/aggregate-delete-end.json | 13 +------------ .../aggregate-delete-start.json | 13 +------------ .../aggregate-remove_host-end.json | 13 +------------ .../aggregate-remove_host-start.json | 12 ++---------- .../common_payloads/AggregatePayload.json | 14 ++++++++++++++ 9 files changed, 25 insertions(+), 89 deletions(-) create mode 100644 doc/notification_samples/common_payloads/AggregatePayload.json diff --git a/doc/notification_samples/aggregate-add_host-end.json b/doc/notification_samples/aggregate-add_host-end.json index ae1676960..7667e7a3b 100644 --- a/doc/notification_samples/aggregate-add_host-end.json +++ b/doc/notification_samples/aggregate-add_host-end.json @@ -1,17 +1,9 @@ { "priority": "INFO", "payload": { - "nova_object.version": "1.1", - "nova_object.namespace": "nova", - "nova_object.name": "AggregatePayload", + "$ref": "common_payloads/AggregatePayload.json#", "nova_object.data": { - "name": "my-aggregate", - "metadata": { - "availability_zone": "nova" - }, - "hosts": ["compute"], - "id": 1, - "uuid": "788608ec-ebdc-45c5-bc7f-e5f24ab92c80" + "hosts": ["compute"] } }, "event_type": "aggregate.add_host.end", diff --git a/doc/notification_samples/aggregate-add_host-start.json b/doc/notification_samples/aggregate-add_host-start.json index 4e82af3d7..379eba0bb 100644 --- a/doc/notification_samples/aggregate-add_host-start.json +++ b/doc/notification_samples/aggregate-add_host-start.json @@ -1,18 +1,7 @@ { "priority": "INFO", "payload": { - "nova_object.version": "1.1", - "nova_object.namespace": "nova", - "nova_object.name": "AggregatePayload", - "nova_object.data": { - "name": "my-aggregate", - "metadata": { - "availability_zone": "nova" - }, - "hosts": [], - "id": 1, - "uuid": "788608ec-ebdc-45c5-bc7f-e5f24ab92c80" - } + "$ref": "common_payloads/AggregatePayload.json#" }, "event_type": "aggregate.add_host.start", "publisher_id": "nova-api:fake-mini" diff --git a/doc/notification_samples/aggregate-create-end.json b/doc/notification_samples/aggregate-create-end.json index ab48994fa..f34e0b7fe 100644 --- a/doc/notification_samples/aggregate-create-end.json +++ b/doc/notification_samples/aggregate-create-end.json @@ -1,18 +1,7 @@ { "priority": "INFO", "payload": { - "nova_object.version": "1.1", - "nova_object.namespace": "nova", - "nova_object.name": "AggregatePayload", - "nova_object.data": { - "name": "my-aggregate", - "metadata": { - "availability_zone": "nova" - }, - "hosts": [], - "id": 1, - "uuid": "788608ec-ebdc-45c5-bc7f-e5f24ab92c80" - } + "$ref": "common_payloads/AggregatePayload.json#" }, "event_type": "aggregate.create.end", "publisher_id": "nova-api:fake-mini" diff --git a/doc/notification_samples/aggregate-create-start.json b/doc/notification_samples/aggregate-create-start.json index 775feea7d..314f6f131 100644 --- a/doc/notification_samples/aggregate-create-start.json +++ b/doc/notification_samples/aggregate-create-start.json @@ -1,17 +1,10 @@ { "priority": "INFO", "payload": { - "nova_object.version": "1.1", - "nova_object.namespace": "nova", - "nova_object.name": "AggregatePayload", + "$ref": "common_payloads/AggregatePayload.json#", "nova_object.data": { - "name": "my-aggregate", - "metadata": { - "availability_zone": "nova" - }, "hosts": null, - "id": null, - "uuid": "788608ec-ebdc-45c5-bc7f-e5f24ab92c80" + "id": null } }, "event_type": "aggregate.create.start", diff --git a/doc/notification_samples/aggregate-delete-end.json b/doc/notification_samples/aggregate-delete-end.json index 058c3a9e5..df6fe7870 100644 --- a/doc/notification_samples/aggregate-delete-end.json +++ b/doc/notification_samples/aggregate-delete-end.json @@ -1,18 +1,7 @@ { "priority": "INFO", "payload": { - "nova_object.version": "1.1", - "nova_object.namespace": "nova", - "nova_object.name": "AggregatePayload", - "nova_object.data": { - "name": "my-aggregate", - "metadata": { - "availability_zone": "nova" - }, - "hosts": [], - "id": 1, - "uuid": "788608ec-ebdc-45c5-bc7f-e5f24ab92c80" - } + "$ref": "common_payloads/AggregatePayload.json#" }, "event_type": "aggregate.delete.end", "publisher_id": "nova-api:fake-mini" diff --git a/doc/notification_samples/aggregate-delete-start.json b/doc/notification_samples/aggregate-delete-start.json index b4c75abbe..276d0d417 100644 --- a/doc/notification_samples/aggregate-delete-start.json +++ b/doc/notification_samples/aggregate-delete-start.json @@ -1,18 +1,7 @@ { "priority": "INFO", "payload": { - "nova_object.version": "1.1", - "nova_object.namespace": "nova", - "nova_object.name": "AggregatePayload", - "nova_object.data": { - "name": "my-aggregate", - "metadata": { - "availability_zone": "nova" - }, - "hosts": [], - "id": 1, - "uuid": "788608ec-ebdc-45c5-bc7f-e5f24ab92c80" - } + "$ref": "common_payloads/AggregatePayload.json#" }, "event_type": "aggregate.delete.start", "publisher_id": "nova-api:fake-mini" diff --git a/doc/notification_samples/aggregate-remove_host-end.json b/doc/notification_samples/aggregate-remove_host-end.json index 9708bf86e..b2a533dbd 100644 --- a/doc/notification_samples/aggregate-remove_host-end.json +++ b/doc/notification_samples/aggregate-remove_host-end.json @@ -1,18 +1,7 @@ { "priority": "INFO", "payload": { - "nova_object.version": "1.1", - "nova_object.namespace": "nova", - "nova_object.name": "AggregatePayload", - "nova_object.data": { - "name": "my-aggregate", - "metadata": { - "availability_zone": "nova" - }, - "hosts": [], - "id": 1, - "uuid": "788608ec-ebdc-45c5-bc7f-e5f24ab92c80" - } + "$ref": "common_payloads/AggregatePayload.json#" }, "event_type": "aggregate.remove_host.end", "publisher_id": "nova-api:fake-mini" diff --git a/doc/notification_samples/aggregate-remove_host-start.json b/doc/notification_samples/aggregate-remove_host-start.json index e8852921b..607bf9271 100644 --- a/doc/notification_samples/aggregate-remove_host-start.json +++ b/doc/notification_samples/aggregate-remove_host-start.json @@ -1,17 +1,9 @@ { "priority": "INFO", "payload": { - "nova_object.version": "1.1", - "nova_object.namespace": "nova", - "nova_object.name": "AggregatePayload", + "$ref": "common_payloads/AggregatePayload.json#", "nova_object.data": { - "name": "my-aggregate", - "metadata": { - "availability_zone": "nova" - }, - "hosts": ["compute"], - "id": 1, - "uuid": "788608ec-ebdc-45c5-bc7f-e5f24ab92c80" + "hosts": ["compute"] } }, "event_type": "aggregate.remove_host.start", diff --git a/doc/notification_samples/common_payloads/AggregatePayload.json b/doc/notification_samples/common_payloads/AggregatePayload.json new file mode 100644 index 000000000..0157487d7 --- /dev/null +++ b/doc/notification_samples/common_payloads/AggregatePayload.json @@ -0,0 +1,14 @@ +{ + "nova_object.version": "1.1", + "nova_object.namespace": "nova", + "nova_object.name": "AggregatePayload", + "nova_object.data": { + "name": "my-aggregate", + "metadata": { + "availability_zone": "nova" + }, + "uuid": "788608ec-ebdc-45c5-bc7f-e5f24ab92c80", + "hosts": [], + "id": 1 + } +}