extract 'instance_id' as 'resource_id' in event definitions

Currently the 'computer.instance.*' event traits map its 'instance_id' as
'instance_id'. But other events like volume, image, network and etc, they
all map their object_id as 'resource_id'. So we support both as the event
consumer can deal the events.traits with in a unified pattern.

Change-Id: I69935fcce228f1b4d490d3ac91251044102a8f11
This commit is contained in:
dongwenjuan 2016-11-11 17:44:33 +08:00
parent 427237bb5c
commit 1b4fcf5f39
2 changed files with 3 additions and 1 deletions

View File

@ -213,7 +213,7 @@ quotes) like so:
payload.image_meta.'org.openstack__1__architecture'
The syntax used for the field specification is a variant of JSONPath,
and is fairly flexible.
and is fairly flexible.
(see: https://github.com/kennknowles/python-jsonpath-rw for more info)
Example Definitions file

View File

@ -7,6 +7,8 @@
fields: payload.user_id
instance_id:
fields: payload.instance_id
resource_id:
fields: payload.instance_id
host:
fields: publisher_id.`split(., 1, 1)`
service: