The quantumclient.shell Module

Command-line interface to the Quantum APIs

class quantumclient.shell.HelpAction(option_strings, dest, nargs=None, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

Bases: argparse.Action

Provide a custom action so the -h and –help options to the main app will print a list of the commands.

The commands are determined by checking the CommandManager instance, passed in as the “default” value for the action.

class quantumclient.shell.QuantumShell(apiversion)

Bases: cliff.app.App

CONSOLE_MESSAGE_FORMAT = '%(message)s'
DEBUG_MESSAGE_FORMAT = '%(levelname)s: %(name)s %(message)s'
authenticate_user()

Make sure the user has provided all of the authentication info we need.

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)
configure_logging()

Create logging handlers for any log output.

initialize_app(argv)

Global app init bits:

  • set up API versions
  • validate authentication info
log = <logging.Logger instance at 0x39a6cf8>
run(argv)

Equivalent to the main program for the application.

Parameters:argv (list of str) – input arguments and options
run_subcommand(argv)
quantumclient.shell.env(*_vars, **kwargs)

Search for the first defined of possibly many env vars

Returns the first environment variable defined in vars, or returns the default defined in kwargs.

quantumclient.shell.main(argv=['build_sphinx'])
quantumclient.shell.run_command(cmd, cmd_parser, sub_argv)

This Page