Add event_id for alarm-history display

We only shows timestamp, type, and detail when calling alarm-history show;
As for the pagination implementation, alarm-history can only marked using
event_id, so it is not easy to use for CLI users, we should also provide
event_id when we display the results.

Change-Id: I2f8cf1d2dd9d6ddf28652ad8ccb4a25d2ec1082b
Closes-bug: #1589480
This commit is contained in:
Kevin_Zheng 2016-06-06 20:30:20 +08:00
parent 3f3087f534
commit f39ec4348d
2 changed files with 8 additions and 1 deletions

View File

@ -64,6 +64,13 @@ class AlarmHistoryTest(base.ClientTestBase):
self.assertEqual(sorted_timestamp, timestamp)
self.assertEqual('creation', creation['type'])
# TEST FIELDS
result = self.aodh(
'alarm-history', params=("show %s" % ALARM_ID))
history = self.parser.listing(result)[0]
for key in ["timestamp", "type", "detail", "event_id"]:
self.assertIn(key, history)
# SHOW
result = self.aodh(
'alarm-history', params=("show %s" % ALARM_ID))

View File

@ -42,7 +42,7 @@ class CliAlarmHistorySearch(lister.Lister):
class CliAlarmHistoryShow(lister.Lister):
"""Show history for an alarm"""
COLS = ('timestamp', 'type', 'detail')
COLS = ('timestamp', 'type', 'detail', 'event_id')
def get_parser(self, prog_name):
parser = super(CliAlarmHistoryShow, self).get_parser(prog_name)