Skip to content

Commands | Topology Syntax Guide

mike edited this page Oct 26, 2019 · 1 revision

Commands are run on nodes, can be associated with applications, and have the option to be inherited to templated topologies. Commands can additionally be declared within the node declaration (see here).

#...
commands: #commands default to inherited unless inherit tag specified
  node1: echo this is a good command
  node2:
    - echo command 1 #commands to be run in sequence
    - echo command 2
  node1:
    iperf3: tail iperf3.log # command associated with application iperf3

Inheritance is slightly different for commands than for applications. Commands associated with an application are dependent upon both the command's inheritance and the inheritance of the application. The application's inheritance value takes precedence over the command's inheritance value; if the application is not inherited, neither will the command be inherited. However, if a command is set to not be inherited, but an application is, then, upon inheritance, the application will remain but the associated command will not.

Note that there may be multiple usages of a node name so as to specify inherited or application commands separately from normal commands.

Inheritance is declared differently for commands than applications. While commands default to be inherited, adding the 'inherit' tag as a map key within the 'commands' tag will default the underlying commands with inheritance being true, while all other commands (not under the inherit node) will have inherit set to false. Here is an example:

#...
commands:
  inherit: #root node for all inherited commands
    node1: command1
    node2:
      iperf3: iperf3 -run
  node2: echo hello # commands outside of inherit node are not inherited