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):
     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, 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)
Exemple #4
0
 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)
Exemple #5
0
 def take_action(self, parsed_args):
     metric = utils.get_client(self).metric.get(
         metric=parsed_args.metric, resource_id=parsed_args.resource_id)
     metric['archive_policy/name'] = metric["archive_policy"]["name"]
     del metric['archive_policy']
     del metric['created_by_user_id']
     del metric['created_by_project_id']
     utils.format_resource_for_metric(metric)
     return self.dict2columns(metric)
Exemple #6
0
 def take_action(self, parsed_args):
     metric = utils.get_client(self).metric._create_new(
         archive_policy_name=parsed_args.archive_policy_name,
         name=parsed_args.name,
         resource_id=parsed_args.resource_id,
         unit=parsed_args.unit,
     )
     utils.format_resource_for_metric(metric)
     if 'archive_policy' in metric:
         metric['archive_policy/name'] = metric["archive_policy"]["name"]
         del metric['archive_policy']
     del metric['created_by_user_id']
     del metric['created_by_project_id']
     return self.dict2columns(metric)