Package: centralcli
Aruba Central API CLIA CLI app for interacting with Aruba Central Cloud Management Platform. With cross-platform shell support. Auto Completion, easy device/site/group/template identification (fuzzy match), support for batch import, and a lot more.As commands are built out the CLI hierarchy may evolve.  Refer to thedocumentationor help text for CLI structure/syntax.FeaturesCross Platform SupportAuto/TAB CompletionSpecify device, site, etc. by fuzzy match of multiple fields (i.e. name, mac, serial#, ip address)Multiple output formatsOutput to fileNumerous import formats (csv, yaml, json, xls, etc.)Multiple account support (easily switch between different central accounts--account myotheraccount)Batch Operation based on data from input file.  i.e. Add sites in batch based on data from a csv.Automatic Token refresh.  With prompt to paste in a new token if it becomes invalid.If using Tokens, dedicate the token to the CLI alone, using it in swagger or on another system, will eventually lead to a refresh that invalidates the tokens on the other systems using it.You can also use username/Password Auth. which will facilitate automatic retrieval of new Tokens even if they do become invalid.InstallationRequires python 3.7+ and pippip3 install centralcliYou can also install in a virtual environment (venv), but you'll lose auto-completion, unless you activate the venv.Upgrading the CLIpip3 install -U centralcliif you don't have pythonYou can get it for any platform @https://www.python.orgOn Windows 10 it's also available in the Windows store.ConfigurationRefer toconfig.yaml.exampleto guide in the creation of config.yaml and place in the config directory.CentralCli will look in <Users home dir>/.config/centralcli, and <Users home dir>\.centralcli.
i.e. on Windowsc:\Users\wade\.centralclior on Linux/home/wade/.config/centralcliOnceconfig.yamlis populated perconfig.yaml.example, run some test commands to validate the config.For Examplecencli show allwade@wellswa6:~$cenclishowallAllDevices─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────nametypemodelipmacserialgroupsitelabelsversionstatus─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────6100F-48-LABcx610048GCL44SFP+Swch10.0.40.11--redacted----redacted--WadeLab8x10.08.1010Down(JL675A)SDBranch1:7008gwA7008192.168.240.101--redacted----redacted--Branch1AntiguaBranchView10.3.0.0_82528Upbr1-2930F-swswAruba2930F-8G-PoE+-2SFP+10.101.5.4--redacted----redacted--Branch1AntiguaBranchView16.11.0002UpSwitch(JL258A)br1-315.0c88-apap31510.101.6.200--redacted----redacted--Branch1AntiguaBranchView10.3.0.0_82528UpMB1-505hap505H10.10.1.101--redacted----redacted--MicroBranch1ChampionsHill10.3.0.0_82528Up6200F-Botcx6200F48GCL44SFP+740WSwch10.0.40.16--redacted----redacted--WadeLab8xPommore10.08.1010Down(JL728A)6200F-Topcx6200F48GCL44SFP+740WSwch10.0.40.6--redacted----redacted--WadeLab8xPommore10.08.1010Down(JL728A)APGW1gwA9004-LTE10.0.35.10--redacted----redacted--WLNETWadeLab10.3.0.0_82528UpAPGW2gwA900410.0.35.20--redacted----redacted--WLNETWadeLab10.3.0.0_82528UpVPNC1gwA7005172.30.0.242--redacted----redacted--VPNCWadeLabBranchView10.3.0.0_82528UpVPNC2gwA7005172.30.0.243--redacted----redacted--VPNCWadeLabBranchView10.3.0.0_82528Upav-555.11b8-apap55510.0.31.155--redacted----redacted--WLNETWadeLab10.3.0.0_82463Downbarn-303p.2c30-apap303P10.1.30.151--redacted----redacted--WLNETWadeLab10.3.0.0_82528Upbarn-4100icx4100i12GCL4/6POE2SFP+DIN10.1.30.152--redacted----redacted--WadeLabWadeLab10.08.1010UpSw(JL817A)barn-518.2816-apap51810.1.30.101--redacted----redacted--WLNETWadeLab10.3.0.0_82528Upbsmt-515.51s9-apap51510.0.30.233--redacted----redacted--WLNETWadeLab10.3.0.0_82463Downcraft-2930FswAruba2930F-8G-PoE+-2SFP+10.0.30.5--redacted----redacted--WadeLabWadeLab16.11.0002UpSwitch(JL258A)garage-345.5136-apap34510.0.31.148--redacted----redacted--WLNETWadeLab10.3.0.0_82463Downktcn-505H.206c-apap505H10.0.30.212--redacted----redacted--WLNETWadeLab10.3.0.0_82463Downlwrptio-575.0824-apap57510.0.30.219--redacted----redacted--WLNETWadeLab10.3.0.0_82463Downzrm-535.70be-apap53510.0.31.101--redacted----redacted--WLNETWadeLab10.3.0.0_82463Down─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────Showalldisplaysfieldscommontoalldevicetypes.Toseeallcolumnsforagivendevicetypeuseshow<DEVICETYPE>APIRateLimit:925of1000remaining.Usecencli ?to become familiar with the command options.Auto CompletionThe CLI supports auto-completion.  To configure auto-completion runcencli --install-completion.  This will auto-detect the type of shell you are running in, and install the necessary completion into your profile.  You'll need to exit the shell and start a new session for it to take effect.Note for OSX 11: Additional step, edit .zshrc and add "autoload -Uz compinit && compinit -i" then exit and start new session.Usage NotesCaching & Friendly identifiersCaching: The CLI caches information on all devices, sites, groups, and templates in Central.  It's a minimal amount per device, and is done to allow human friendly identifiers.  The API typically accepts serial #, site id, etc.  This function allows you to specify a device by name, IP, mac (any format), and serial.The lookup sequence for a device:Exact Match of any of the identifier fields (name, ip, mac, serial)case insensitive matchcase insensitive match disregarding all hyphens and underscores (in case you type 6200f_bot and the device name is 6200F-Bot)Case insensitive Fuzzy match with implied wild-card, otherwise match any devices that start with the identifier provided.cencli show switches 6200Fwill result in a match of6200F-Bot.If there is no match found, a cache update is triggered, and the match rules are re-tried.Caching works in a similar manner for groups, templates, and sites.  Sites can match on name and nearly any address field.  So if you only had one site in San Antonio you could specify that site withshow sites 'San Antonio'<-- Note the use of quotes because there is a space in the name.Multiple Matches:  It's possible to specify an identifier that returns multiple matches (if drops all the way down to the Fuzzy match/implied trailing wild-card).  If that occurs you are prompted to select the intended device from a list of the matches.Output FormatsThere are a number of output formats available.  Most commands default to what is likely the easiest to view given the number of fields.  Otherwise longer outputs are typically displayed vertically by default.  If the output can reasonably fit, it's displayed in tabular format horizontally.You can specify the output format with command line flags--json,--yaml,--csv,--tablerich is tabular format with folding (multi line within the same row) and truncating.Most outputs will evolve to support an output with the most commonly desired fields by default and expanded vertical output via the-voption (not implemented yet.).  Currently the output is tabular horizontally if the amount of data is likely to fit most displays, and vertical otherwise.File OutputJust use--out \<filename\>(or <path\filename>), and specify the desired format.CLI TreeUse?or--helpfrom the cli, which you can do at any level.ccenli ?,cencli bounce --helpetc.You can also see the entire supported tree via theCLI Reference Guide.NOTE: The Reference Guide documents a few commands that are hidden in the CLI