The gnocchiclient.v1.resource_cli Module

class gnocchiclient.v1.resource_cli.CliResourceBatchDelete(app, app_args, cmd_name=None)

Bases: ShowOne

Delete a batch of resources based on attribute values.

get_parser(prog_name)

Return an argparse.ArgumentParser.

take_action(parsed_args)

Return a two-part tuple with a tuple of column names and a tuple of values.

class gnocchiclient.v1.resource_cli.CliResourceCreate(app, app_args, cmd_name=None)

Bases: ShowOne

Create a resource.

get_parser(prog_name)

Return an argparse.ArgumentParser.

take_action(parsed_args)

Return a two-part tuple with a tuple of column names and a tuple of values.

class gnocchiclient.v1.resource_cli.CliResourceDelete(app, app_args, cmd_name=None)

Bases: Command

Delete a resource.

get_parser(prog_name)

Return an argparse.ArgumentParser.

take_action(parsed_args)

Override to do something useful.

The returned value will be returned by the program.

class gnocchiclient.v1.resource_cli.CliResourceHistory(app, app_args, cmd_name=None)

Bases: CliResourceList

Show the history of a resource.

get_parser(prog_name)

Return an argparse.ArgumentParser.

take_action(parsed_args)

Run command.

Return a tuple containing the column names and an iterable containing the data to be listed.

class gnocchiclient.v1.resource_cli.CliResourceList(app, app_args, cmd_name=None)

Bases: Lister

List resources.

COLS = ('id', 'type', 'project_id', 'user_id', 'original_resource_id', 'started_at', 'ended_at', 'revision_start', 'revision_end')
get_parser(prog_name, history=True)

Return an argparse.ArgumentParser.

take_action(parsed_args)

Run command.

Return a tuple containing the column names and an iterable containing the data to be listed.

class gnocchiclient.v1.resource_cli.CliResourceSearch(app, app_args, cmd_name=None)

Bases: CliResourceList

Search resources with specified query rules.

get_parser(prog_name)

Return an argparse.ArgumentParser.

take_action(parsed_args)

Run command.

Return a tuple containing the column names and an iterable containing the data to be listed.

class gnocchiclient.v1.resource_cli.CliResourceShow(app, app_args, cmd_name=None)

Bases: ShowOne

Show a resource.

get_parser(prog_name)

Return an argparse.ArgumentParser.

take_action(parsed_args)

Return a two-part tuple with a tuple of column names and a tuple of values.

class gnocchiclient.v1.resource_cli.CliResourceUpdate(app, app_args, cmd_name=None)

Bases: CliResourceCreate

Update a resource.

get_parser(prog_name)

Return an argparse.ArgumentParser.

take_action(parsed_args)

Return a two-part tuple with a tuple of column names and a tuple of values.

gnocchiclient.v1.resource_cli.normalize_metrics(res)