The gnocchiclient.shell Module

class gnocchiclient.shell.GnocchiCommandManager(namespace, convert_underscores=True)

Bases: CommandManager

SHELL_COMMANDS = {'aggregates': <class 'gnocchiclient.v1.aggregates_cli.CliAggregates'>, 'archive-policy create': <class 'gnocchiclient.v1.archive_policy_cli.CliArchivePolicyCreate'>, 'archive-policy delete': <class 'gnocchiclient.v1.archive_policy_cli.CliArchivePolicyDelete'>, 'archive-policy list': <class 'gnocchiclient.v1.archive_policy_cli.CliArchivePolicyList'>, 'archive-policy show': <class 'gnocchiclient.v1.archive_policy_cli.CliArchivePolicyShow'>, 'archive-policy update': <class 'gnocchiclient.v1.archive_policy_cli.CliArchivePolicyUpdate'>, 'archive-policy-rule create': <class 'gnocchiclient.v1.archive_policy_rule_cli.CliArchivePolicyRuleCreate'>, 'archive-policy-rule delete': <class 'gnocchiclient.v1.archive_policy_rule_cli.CliArchivePolicyRuleDelete'>, 'archive-policy-rule list': <class 'gnocchiclient.v1.archive_policy_rule_cli.CliArchivePolicyRuleList'>, 'archive-policy-rule show': <class 'gnocchiclient.v1.archive_policy_rule_cli.CliArchivePolicyRuleShow'>, 'archive-policy-rule update': <class 'gnocchiclient.v1.archive_policy_rule_cli.CliArchivePolicyRuleUpdate'>, 'benchmark measures add': <class 'gnocchiclient.benchmark.CliBenchmarkMeasuresAdd'>, 'benchmark measures show': <class 'gnocchiclient.benchmark.CliBenchmarkMeasuresShow'>, 'benchmark metric create': <class 'gnocchiclient.benchmark.CliBenchmarkMetricCreate'>, 'benchmark metric show': <class 'gnocchiclient.benchmark.CliBenchmarkMetricShow'>, 'capabilities list': <class 'gnocchiclient.v1.capabilities_cli.CliCapabilitiesList'>, 'measures add': <class 'gnocchiclient.v1.metric_cli.CliMeasuresAdd'>, 'measures aggregation': <class 'gnocchiclient.v1.metric_cli.CliMeasuresAggregation'>, 'measures batch-metrics': <class 'gnocchiclient.v1.metric_cli.CliMetricsMeasuresBatch'>, 'measures batch-resources-metrics': <class 'gnocchiclient.v1.metric_cli.CliResourcesMetricsMeasuresBatch'>, 'measures show': <class 'gnocchiclient.v1.metric_cli.CliMeasuresShow'>, 'metric create': <class 'gnocchiclient.v1.metric_cli.CliMetricCreate'>, 'metric delete': <class 'gnocchiclient.v1.metric_cli.CliMetricDelete'>, 'metric list': <class 'gnocchiclient.v1.metric_cli.CliMetricList'>, 'metric show': <class 'gnocchiclient.v1.metric_cli.CliMetricShow'>, 'resource batch delete': <class 'gnocchiclient.v1.resource_cli.CliResourceBatchDelete'>, 'resource create': <class 'gnocchiclient.v1.resource_cli.CliResourceCreate'>, 'resource delete': <class 'gnocchiclient.v1.resource_cli.CliResourceDelete'>, 'resource history': <class 'gnocchiclient.v1.resource_cli.CliResourceHistory'>, 'resource list': <class 'gnocchiclient.v1.resource_cli.CliResourceList'>, 'resource search': <class 'gnocchiclient.v1.resource_cli.CliResourceSearch'>, 'resource show': <class 'gnocchiclient.v1.resource_cli.CliResourceShow'>, 'resource update': <class 'gnocchiclient.v1.resource_cli.CliResourceUpdate'>, 'resource-type create': <class 'gnocchiclient.v1.resource_type_cli.CliResourceTypeCreate'>, 'resource-type delete': <class 'gnocchiclient.v1.resource_type_cli.CliResourceTypeDelete'>, 'resource-type list': <class 'gnocchiclient.v1.resource_type_cli.CliResourceTypeList'>, 'resource-type show': <class 'gnocchiclient.v1.resource_type_cli.CliResourceTypeShow'>, 'resource-type update': <class 'gnocchiclient.v1.resource_type_cli.CliResourceTypeUpdate'>, 'server version': <class 'gnocchiclient.v1.build_cli.CliBuildShow'>, 'status': <class 'gnocchiclient.v1.status_cli.CliStatusShow'>}
load_commands(namespace)

Load all the commands from an entrypoint

class gnocchiclient.shell.GnocchiShell

Bases: App

build_option_parser(description, version)

Return an argparse option parser for this application.

Subclasses may override this method to extend the parser with more global options.

Parameters:
  • description (str) – full description of the application

  • version (str) – version number for the application

clean_up(cmd, result, err)

Hook run after a command is done to shutdown the app.

Parameters:
  • cmd (cliff.command.Command) – command processor being invoked

  • result (int) – return value of cmd

  • err (Exception) – exception or None

property client
configure_logging()

Create logging handlers for any log output.

gnocchiclient.shell.main(args=None)