In script mode, the input and output of the CLI command are expected to be in YAML format. This is a direct conversion of what is presented in the API input and output as JSON into YAML.

YAML was chosen for presentation as it allows an easier interaction without having to consider issues about the syntax such as commas, quotes, curly braces, and so on. It is easier to work with YAML primarily for cut-and-paste and incremental changes to an existing object. Multi-line configuration of object uses a Bash heredoc style. You can find more information on this under https://en.wikipedia.org/wiki/Here_document.

terminal mode script
show pool p1
name: p1
server_count: 3
servers:
- hostname: 1.1.1.1
ip:
addr: 1.1.1.1
type: V4
- hostname: 2.2.2.2
ip:
addr: 2.2.2.2
type: V4
tenant_ref: https://localhost/api/tenant/admin
uuid: pool-b0cb56dc-cc24-4b87-9d19-7bf790d2e582

Configure a Pool using the Script Mode

configure pool p1 << END
name: p1
server_count: 3
servers:
- hostname: 1.1.1.1
ip:
addr: 1.1.1.1
type: V4
- hostname: 2.2.2.2
ip:
addr: 2.2.2.2
type: V4
- hostname: 3.3.3.3
ip:
addr: 3.3.3.3
type: V4
tenant_ref: https://localhost/api/tenant/admin
uuid: pool-b0cb56dc-cc24-4b87-9d19-7bf790d2e582
END
Updating an existing object
name: p1
server_count: 3
servers:
- hostname: 1.1.1.1
ip:
addr: 1.1.1.1
type: V4
- hostname: 2.2.2.2
ip:
addr: 2.2.2.2
type: V4
- hostname: 3.3.3.3
ip:
addr: 3.3.3.3
type: V4
tenant_ref: https://localhost/api/tenant/admin
uuid: pool-b0cb56dc-cc24-4b87-9d19-7bf790d2e582