Ejemplo n.º 1
0
 def take_action(self, parsed_args):
     query = None
     if parsed_args.query:
         query = jsonutils.dumps(
             utils.search_query_builder(parsed_args.query))
     history = self.app.client.alarm_history.search(query=query)
     return utils.list2cols(self.COLS, history)
Ejemplo n.º 2
0
 def take_action(self, parsed_args):
     history = utils.get_client(self).alarm_history.get(
         alarm_id=parsed_args.alarm_id,
         sorts=parsed_args.sort,
         limit=parsed_args.limit,
         marker=parsed_args.marker)
     return utils.list2cols(self.COLS, history)
Ejemplo n.º 3
0
 def take_action(self, parsed_args):
     query = None
     if parsed_args.query:
         query = jsonutils.dumps(
             utils.search_query_builder(parsed_args.query))
     history = utils.get_client(self).alarm_history.search(query=query)
     return utils.list2cols(self.COLS, history)
 def take_action(self, parsed_args):
     type_query = '{"=": {"type": "%s"}}' % parsed_args.type
     if parsed_args.query:
         query = '{"and": [%s, %s]}' % (type_query, parsed_args.query)
     else:
         query = type_query
     alarms = self.app.client.alarm.search(query=query)
     return utils.list2cols(ALARM_LIST_COLS, alarms)
 def take_action(self, parsed_args):
     type_query = '{"=": {"type": "%s"}}' % parsed_args.type
     if parsed_args.query:
         query = '{"and": [%s, %s]}' % (type_query, parsed_args.query)
     else:
         query = type_query
     alarms = self.app.client.alarm.search(query=query)
     return utils.list2cols(ALARM_LIST_COLS, alarms)
Ejemplo n.º 6
0
 def take_action(self, parsed_args):
     if parsed_args.query:
         query = jsonutils.dumps(
             utils.search_query_builder(parsed_args.query))
     else:
         query = None
     filters = dict(parsed_args.filter) if parsed_args.filter else None
     alarms = self.app.client.alarm.list(query=query, filters=filters)
     return utils.list2cols(ALARM_LIST_COLS, alarms)
Ejemplo n.º 7
0
 def take_action(self, parsed_args):
     if parsed_args.query:
         if any([parsed_args.limit, parsed_args.sort, parsed_args.marker]):
             raise exceptions.CommandError(
                 "Query and pagination options are mutually "
                 "exclusive.")
         query = jsonutils.dumps(
             utils.search_query_builder(parsed_args.query))
         alarms = utils.get_client(self).alarm.query(query=query)
     else:
         filters = dict(parsed_args.filter) if parsed_args.filter else None
         alarms = utils.get_client(self).alarm.list(
             filters=filters, sorts=parsed_args.sort,
             limit=parsed_args.limit, marker=parsed_args.marker)
     return utils.list2cols(ALARM_LIST_COLS, alarms)
 def take_action(self, parsed_args):
     alarms = self.app.client.alarm.list(alarm_type=parsed_args.type)
     return utils.list2cols(ALARM_LIST_COLS, alarms)
 def take_action(self, parsed_args):
     history = self.app.client.alarm_history.get(
         alarm_id=parsed_args.alarm_id)
     return utils.list2cols(self.COLS, history)
 def take_action(self, parsed_args):
     history = self.app.client.alarm_history.search(query=parsed_args.query)
     return utils.list2cols(self.COLS, history)
 def take_action(self, parsed_args):
     alarms = self.app.client.alarm.list(alarm_type=parsed_args.type)
     return utils.list2cols(ALARM_LIST_COLS, alarms)
Ejemplo n.º 12
0
 def take_action(self, parsed_args):
     history = self.app.client.alarm_history.get(
         alarm_id=parsed_args.alarm_id)
     return utils.list2cols(self.COLS, history)