The system allows you to define command blocks following a certain format rule in the driver definition to retrieve live data.

For example, this is a command block to retrieve route tables with multiple VRF instances.

CommandBlock::[["su $vrfName", ["BR-K6-Albright-G27(su-secure)>", "show ip route"], 
["regex:\s\S+>", "Y"], ["regex:\s\S+>", ""]]]

The following table explains the format rule in detail:

Command Block Element


CommandBlock::[[  ]]

Precursor string, indicating the following content is a command block (JSON array).

“su $vrfName”

The first command in a command block, which is also the only one that will be issued without any conditions.

["BR-K6-Albright-G27(su-secure)>", "show ip route"]

["regex:\s\S+>", "Y"]

["regex:\s\S+>", ""]

Command pairs, including the expected prompt and responsive command. Multiple string pairs can be attached in a command block.

Tips: Regular expression can be used to define an expected prompt. The Ctrl + C keys and whitespace can be used to define a responsive command.