Add a fields meta_data to result of Senlin API
Current, when I call API to list all events with description in here: https://docs.openstack.org/api-ref/clustering/?expanded=list-events-detail#list-events and in result maybe return event objects with meta_data field and this help useful for my works. But when i get events use python-senlinclient, i can't do that. So i want add to meta_data field to response when i use python-senlinclient. Thanks. Change-Id: I85d52027f6f20e9ec9a0ffa50dadaeed649b7d7f
This commit is contained in:
parent
2ae21b2321
commit
b698c51d7b
@ -52,3 +52,5 @@ class Event(resource.Resource):
|
||||
#: A string description of the reason that brought the object into its
|
||||
#: current status.
|
||||
status_reason = resource.Body('status_reason')
|
||||
#: The metadata of an event object.
|
||||
meta_data = resource.Body('meta_data')
|
||||
|
@ -27,7 +27,13 @@ FAKE = {
|
||||
'status': 'START',
|
||||
'status_reason': 'The action was abandoned.',
|
||||
'timestamp': '2016-10-10T12:46:36.000000',
|
||||
'user': '5e5bf8027826429c96af157f68dc9072'
|
||||
'user': '5e5bf8027826429c96af157f68dc9072',
|
||||
'meta_data': {
|
||||
"action": {
|
||||
"created_at": "2019-07-13T13:18:18Z",
|
||||
"outputs": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -58,3 +64,4 @@ class TestEvent(base.TestCase):
|
||||
self.assertEqual(FAKE['status_reason'], sot.status_reason)
|
||||
self.assertEqual(FAKE['timestamp'], sot.generated_at)
|
||||
self.assertEqual(FAKE['user'], sot.user_id)
|
||||
self.assertEqual(FAKE['meta_data'], sot.meta_data)
|
||||
|
Loading…
x
Reference in New Issue
Block a user