def take_action(self, parsed_args): metrics = utils.get_client(self).metric.list( **utils.get_pagination_options(parsed_args)) for metric in metrics: utils.format_archive_policy(metric["archive_policy"]) utils.format_move_dict_to_root(metric, "archive_policy") return utils.list2cols(self.COLS, metrics)
def take_action(self, parsed_args): metric = utils.get_client(self).metric.get( metric=parsed_args.metric, resource_id=parsed_args.resource_id) utils.format_archive_policy(metric["archive_policy"]) utils.format_move_dict_to_root(metric, "archive_policy") utils.format_resource_for_metric(metric) return self.dict2columns(metric)
def take_action(self, parsed_args): archive_policy = utils.dict_from_parsed_args( parsed_args, ['definition']) ap = self.app.client.archive_policy.update( name=parsed_args.name, archive_policy=archive_policy) if parsed_args.formatter == 'table': utils.format_archive_policy(ap) return self.dict2columns(ap)
def _take_action(self, metric, parsed_args): if parsed_args.name: metric['name'] = parsed_args.name metric = self.app.client.metric.create(metric) utils.format_archive_policy(metric["archive_policy"]) utils.format_move_dict_to_root(metric, "archive_policy") utils.format_resource_for_metric(metric) return self.dict2columns(metric)
def take_action(self, parsed_args): archive_policy = utils.dict_from_parsed_args(parsed_args, ['definition']) ap = utils.get_client(self).archive_policy.update( name=parsed_args.name, archive_policy=archive_policy) if parsed_args.formatter == 'table': utils.format_archive_policy(ap) return self.dict2columns(ap)
def take_action(self, parsed_args): archive_policy = utils.dict_from_parsed_args( parsed_args, ['name', 'back_window', 'aggregation_methods', 'definition']) ap = self.app.client.archive_policy.create( archive_policy=archive_policy) utils.format_archive_policy(ap) return self.dict2columns(ap)
def take_action(self, parsed_args): archive_policy = utils.dict_from_parsed_args( parsed_args, ['name', 'back_window', 'aggregation_methods', 'definition']) ap = utils.get_client(self).archive_policy.create( archive_policy=archive_policy) if parsed_args.formatter == 'table': utils.format_archive_policy(ap) return self.dict2columns(ap)
def take_action(self, parsed_args): metrics = self.app.client.metric.list() for metric in metrics: utils.format_archive_policy(metric["archive_policy"]) utils.format_move_dict_to_root(metric, "archive_policy") return utils.list2cols(self.COLS, metrics)
def take_action(self, parsed_args): policies = utils.get_client(self).archive_policy.list() if parsed_args.formatter == 'table': for ap in policies: utils.format_archive_policy(ap) return utils.list2cols(self.COLS, policies)
def take_action(self, parsed_args): ap = utils.get_client(self).archive_policy.get(name=parsed_args.name) if parsed_args.formatter == 'table': utils.format_archive_policy(ap) return self.dict2columns(ap)
def take_action(self, parsed_args): ap = utils.get_client(self).archive_policy.get( name=parsed_args.name) if parsed_args.formatter == 'table': utils.format_archive_policy(ap) return self.dict2columns(ap)
def take_action(self, parsed_args): ap = self.app.client.archive_policy.get( name=parsed_args.name) utils.format_archive_policy(ap) return self.dict2columns(ap)
def take_action(self, parsed_args): policies = self.app.client.archive_policy.list() for ap in policies: utils.format_archive_policy(ap) return utils.list2cols(self.COLS, policies)
def take_action(self, parsed_args): ap = self.app.client.archive_policy.get(name=parsed_args.name) utils.format_archive_policy(ap) return self.dict2columns(ap)