Exemple #1
0
    def take_action(self, parsed_args):
        path = parsed_args.path
        template_type = parsed_args.type
        cli_param_list = parsed_args.params
        params = _parse_template_params(cli_param_list)
        wait = parsed_args.wait
        overwrite = parsed_args.overwrite

        templates = utils.get_client(self).template.add(
            path=path,
            template_type=template_type,
            params=params,
            overwrite=overwrite)

        if wait:
            utils.wait_for_action_to_end(wait,
                                         self._check_finished_loading,
                                         templates=templates)

        return utils.list2cols_with_rename((
            ('UUID', 'uuid'),
            ('Name', 'name'),
            ('Status', 'status'),
            ('Status details', 'status details'),
            ('Date', 'date'),
            ('Type', 'type'),
        ), templates)
Exemple #2
0
    def take_action(self, parsed_args):
        all_tenants = parsed_args.all_tenants
        limit = parsed_args.limit
        marker = parsed_args.marker
        start = parsed_args.start
        end = parsed_args.end

        if end and not start:
            raise exc.CommandError("--end argument must be used with --start")

        alarms = utils.get_client(self).alarm.history(limit=limit,
                                                      marker=marker,
                                                      start=start,
                                                      end=end,
                                                      all_tenants=all_tenants)
        return utils.list2cols_with_rename((
            ('ID', 'vitrage_id'),
            ('Type', 'vitrage_type'),
            ('Name', 'name'),
            ('Resource Type', 'vitrage_resource_type'),
            ('Resource ID', 'vitrage_resource_id'),
            ('Severity', 'vitrage_operational_severity'),
            ('Start Time', 'start_timestamp'),
            ('End Time', 'end_timestamp'),
        ), alarms)
Exemple #3
0
 def take_action(self, parsed_args):
     service = utils.get_client(self).service.list()
     return utils.list2cols_with_rename(
         (
             ('Name', 'name'),
             ('Process Id', 'process'),
             ('Hostname', 'hostname'),
             ('Created At', 'created'),
         ), service)
 def take_action(self, parsed_args):
     templates = utils.get_client(self).template.list()
     return utils.list2cols_with_rename((
         ('UUID', 'uuid'),
         ('Name', 'name'),
         ('Status', 'status'),
         ('Status details', 'status details'),
         ('Date', 'date'),
         ('Type', 'type'),
     ), templates)
    def take_action(self, parsed_args):
        vitrage_id = parsed_args.vitrage_id
        all_tenants = parsed_args.all_tenants

        alarms = utils.get_client(self).alarm.list(vitrage_id=vitrage_id,
                                                   all_tenants=all_tenants)
        return utils.list2cols_with_rename((
            ('ID', 'vitrage_id'),
            ('Type', 'vitrage_type'),
            ('Name', 'name'),
            ('Resource Type', 'vitrage_resource_type'),
            ('Resource ID', 'vitrage_resource_id'),
            ('Severity', 'vitrage_operational_severity'),
            ('Update Time', 'update_timestamp'),
        ), alarms)
    def take_action(self, parsed_args):
        resource_type = parsed_args.resource_type
        all_tenants = parsed_args.all_tenants
        resources = utils.get_client(self).resource.list(
            resource_type=resource_type, all_tenants=all_tenants)
        # cluster, zone and host don't have "project_id" property
        # neutron.port don't have "name" property
        # cluster don't have "update_timestamp"
        for resource in resources:
            resource['metadata'] = \
                {item: resource[item] for item in self.METADATA
                 if item in resource}

        return utils.list2cols_with_rename((
            ('ID', 'vitrage_id'),
            ('Type', 'vitrage_type'),
            ('Data Source ID', 'id'),
            ('State', 'vitrage_operational_state'),
            ('Metadata', 'metadata'),
        ), resources)
Exemple #7
0
    def take_action(self, parsed_args):
        all_tenants = parsed_args.all_tenants
        webhooks = utils.get_client(self).webhook.list(all_tenants=all_tenants)

        return utils.list2cols_with_rename(self.POST_PROPS, webhooks)
Exemple #8
0
 def take_action(self, parsed_args):
     templates = utils.get_client(self).template.versions()
     return utils.list2cols_with_rename((
         ('Version', 'version'),
         ('Status', 'status'),
     ), templates)