Ejemplo n.º 1
0
    def take_action(self, parsed_args):
        api = CicoWrapper(endpoint=self.app.options.endpoint,
                          api_key=self.app.options.api_key)

        inventory = api.inventory(all=parsed_args.all, ssid=parsed_args.ssid)

        columns = ('host_id', 'hostname', 'ip_address', 'chassis',
                   'used_count', 'current_state', 'comment', 'distro', 'rel',
                   'centos_version', 'architecture', 'node_pool',
                   'console_port', 'flavor')

        return (columns, (utils.get_dict_properties(inventory[host], columns)
                          for host in inventory))
Ejemplo n.º 2
0
    def take_action(self, parsed_args):
        api = CicoWrapper(
            endpoint=self.app.options.endpoint,
            api_key=self.app.options.api_key
        )

        hosts = api.node_done(ssid=parsed_args.ssid)

        columns = ('host_id', 'hostname', 'ip_address', 'chassis',
                   'used_count', 'current_state', 'comment', 'distro',
                   'rel', 'centos_version', 'architecture', 'node_pool')

        return (columns,
                (utils.get_dict_properties(hosts[host], columns)
                 for host in hosts))
Ejemplo n.º 3
0
    def take_action(self, parsed_args):
        api = CicoWrapper(endpoint=self.app.options.endpoint,
                          api_key=self.app.options.api_key)

        hosts, ssid = api.node_get(arch=parsed_args.arch,
                                   ver=parsed_args.release,
                                   count=parsed_args.count,
                                   retry_count=parsed_args.retry_count,
                                   retry_interval=parsed_args.retry_interval,
                                   flavor=parsed_args.flavor)

        columns = ('host_id', 'hostname', 'ip_address', 'chassis',
                   'used_count', 'current_state', 'comment', 'distro', 'rel',
                   'centos_version', 'architecture', 'node_pool',
                   'console_port', 'flavor')

        return (columns, (utils.get_dict_properties(hosts[host], columns)
                          for host in hosts))
Ejemplo n.º 4
0
    def take_action(self, parsed_args):
        api = CicoWrapper(
            endpoint=self.app.options.endpoint,
            api_key=self.app.options.api_key
        )

        hosts, ssid = api.node_get(arch=parsed_args.arch,
                                   ver=parsed_args.release,
                                   count=parsed_args.count)
        message = "SSID for these servers: %s\n" % ssid
        sys.stdout.write(message)

        columns = ('host_id', 'hostname', 'ip_address', 'chassis',
                   'used_count', 'current_state', 'comment', 'distro',
                   'rel', 'centos_version', 'architecture', 'node_pool')

        return (columns,
                (utils.get_dict_properties(hosts[host], columns)
                 for host in hosts))