Reflections on /console/inspect…
If you start at request= you get the gist of what’s possible:
/console/inspect request=
child completion error highlight self syntax
In request=syntax, path= needs to be set. So the main trick is path= is CLI list… The logic is “metadata”/information about commands, not actually commands, so you need commas in path= as that’s how the CLI takes a list.
So to get the options for /ip/address, it looks like:
/console/inspect request=syntax path=ip,address
Columns: TYPE, SYMBOL, SYMBOL-TYPE, NESTED, NONORM, TEXT
TYPE SYMBOL SYMBOL-TYPE N NON TEXT
syntax collection 0 yes
syntax .. explanation 1 no go up to ip
syntax add explanation 1 no Create a new item
syntax comment explanation 1 no Set comment for items
syntax disable explanation 1 no Disable items
syntax edit explanation 1 no
syntax enable explanation 1 no Enable items
syntax export explanation 1 no Print or save an export script that can be used to restore configuration
syntax find explanation 1 no Find items by value
syntax get explanation 1 no Gets value of item's property
syntax print explanation 1 no Print values of item properties
syntax remove explanation 1 no Remove item
syntax reset explanation 1 no
syntax set explanation 1 no Change item properties
And you can the properties by adding a “/set” to the path (again using commas):
/console/inspect request=syntax path=ip,address,add
Columns: TYPE, SYMBOL, SYMBOL-TYPE, NESTED, NONORM, TEXT
TYPE SYMBOL SYMBOL-TYPE NESTED NONORM TEXT
syntax collection 0 yes
syntax address explanation 1 no Local IP address
syntax broadcast explanation 1 no Broadcast address
syntax comment explanation 1 no Short description of the item
syntax copy-from explanation 1 no Item number
syntax disabled explanation 1 no Defines whether item is ignored or used
syntax interface explanation 1 no Interface name
syntax netmask explanation 1 no Network mask
syntax network explanation 1 no Network prefix
There are few more request= things too. The main one is request=child – this one is useful to know what the “command tree” looks like – that the one used in the larger script to export an abstractly, an AST (“abstract syntax tree”). Again it use the path= with CLI list formatting…
So with no path=, it’s the top of the tree. If the “type” is “child”, it means there might be children in AST request=child tree, and you use “name” in the another call to /console/inspect with that child name appended in “path=”.
/console/inspect request=child
Columns: TYPE, NAME, NODE-TYPE
TYPE NAME NODE-TYPE
self root path
child beep cmd
child blink cmd
child certificate dir
child console dir
child container dir
child convert cmd
child delay cmd
child disk dir
child do cmd
child dude dir
child environment dir
child error cmd
child execute cmd
child file path
child find cmd
child for cmd
child foreach cmd
child global cmd
child if cmd
child import cmd
child interface path
/console/inspect request=child path=ip,address
Columns: TYPE, NAME, NODE-TYPE
TYPE NAME NODE-TYPE
self address dir
child add cmd
child comment cmd
child disable cmd
child edit cmd
child enable cmd
child export cmd
child find cmd
child get cmd
child print cmd
child remove cmd
child reset cmd
child set cmd
/console/inspect request=child path=ip,address,set
Columns: TYPE, NAME, NODE-TYPE
TYPE NAME NODE-TYPE
self set cmd
child address arg
child broadcast arg
child comment arg
child disabled arg
child interface arg
child netmask arg
child network arg
child numbers arg
request=self but largely same request=child…
/console/inspect request=self path=ip
Columns: TYPE, NAME, NODE-TYPE
TYPE NAME NODE-TYPE
self ip path
child address dir
child arp dir
child cloud dir
child dhcp-client dir
child dhcp-relay dir
child dhcp-server dir
child dns dir
child firewall dir
child hotspot dir
child ipsec dir
child kid-control dir
child neighbor dir
child packing dir
child pool dir
child proxy dir
child route dir
child service dir
child settings dir
child smb dir
child socks dir
child ssh dir
child tftp dir
child traffic-flow dir
child upnp dir
child vrf dir
child export cmd
Another one is request=completion. This using “input=” as a proxy for what someone would type at the command line. So if we want to know what options /console/inspect ITSELF offered for the request=… the following get same list as top of this post:
/console/inspect request=completion input="/console/inspect request="
Columns: TYPE, COMPLETION, STYLE, OFFSET, PREFERENCE, SHOW, TEXT
TYPE COMPLETION STYLE OFFSET PREFERENCE SHOW TEXT
completion none 25 -1 no whitespace
completion none 25 64 no
completion [ syntax-meta 25 75 no start of command substitution
completion ( syntax-meta 25 75 no start of expression
completion $ syntax-meta 25 75 no substitution
completion " syntax-meta 25 75 no start of quoted string
completion self none 25 96 yes
completion child none 25 96 yes
completion completion none 25 96 yes
completion highlight none 25 96 yes
completion syntax none 25 96 yes
completion error none 25 96 yes
Some more examples of request=completion …
/console/inspect request=completion input="/ip/add"
Columns: TYPE, COMPLETION, STYLE, OFFSET, PREFERENCE, SHOW, TEXT
TYPE COMPLETION STYLE OFFSET PREFERENCE SHOW TEXT
completion address dir 4 96 yes Address management
completion / dir 7 95 yes top of command hierarchy
completion none 7 -1 no whitespace
completion { syntax-meta 7 40 no start of command block
completion ; syntax-meta 7 40 no end of command
/console/inspect request=completion input="/ip/addr/set "
Columns: TYPE, COMPLETION, STYLE, OFFSET, PREFERENCE, SHOW, TEXT
TYPE COMPLETION STYLE OFFSET PREFERENCE SHOW TEXT
completion ! none 13 80 no whitespace
completion address arg 13 96 yes Local IP address
completion broadcast arg 13 95 yes Broadcast address
completion comment arg 13 96 yes Short description of the item
completion disabled arg 13 96 yes Defines whether item is ignored or used
completion interface arg 13 96 yes Interface name
completion netmask arg 13 95 yes Network mask
completion network arg 13 96 yes Network prefix
completion numbers arg 13 96 yes List of item numbers
completion none 13 64 no
completion [ syntax-meta 13 75 no start of command substitution
completion ( syntax-meta 13 75 no start of expression
completion $ syntax-meta 13 75 no substitution
completion " syntax-meta 13 75 no start of quoted string
completion * none 13 -1 no id prefix
completion <number> none 13 -1 no decimal number
/console/inspect request=completion input="set" path=ip,address
Columns: TYPE, COMPLETION, STYLE, OFFSET, PREFERENCE, SHOW, TEXT
TYPE COMPLETION STYLE OFFSET PREFERENCE SHOW TEXT
completion set cmd 0 96 yes Change item properties
completion none 3 80 no whitespace
completion ; syntax-meta 3 40 no end of command
/console/inspect request=completion still support a path=, in additional the require input=. path= reflects what “directory” the CLI is at (e.g. similar to typing /ip/address and then doing “set” in a new line). So you can see input is a space " ", which is kinda weird, but your looking for command completion here…
/console/inspect request=completion input=" " path=ip,address,set
Columns: TYPE, COMPLETION, STYLE, OFFSET, PREFERENCE, SHOW, TEXT
TYPE COMPLETION STYLE OFFSET PREFERENCE SHOW TEXT
completion ! none 1 80 no whitespace
completion address arg 1 96 yes Local IP address
completion broadcast arg 1 95 yes Broadcast address
completion comment arg 1 96 yes Short description of the item
completion disabled arg 1 96 yes Defines whether item is ignored or used
completion interface arg 1 96 yes Interface name
completion netmask arg 1 95 yes Network mask
completion network arg 1 96 yes Network prefix
completion numbers arg 1 96 yes List of item numbers
completion none 1 64 no
completion [ syntax-meta 1 75 no start of command substitution
completion ( syntax-meta 1 75 no start of expression
completion $ syntax-meta 1 75 no substitution
completion " syntax-meta 1 75 no start of quoted string
completion * none 1 -1 no id prefix
completion <number> none 1 -1 no decimal number
I never really messed with request=highlight but gets the syntax formatting using similar path= and input= scheme as rest… And request=error – I don’t know how it works.
All the /console/inspect things support an “as-value” to store array with data to a variable, but I skipped that since it easier to cut-and-paste without it here.