<style>:root{--highlight-color:#fe9}.flex{display:flex!important}body{line-height:1.5em}#content{padding:20px}#sidebar{padding:1.5em;overflow:hidden}#sidebar>*:last-child{margin-bottom:2cm}.http-server-breadcrumbs{font-size:130%;margin:0015px0}#footer{font-size:.75em;padding:5px30px;border-top:1pxsolid#ddd;text-align:right}#footerp{margin:0001em;display:inline-block}#footerp:last-child{margin-right:30px}h1,h2,h3,h4,h5{font-weight:300}h1{font-size:2.5em;line-height:1.1em}h2{font-size:1.75em;margin:2em0.50em0}h3{font-size:1.4em;margin:1.6em0.7em0}h4{margin:0;font-size:105%}h1:target,h2:target,h3:target,h4:target,h5:target,h6:target{background:var(--highlight-color);padding:.2em0}a{color:#058;text-decoration:none;transition:color.2sease-in-out}a:visited{color:#503}a:hover{color:#b62}.titlecode{font-weight:bold}h2[id^="header-"]{margin-top:2em}.ident{color:#900;font-weight:bold}precode{font-size:.8em;line-height:1.4em;padding:1em;display:block}code{background:#f3f3f3;font-family:"DejaVu Sans Mono",monospace;padding:1px4px;overflow-wrap:break-word}h1code{background:transparent}pre{border-top:1pxsolid#ccc;border-bottom:1pxsolid#ccc;margin:1em0}#http-server-module-list{display:flex;flex-flow:column}#http-server-module-listdiv{display:flex}#http-server-module-listdt{min-width:10%}#http-server-module-listp{margin-top:0}.tocul,#index{list-style-type:none;margin:0;padding:0}#indexcode{background:transparent}#indexh3{border-bottom:1pxsolid#ddd}#indexul{padding:0}#indexh4{margin-top:.6em;font-weight:bold}@media(min-width:200ex){#index.two-column{column-count:2}}@media(min-width:300ex){#index.two-column{column-count:3}}dl{margin-bottom:2em}dldl:last-child{margin-bottom:4em}dd{margin:001em3em}#header-classes+dl>dd{margin-bottom:3em}dddd{margin-left:2em}ddp{margin:10px0}.name{background:#eee;font-size:.85em;padding:5px10px;display:inline-block;min-width:40%}.name:hover{background:#e0e0e0}dt:target.name{background:var(--highlight-color)}.name>span:first-child{white-space:nowrap}.name.class>span:nth-child(2){margin-left:.4em}.inherited{color:#999;border-left:5pxsolid#eee;padding-left:1em}.inheritanceem{font-style:normal;font-weight:bold}.desch2{font-weight:400;font-size:1.25em}.desch3{font-size:1em}.descdtcode{background:inherit}.source>summary,.git-link-div{color:#666;text-align:right;font-weight:400;font-size:.8em;text-transform:uppercase}.sourcesummary>*{white-space:nowrap;cursor:pointer}.git-link{color:inherit;margin-left:1em}.sourcepre{max-height:500px;overflow:auto;margin:0}.sourceprecode{font-size:12px;overflow:visible;min-width:max-content}.hlist{list-style:none}.hlistli{display:inline}.hlistli:after{content:',\2002'}.hlistli:last-child:after{content:none}.hlist.hlist{display:inline;padding-left:1em}img{max-width:100%}td{padding:0.5em}.admonition{padding:.1em1em;margin:1em0}.admonition-title{font-weight:bold}.admonition.note,.admonition.info,.admonition.important{background:#aef}.admonition.todo,.admonition.versionadded,.admonition.tip,.admonition.hint{background:#dfd}.admonition.warning,.admonition.versionchanged,.admonition.deprecated{background:#fd4}.admonition.error,.admonition.danger,.admonition.caution{background:lightpink}</style>
<stylemedia="screen and (min-width: 700px)">@mediascreenand(min-width:700px){#sidebar{width:30%;height:100vh;overflow:auto;position:sticky;top:0}#content{width:70%;max-width:100ch;padding:3em4em;border-left:1pxsolid#ddd}precode{font-size:1em}.name{font-size:1em}main{display:flex;flex-direction:row-reverse;justify-content:flex-end}.toculul,#indexulul{padding-left:1em}.toc>ul>li{margin-top:.5em}}</style>
return "node\[@subfolder]\[@folder]\nConnect to specific node or show all matching nodes\n\[@subfolder]\[@folder]\nShow all available connections globally or in specified path"
if type == "usage":
commands = []
for subcommand, subparser in parsers.choices.items():
return "node[@subfolder][@folder] commmand to run\nRun the specific command on the node and print output\n/path/to/file.yaml\nUse a yaml file to run an automation script"
if type == "generate":
return r'''---
tasks:
- name: "Config"
action: 'run' #Action can be test or run. Mandatory
nodes: #List of nodes to work on. Mandatory
- 'router1@office' #You can add specific nodes
- '@aws' #entire folders or subfolders
- '@office': #or filter inside a folder or subfolder
- 'router2'
- 'router7'
commands: #List of commands to send, use {name} to pass variables
variables: #Variables to use on commands and expected. Optional
__global__: #Global variables to use on all nodes, fallback if missing in the node.
commit: ''
if: 'loopback100'
router1@office:
id: 1
router2@office:
id: 2
commit: 'commit'
router3@office:
id: 3
vrouter1@aws:
id: 4
vrouterN@aws:
id: 5
output: /home/user/logs #Type of output, if null you only get Connection and test result. Choices are: null,stdout,/path/to/folder. Folder path only works on 'run' action.
options:
prompt: r'>$|#$|\$$|>.$|#.$|\$.$' #Optional prompt to check on your devices, default should work on most devices.
parallel: 10 #Optional number of nodes to run commands on parallel. Default 10.
timeout: 20 #Optional time to wait in seconds for prompt, expected or EOF. Default 20.
- name: "TestConfig"
action: 'test'
nodes:
- 'router1@office'
- '@aws'
- '@office':
- 'router2'
- 'router7'
commands:
- 'ping 10.100.100.{id}'
expected: '!' #Expected text to find when running test action. Mandatory for 'test'