pyats.cli.commands package

Subpackages

Submodules

class pyats.cli.commands.create.CreateCommand(*args, **kwargs)

Bases: CommandWithSubcommands

SUBCMDS_ENTRYPOINT = 'pyats.cli.commands.create'
SUBCOMMANDS = [<class 'pyats.cli.commands.create.CreateProject'>]
description = '\nCreates script and library components automatically based on your input. These\nare helper functions intended to make your development life easier/reducing\nnumber of boilerplate to-dos.\n\n    '
help = 'create scripts and libraries from template'
name = 'create'
class pyats.cli.commands.create.CreateProject(*args, **kwargs)

Bases: Subcommand

Creates a new pyATS project from cookiecutter template

description = '\n    create a pyATS script from cookiecutter template, located at:\n    https://github.com/CiscoTestAutomation/pyATS-project-template\n\nRequires Cookiecutter package to be installed to work.\n    '
help = 'create a new pyATS project from template'
name = 'project'
run(args)

runs this subcommand

pyats.cli.commands.create.string_in(strng, charset)
class pyats.cli.commands.run.RunCommand(prog)

Bases: Command

The run command is really in its nature, a CommandWithSubcommands class. However - due to limitation of argparse and subparser chaining, when subparsers are involved, the amount of control given to the actual subparser is limited (eg - if the parsers require dynamic configuration).

Most of this is attributed to the fact that the core implementation of cli parsing is based on “parse first, run after”; where as in pluggable parsing designs, two-layer parsing is required (parse configuration first, configure the core parser, then parse again).

Think of the implementation of this command as a a “nested command” instead.

SUBCMDS_BASECLS

alias of Command

SUBCMDS_ENTRYPOINT = 'pyats.cli.commands.run'
help = 'runs the provided script and output corresponding results.'
load_subcmds()
main(argv)

internal entrypoint for commands

name = 'run'
parse_args(argv)
standard_logging = False
class pyats.cli.commands.secret.SecretCommand(*args, **kwargs)

Bases: CommandWithSubcommands

Command for working with secret strings.

SUBCMDS_ENTRYPOINT = 'pyats.cli.commands.secret'
SUBCOMMANDS = []
help = 'utilities for working with secret strings.'
name = 'secret'
class pyats.cli.commands.shell.ShellCommand(*args, **kwargs)

Bases: Command

Simple command to enter python shell and load testbed yaml file as testbed variable.

description = "\nEnters typical python interactive shell, setting a global variable named\n'testbed' which contains the loaded testbed YAML file\n    "
help = 'enter Python shell and load a testbed file'
name = 'shell'
run(args)

api to be implemented by the designer, performs the dirty work your command is designed to do

class pyats.cli.commands.validate.ValidateCommand(*args, **kwargs)

Bases: CommandWithSubcommands

SUBCMDS_ENTRYPOINT = 'pyats.cli.commands.validate'
SUBCOMMANDS = []
help = 'utilities that help to validate input files'
name = 'validate'