Merge "Versioned notification add support for instance.create.start"
This commit is contained in:
commit
6dc5fdfb5c
25
doc/notification_samples/instance-create-start.json
Normal file
25
doc/notification_samples/instance-create-start.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"event_type": "instance.create.start",
|
||||
"payload": {
|
||||
"mogan_object.name": "InstanceActionPayload",
|
||||
"mogan_object.namespace": "mogan",
|
||||
"mogan_object.version": "1.0",
|
||||
"mogan_object.data": {
|
||||
"instance_type_uuid": "6ce9904f-c61f-4ee8-afbe-c852c05258f6",
|
||||
"status": "building",
|
||||
"user_id": "dfc14a6e939646d1929362de1758d7b2",
|
||||
"uuid": "e1a7b5b7-c76c-4459-8328-10deda95819f",
|
||||
"availability_zone": null,
|
||||
"fault": null,
|
||||
"created_at": "2017-01-06T08:26:18Z",
|
||||
"description": null,
|
||||
"updated_at": null,
|
||||
"image_uuid": "300fc139-73d3-46fd-86ef-267cb6c13341",
|
||||
"project_id": "216162836cb340a7946dad1c0c7aa650",
|
||||
"launched_at": null,
|
||||
"name": "test1"
|
||||
}
|
||||
},
|
||||
"priority": "INFO",
|
||||
"publisher_id": "mogan-engine:localhost"
|
||||
}
|
@ -35,6 +35,8 @@ from mogan.engine.baremetal import ironic_states
|
||||
from mogan.engine import base_manager
|
||||
from mogan.engine.flows import create_instance
|
||||
from mogan.engine import status
|
||||
from mogan.notifications import base as notifications
|
||||
from mogan.objects import fields
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
|
||||
@ -163,6 +165,10 @@ class EngineManager(base_manager.BaseEngineManager):
|
||||
request_spec=None, filter_properties=None):
|
||||
"""Perform a deployment."""
|
||||
LOG.debug("Starting instance...", instance=instance)
|
||||
notifications.notify_about_instance_action(
|
||||
context, instance, self.host,
|
||||
action=fields.NotificationAction.CREATE,
|
||||
phase=fields.NotificationPhase.START)
|
||||
|
||||
if filter_properties is None:
|
||||
filter_properties = {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user