Package: cloudgenix-toolkit-spider
CloudGenix Toolkit SpiderSynopsisUtility to run commands/tests across large number of CloudGenix Toolkit instances.FeaturesEarly 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 includedazurelatency.jsonfor example) against previously created "Plan".RequirementsActive CloudGenix AccountPython >= 2.7 or >=3.6Python modules:CloudGenix Python SDK >= 5.1.1b1 -https://github.com/CloudGenix/sdk-pythonProgresBar2 >= 3.34.3 -https://github.com/WoLpH/python-progressbarTabulate >= 0.8.3 -https://bitbucket.org/astanin/python-tabulateNetmiko (developbranch as of 06/07/2019 for CloudGenix ION Support.)LicenseMITInstallation:PIP:pip install cloudgenix-toolkit-spider. After install,spider_build_planorspider_run_plan.Github:Download files to a local directory, manually runspider_build_plan.pyorspider_run_plan.pyscripts.Examples of usage: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_spideraaron$exportAUTH_TOKEN=`catauth_token`edwards-mbp-pro:toolkit_spideraaron$./spider_build_plan.py--connect-interfaces"Controller 1,Controller"--test-interfaces"Internet 1,Internet 2,1,2"--outputtest_plan.csv
BuildingToolkitSpiderconnectplan..100%|######################################################################################################################################################################|Time:  0:00:01TestingToolkitSpiderconnectinterfaces..100%|######################################################################################################################################################################|Time:  0:02:00edwards-mbp-pro:toolkit_spideraaron$Execute the previous created test plan to do an Azure DC latency test.edwards-mbp-pro:toolkit_spideraaron$./spider_run_plan.py--plan./test_plan.csv--test./azurelatency.json--outputtest_results.csv-Utoolkituser
Password:RunningToolkitSpiderPlan..100%|######################################################################################################################################################################|Time:  0:01:00edwards-mbp-pro:toolkit_spideraaron$Caveats and known issues:Need latestdevelopbranch of Netmiko, until release with CloudGenix ION support.Only one test supported today: tcpingTODO need to add multiprocessing, script currently runs all tests in serial.Script is early access, needs lots of cleanup.VersionVersionBuildChanges1.0.0b1Initial Release.Command line helpedwards-mbp-pro:toolkit_spideraaron$./spider_build_plan.py-h
usage:spider_build_plan.py[-h][--site-keySITE_KEY][--element-keyELEMENT_KEY][--site-patternSITE_PATTERN][--element-patternELEMENT_PATTERN]--outputOUTPUT--connect-interfacesCONNECT_INTERFACES--test-interfacesTEST_INTERFACES[--connect-timeoutCONNECT_TIMEOUT][--controllerCONTROLLER][--emailEMAIL][--passwordPASSWORD][--insecure][--noregion][--sdkdebugSDKDEBUG]CloudGenixToolkitSpiderBuildPlan(v1.0.0)optionalarguments:-h,--helpshowthishelpmessageandexitBuild:Createamap/planfortheToolkitSpideraction.--site-keySITE_KEY,-SKSITE_KEYKeyinSiteobjecttouseforinclusion.Default'name'--element-keyELEMENT_KEY,-EKELEMENT_KEYKeyinElementobjecttouseforinclusion.Default'name'--site-patternSITE_PATTERN,-SPSITE_PATTERNREGEXPatterntomatchSiteObjectwithforinclusion.Default'.*'--element-patternELEMENT_PATTERN,-EPELEMENT_PATTERNREGEXPatterntomatchElementObjectwithforinclusion.Default'.*'--outputOUTPUTOutputtofilename.--connect-interfacesCONNECT_INTERFACES,-CICONNECT_INTERFACESCommaseparatedlistofinterfacetouseasoptionstoconnectviaSSHtorunthetest,ifavailable.--test-interfacesTEST_INTERFACES,-TITEST_INTERFACESCommaseparatedlistofinterfacetorunthetestFROM,ifavailable--connect-timeoutCONNECT_TIMEOUT,-CTCONNECT_TIMEOUTTimeoutforconnectinterfacereachabilitytest(seconds,default5)API:TheseoptionschangehowthisprogramconnectstotheAPI.--controllerCONTROLLER,-CCONTROLLERControllerURI,ex.https://api.elcapitan.cloudgenix.com

Login:Theseoptionsallowskippingofinteractivelogin--emailEMAIL,-EEMAILUsethisemailasUserNameinsteadofcloudgenix_settings.pyorprompting--passwordPASSWORD,-PWPASSWORDUsethisPasswordinsteadofcloudgenix_settings.pyorprompting--insecure,-IDonotverifySSLcertificate--noregion,-NRIgnoreRegion-basedredirection.

Debug:Theseoptionsenabledebuggingoutput--sdkdebugSDKDEBUG,-DSDKDEBUGEnableSDKDebugoutput,levels0-2

edwards-mbp-pro:toolkit_spideraaron$./spider_run_plan.py-h
usage:spider_run_plan.py[-h]--planPLAN--testTEST--outputOUTPUT[--connect-timeoutCONNECT_TIMEOUT]--toolkit-userTOOLKIT_USER[--toolkit-passwordTOOLKIT_PASSWORD]CloudGenixToolkitSpiderRunPlan(v1.0.0)optionalarguments:-h,--helpshowthishelpmessageandexitRun:ExecuteapreviouslybuiltToolkitSpiderplan.--planPLAN,-PPLANPlan(CSV)torun--testTEST,-TTESTTest(json)toloadandrunonPlan--outputOUTPUT,-OOUTPUTOutputtofilename.--connect-timeoutCONNECT_TIMEOUT,-CTCONNECT_TIMEOUTTimeoutforconnecttoruntests(seconds,default5)--toolkit-userTOOLKIT_USER,-UTOOLKIT_USERToolkitusername--toolkit-passwordTOOLKIT_PASSWORD,-PWTOOLKIT_PASSWORDToolkitpassword(willpromptifnotgiven)edwards-mbp-pro:toolkit_spideraaron$