Commit Graph

17 Commits

Author SHA1 Message Date
Kevin_Zheng
586a18ab32 Deduplicate notification samples Rocky - 7
This patch refactors the sample files of:

* instance-update
* instance-update-tags

notifications to use a common InstanceUpdatePayload sample data.

Change-Id: I8720556ed8a9ce7f1db165a793fbb7070954cc5a
2018-04-19 20:33:17 +08:00
Matt Riedemann
48259c2bd7 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
2017-11-14 09:14:12 -05:00
Takashi NATSUME
bf17be9e8f Add 'updated_at' field to InstancePayload in notifications
Change-Id: Iddc5ec3b5053ddf5dce73c86edca26c4552d451b
Implements: bp versioned-notification-transformation-pike
Closes-Bug: #1684860
2017-07-25 19:31:21 +02:00
Balazs Gibizer
1928ec5606 Add BDM to InstancePayload
This patch adds bdm related data to InstancePayload. As loading BDM
can be expensive a new configuration flag 'bdms_in_notifications' is
introduced. If this is set to false (as by default) then the instance
notifications will contain 'null' value in block_devices field.
If this configuration flag is set to true then the block devices will
be loaded from the db and will be included in the notification payload.

Implements: bp additional-notification-fields-for-searchlight
Change-Id: I18e7483ec9a484a660e1d306fdc0986e1d5f952b
2017-07-12 16:55:17 +02:00
Balazs Gibizer
bae0deb137 Add key_name field to InstancePayload
Add key_name field to InstancePayload which means every instance.<action>
notification now have key_name field based on the instance.key_name.

Change-Id: I39059c5077c790aa85dff6b4563f581c54536b86
Implements: bp additional-notification-fields-for-searchlight
2017-06-28 11:32:21 +02:00
Sujitha
bb7d5214a4 Adding auto_disk_config field to InstancePayload
Add auto_disk_config field to InstancePayload based on
instance.auto_disk_config boolean value. If true, set it to
AUTO else MANUAL.

Implements: bp additional-notification-fields-for-searchlight
Change-Id: I18af99479562e2fe5e74e6e1252b804b074fee58
2017-04-21 12:45:39 +02:00
Sujitha
eb1ac77dd7 add tags field to instance.update notification
Tags field is added to the InstanceUpdatePayload based on the
tags field fo the related Instance object. Adding tags to instance.create
notification will be handled in the bp tag-instances-when-boot.

Implements: bp additional-notification-fields-for-searchlight

Change-Id: Ifad6487de200767fc16d035ad830c77bba49154a
2017-04-21 12:44:12 +02:00
Dan Smith
03b4c67b22 Set instance.availability_zone whenever we schedule
This ensures that instance.availability_zone reflects what AZ the
instance is actually in. In the case where no AZ was requested at
boot, previously this would always be some default value, which
isn't as useful to the things that need to consider what AZ the
instance is actually in (without doing all the aggregate math to
determine it on the fly).

Related to blueprint cells-aware-api
Change-Id: I8d426f2635232ffc4b510548a905794ca88d7f99
2017-03-23 09:30:40 -07:00
Balazs Gibizer
655942069a handle uninited fields in notification payload
Due to the not strict handling of uninitialized fields during
notification payload population it is possible that the emitted
notification missing some of the fields defined in the schema.

There are two problematic cases:
1) no load tirggered for lazy loaded fields. If the field was not
   loaded it is not added to the payload.
2) uninitialized, not lazy loadable fields are not added to the
   payload.

This patch makes sure that lazy load is triggered. If the field is
not lazy loadable and also not initialized then related payload
field will be set to None. If the payload field is not nullable
the code will fail to make sure that the inconsistency is detected.

The following changes cannot be split to different commits because
as soon as the generic schema population code is fixed every listed
notification starts behaving differently.

In some cases the availability_zone field of the Service object is left
unitialized by both the constructor and the obj_load_attr function this
caused that the availability_zone field of the service.update
notification was missing from the emitted notification payload.

The extra_specs field of the Flavor object is not lazy loadable and not
initialized in the Flavor destroy case. So the extra_specs field of the
FlavorPayload needed to be made nullable.

The projects field of the Flavor object is lazy loaded but when the
Flavor object is loaded as part of an Instance object Flavor is
orphaned and no lazy load is allowed on that Flavor object. In this
case the projects field of the FlavorPayload will be set to None to
signal that the information is not available. This also means that
the projects field of the FlavorPayload needed to be changed to
nullable.

The hosts and id fields of the Aggregate object is not initialized
during the create of the Aggregate before the aggregate.create.start
needs to be sent. Therefore these fields needs to be nullable.

Closes-Bug: #1653221
Change-Id: Ib122cd98ee0cc31938d5ff1d5c753053267a3bd4
2017-03-03 15:34:41 +01:00
Jenkins
5ba04f4335 Merge "Improve flavor sample in notification sample tests" 2017-01-23 15:03:31 +00:00
Jenkins
0308c00d0d Merge "Update notification for flavor" 2017-01-11 21:58:06 +00:00
Balazs Gibizer
af17b95073 Improve flavor sample in notification sample tests
This patch adds an extra_specs key to the flavor used in the
instance action sample test to make the samples more realistic.

Change-Id: I5ec2b536469daaea16efb1ef1537a951dc52997a
Implements: bp flavor-notifications
2017-01-11 19:50:20 +01:00
Jenkins
799efc7631 Merge "Notifications for flavor operations" 2017-01-11 16:45:50 +00:00
Matt Riedemann
e05f678e0a Update notification for flavor
This patch adds versioned notification for flavor update operation.

Implement blueprint: flavor-notifications

Change-Id: I770e3c0c1675bbb7844b13826f3fdc48ad5491a2
2017-01-11 11:16:49 -05:00
liyingjun
8d9b3d6b9d Notifications for flavor operations
This patch implements the versioned notifications for flavor
create and destroy.

Implement blueprint: flavor-notifications

Change-Id: Icc2169b87ffba4e7e2079076a82029156c584c6a
2017-01-09 20:39:58 +08:00
Anusha Unnam
5c796cbfba Add more field's in InstancePayload
Add instance's locked field and instance's
display_description field in InstancePayload.

Implements: bp additional-notification-fields-for-searchlight

Change-Id: Iceae25ca8a0d7f2e5f22cab1364215bda2fae93c
2016-12-29 16:34:26 +00:00
Balazs Gibizer
87e13112b1 Transform instance.update notification
Change-Id: I4e1ca357322bdbcb95e4803001f4a7dc1bd37f04
Implements: bp versioned-notification-transformation-newton
2016-06-30 16:54:57 +02:00