Skip to main content

Utility to run commands/tests across large number of CloudGenix Toolkit instances.

Project description

CloudGenix Toolkit Spider

Synopsis

Utility to run commands/tests across large number of CloudGenix Toolkit instances.

Features

Early release -

  • Create a "Plan" using REGEX patterns of site/element data, and interface names for "connecting to" and "testing".
  • Run a "test" (JSON file, see included azurelatency.json for example) against previously created "Plan".

Requirements

License

MIT

Installation:

  • PIP: pip install cloudgenix-toolkit-spider. After install, spider_build_plan or spider_run_plan.
  • Github: Download files to a local directory, manually run spider_build_plan.py or spider_run_plan.py scripts.

Examples of usage:

  1. Create a test plan to connect to controller interfaces, and test out of 'Internet 1', 'Internet 2', '1' and '2' interfaces.
    edwards-mbp-pro:toolkit_spider aaron$ export AUTH_TOKEN=`cat auth_token`
    edwards-mbp-pro:toolkit_spider aaron$ ./spider_build_plan.py --connect-interfaces "Controller 1,Controller" --test-interfaces "Internet 1,Internet 2,1,2" --output test_plan.csv
    Building Toolkit Spider connect plan..
    100%|######################################################################################################################################################################|Time:  0:00:01
    Testing Toolkit Spider connect interfaces..
    100%|######################################################################################################################################################################|Time:  0:02:00
    edwards-mbp-pro:toolkit_spider aaron$
    
  2. Execute the previous created test plan to do an Azure DC latency test.
    edwards-mbp-pro:toolkit_spider aaron$ ./spider_run_plan.py --plan ./test_plan.csv --test ./azurelatency.json --output test_results.csv -U toolkituser
    Password: 
    Running Toolkit Spider Plan..
    100%|######################################################################################################################################################################|Time:  0:01:00
    edwards-mbp-pro:toolkit_spider aaron$ 
    

Caveats and known issues:

  • Need latest develop branch of Netmiko, until release with CloudGenix ION support.
  • Only one test supported today: tcping
  • TODO need to add multiprocessing, script currently runs all tests in serial.
  • Script is early access, needs lots of cleanup.

Version

Version Build Changes
1.0.0 b1 Initial Release.

Command line help

edwards-mbp-pro:toolkit_spider aaron$ ./spider_build_plan.py -h
usage: spider_build_plan.py [-h] [--site-key SITE_KEY]
                            [--element-key ELEMENT_KEY]
                            [--site-pattern SITE_PATTERN]
                            [--element-pattern ELEMENT_PATTERN] --output
                            OUTPUT --connect-interfaces CONNECT_INTERFACES
                            --test-interfaces TEST_INTERFACES
                            [--connect-timeout CONNECT_TIMEOUT]
                            [--controller CONTROLLER] [--email EMAIL]
                            [--password PASSWORD] [--insecure] [--noregion]
                            [--sdkdebug SDKDEBUG]

CloudGenix Toolkit Spider Build Plan (v1.0.0)

optional arguments:
  -h, --help            show this help message and exit

Build:
  Create a map/plan for the Toolkit Spider action.

  --site-key SITE_KEY, -SK SITE_KEY
                        Key in Site object to use for inclusion. Default
                        'name'
  --element-key ELEMENT_KEY, -EK ELEMENT_KEY
                        Key in Element object to use for inclusion. Default
                        'name'
  --site-pattern SITE_PATTERN, -SP SITE_PATTERN
                        REGEX Pattern to match Site Object with for inclusion.
                        Default '.*'
  --element-pattern ELEMENT_PATTERN, -EP ELEMENT_PATTERN
                        REGEX Pattern to match Element Object with for
                        inclusion. Default '.*'
  --output OUTPUT       Output to filename.
  --connect-interfaces CONNECT_INTERFACES, -CI CONNECT_INTERFACES
                        Comma separated list of interface to use as options to
                        connect via SSH to run the test, if available.
  --test-interfaces TEST_INTERFACES, -TI TEST_INTERFACES
                        Comma separated list of interface to run the test
                        FROM, if available
  --connect-timeout CONNECT_TIMEOUT, -CT CONNECT_TIMEOUT
                        Timeout for connect interface reachability test
                        (seconds, default 5)

API:
  These options change how this program connects to the API.

  --controller CONTROLLER, -C CONTROLLER
                        Controller URI, ex.
                        https://api.elcapitan.cloudgenix.com

Login:
  These options allow skipping of interactive login

  --email EMAIL, -E EMAIL
                        Use this email as User Name instead of
                        cloudgenix_settings.py or prompting
  --password PASSWORD, -PW PASSWORD
                        Use this Password instead of cloudgenix_settings.py or
                        prompting
  --insecure, -I        Do not verify SSL certificate
  --noregion, -NR       Ignore Region-based redirection.

Debug:
  These options enable debugging output

  --sdkdebug SDKDEBUG, -D SDKDEBUG
                        Enable SDK Debug output, levels 0-2

edwards-mbp-pro:toolkit_spider aaron$ ./spider_run_plan.py -h
usage: spider_run_plan.py [-h] --plan PLAN --test TEST --output OUTPUT
                          [--connect-timeout CONNECT_TIMEOUT] --toolkit-user
                          TOOLKIT_USER [--toolkit-password TOOLKIT_PASSWORD]

CloudGenix Toolkit Spider Run Plan (v1.0.0)

optional arguments:
  -h, --help            show this help message and exit

Run:
  Execute a previously built Toolkit Spider plan.

  --plan PLAN, -P PLAN  Plan (CSV) to run
  --test TEST, -T TEST  Test (json) to load and run on Plan
  --output OUTPUT, -O OUTPUT
                        Output to filename.
  --connect-timeout CONNECT_TIMEOUT, -CT CONNECT_TIMEOUT
                        Timeout for connect to run tests (seconds, default 5)
  --toolkit-user TOOLKIT_USER, -U TOOLKIT_USER
                        Toolkit username
  --toolkit-password TOOLKIT_PASSWORD, -PW TOOLKIT_PASSWORD
                        Toolkit password (will prompt if not given)
edwards-mbp-pro:toolkit_spider aaron$ 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cloudgenix_toolkit_spider-1.0.0.tar.gz (13.2 kB view details)

Uploaded Source

File details

Details for the file cloudgenix_toolkit_spider-1.0.0.tar.gz.

File metadata

  • Download URL: cloudgenix_toolkit_spider-1.0.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.23.3 CPython/2.7.16

File hashes

Hashes for cloudgenix_toolkit_spider-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7c0e78a25420e6703b0ad769bc105a55e09c0c5de9b5f7e25914ac15598d6647
MD5 8c6ab1da3edbe3883e8da74e74f2b3e9
BLAKE2b-256 c67641d521efc6872260141872714da5da95ca8c131ce0a6374ad4c2b4435ba0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page