acitoolkitlib module

Collection of utility classes to make getting credentials and configuration easier.

class acitoolkit.acitoolkitlib.AcitoolkitGraphBuilder

Bases: object

Class to build class hierarchy diagrams for the ACI toolkit Physical and Logical Models

static build_graph_from_parent(root_parent_name)

Create a graph starting from the root class name

Parameters:root_parent_name – String containing the class name to use as the root of the class hierarchy graph
Returns:None
build_graphs()

Build the graphs starting with the various parent class names

class acitoolkit.acitoolkitlib.Credentials(qualifier='apic', description='')

Bases: object

Used to get the APIC and MySQL login credentials from the command line (–help gives usage).

The login credentials are taken in the following order

  • Command line arguments
  • Environment variables
  • File named credentials.py
  • From an interactive prompt

These are done in a per credential basis so it is possible to specify only some of the arguments. For instance, the username and URL can be specified in credentials.py but the password can be taken from the user through the interactive prompt. Another example is using the command line argument to override the URL specified in credentials.py to temporarily connect to a different APIC.

add_argument(*args, **kwargs)

Pass through function to allow the underlying parser to be extended.

add_argument_group(*args, **kwargs)

Pass through function to allow the underlying parser to be extended.

add_mutually_exclusive_group(*args, **kwargs)

Pass through function to allow the underlying parser to be extended.

get()

Get the arguments and verify them

print_help(*args, **kwargs)

Pass through function to allow the underlying parser to be extended.

verify()

Verify that the arguments have been passed in some way. If not, ask the user through interactive prompt.