diff --git a/nova/notifications/objects/base.py b/nova/notifications/objects/base.py index e2ffa724dc2a..ceaddd074c55 100644 --- a/nova/notifications/objects/base.py +++ b/nova/notifications/objects/base.py @@ -39,7 +39,9 @@ class EventType(NotificationObject): # NotificationActionField enum # Version 1.2: DELETE value is added to the NotificationActionField enum # Version 1.3: Set of new values are added to NotificationActionField enum - VERSION = '1.3' + # Version 1.4: Another set of new values are added to + # NotificationActionField enum + VERSION = '1.4' fields = { 'object': fields.StringField(nullable=False), diff --git a/nova/notifications/objects/instance.py b/nova/notifications/objects/instance.py index b445bdc45394..bd738144c47b 100644 --- a/nova/notifications/objects/instance.py +++ b/nova/notifications/objects/instance.py @@ -271,6 +271,39 @@ class InstanceStateUpdatePayload(base.NotificationPayloadBase): # @base.notification_sample('instance-resume-end.json') @base.notification_sample('instance-restore-start.json') @base.notification_sample('instance-restore-end.json') +# @base.notification_sample('instance-evacuate.json') +# @base.notification_sample('instance-resize_finish-start.json') +# @base.notification_sample('instance-resize_finish-end.json') +# @base.notification_sample('instance-live_migration_pre-start.json') +# @base.notification_sample('instance-live_migration_pre-end.json') +# @base.notification_sample('instance-live_migration_abort-start.json') +# @base.notification_sample('instance-live_migration_abort-end.json') +# @base.notification_sample('instance-live_migration_post-start.json') +# @base.notification_sample('instance-live_migration_post-end.json') +# @base.notification_sample('instance-live_migration_post_dest-start.json') +# @base.notification_sample('instance-live_migration_post_dest-end.json') +# @base.notification_sample('instance-live_migration_rollback-start.json') +# @base.notification_sample('instance-live_migration_rollback-end.json') +# @base.notification_sample('instance-live_migration_rollback_dest-start.json') +# @base.notification_sample('instance-live_migration_rollback_dest-end.json') +# @base.notification_sample('instance-rebuild-error.json') +# @base.notification_sample('instance-remove_fixed_ip-start.json') +# @base.notification_sample('instance-remove_fixed_ip-end.json') +# @base.notification_sample('instance-resize_confirm-start.json') +# @base.notification_sample('instance-resize_confirm-end.json') +# @base.notification_sample('instance-resize_prep-start.json') +# @base.notification_sample('instance-resize_revert-start.json') +# @base.notification_sample('instance-resize_revert-end.json') +# @base.notification_sample('instance-shelve_offload-start.json') +# @base.notification_sample('instance-shelve_offload-end.json') +# @base.notification_sample('instance-soft_delete-start.json') +# @base.notification_sample('instance-soft_delete-end.json') +# @base.notification_sample('instance-trigger_crash_dump-start.json') +# @base.notification_sample('instance-trigger_crash_dump-end.json') +# @base.notification_sample('instance-unrescue-start.json') +# @base.notification_sample('instance-unrescue-end.json') +# @base.notification_sample('instance-unshelve-start.json') +# @base.notification_sample('instance-unshelve-end.json') @nova_base.NovaObjectRegistry.register_notification class InstanceActionNotification(base.NotificationBase): # Version 1.0: Initial version diff --git a/nova/objects/fields.py b/nova/objects/fields.py index 7673b2ef5214..9229a54f04e2 100644 --- a/nova/objects/fields.py +++ b/nova/objects/fields.py @@ -516,10 +516,39 @@ class NotificationAction(BaseNovaEnum): SHELVE = 'shelve' RESUME = 'resume' RESTORE = 'restore' + EXISTS = 'exists' + RESCUE = 'rescue' + VOLUME_ATTACH = 'volume_attach' + VOLUME_DETACH = 'volume_detach' + CREATE = 'create' + EVACUATE = 'evacuate' + RESIZE_FINISH = 'resize_finish' + LIVE_MIGRATION_ABORT = 'live_migration_abort' + LIVE_MIGRATION_POST_DEST = 'live_migration_post_dest' + LIVE_MIGRATION_POST = 'live_migration_post' + LIVE_MIGRATION_PRE = 'live_migration_pre' + LIVE_MIGRATION_ROLLBACK_DEST = 'live_migration_rollback_dest' + LIVE_MIGRATION_ROLLBACK = 'live_migration_rollback' + REBUILD = 'rebuild' + REMOVE_FIXED_IP = 'remove_fixed_ip' + RESIZE_CONFIRM = 'resize_confirm' + RESIZE_PREP = 'resize_prep' + RESIZE_REVERT = 'resize_revert' + SHELVE_OFFLOAD = 'shelve_offload' + SOFT_DELETE = 'soft_delete' + TRIGGER_CRASH_DUMP = 'trigger_crash_dump' + UNRESCUE = 'unrescue' + UNSHELVE = 'unshelve' ALL = (UPDATE, EXCEPTION, DELETE, PAUSE, UNPAUSE, RESIZE, VOLUME_SWAP, SUSPEND, POWER_ON, REBOOT, SHUTDOWN, SNAPSHOT, ADD_FIXED_IP, - POWER_OFF, SHELVE, RESUME, RESTORE) + POWER_OFF, SHELVE, RESUME, RESTORE, EXISTS, RESCUE, VOLUME_ATTACH, + VOLUME_DETACH, CREATE, EVACUATE, RESIZE_FINISH, + LIVE_MIGRATION_ABORT, LIVE_MIGRATION_POST_DEST, LIVE_MIGRATION_POST, + LIVE_MIGRATION_PRE, LIVE_MIGRATION_ROLLBACK, + LIVE_MIGRATION_ROLLBACK_DEST, REBUILD, REMOVE_FIXED_IP, + RESIZE_CONFIRM, RESIZE_PREP, RESIZE_REVERT, SHELVE_OFFLOAD, + SOFT_DELETE, TRIGGER_CRASH_DUMP, UNRESCUE, UNSHELVE) # TODO(rlrossit): These should be changed over to be a StateMachine enum from diff --git a/nova/tests/unit/notifications/objects/test_notification.py b/nova/tests/unit/notifications/objects/test_notification.py index 6f4c8732ae95..753bac4bf6ac 100644 --- a/nova/tests/unit/notifications/objects/test_notification.py +++ b/nova/tests/unit/notifications/objects/test_notification.py @@ -259,7 +259,7 @@ class TestNotificationBase(test.NoDBTestCase): notification_object_data = { 'AuditPeriodPayload': '1.0-28345f72ca9d805eeb61b2c2385805dd', 'BandwidthPayload': '1.0-49278639296f9939ff2c8947b2078a82', - 'EventType': '1.3-6ef678bfe9a4ebfd669c96d2d2c124a5', + 'EventType': '1.4-da0f0fbcda143ca96c2ac1b93937c22c', 'ExceptionNotification': '1.0-a73147b93b520ff0061865849d3dfa56', 'ExceptionPayload': '1.0-4516ae282a55fe2fd5c754967ee6248b', 'FlavorPayload': '1.0-8ad962ab0bafc7270f474c7dda0b7c20',