The CLI mode, linux_command_line allows the user to interact with the CLI similar to a traditional Linux command line program, where all the arguments are presented in --parameter value format. Multi-line configuration of object uses a Bash heredoc style.

The CLI enhancements are introduced with the following considerations:

  • Easy automation using the CLI

  • Search for specific keywords in the configuration using the CLI

  • Quick cut-and-paste to make modifications or resolve some issues with the CLI

In the linux_command_line mode, the entire object is presented in the form of --parameter value, where each parameter represents a field in the object specified in a fully qualified path. An example of this is:

IP address of a server in a pool is specified as --servers.index.ip. This is equivalent to referring to this attribute as pool[‘servers’][index][‘ip’].

terminal mode linux_command_line
terminal --linux_cmd_output single_line
show pool p2
--uuid pool-b0cb56dc-cc24-4b87-9d19-7bf790d2e582 --default_server_port 80 --graceful_disable_timeout 1 --connection_ramp_duration 10 --max_concurrent_connections_per_server 0 --servers.1.ip 1.1.1.1 --servers.1.hostname 1.1.1.1 --servers.1.enabled True --servers.1.ratio 1 --servers.1.verify_network False --servers.1.resolve_server_by_dns False --servers.1.static False --servers.1.rewrite_host_header False --servers.2.ip 2.2.2.2 --servers.2.hostname 2.2.2.2 --servers.2.enabled True --servers.2.ratio 1 --servers.2.verify_network False --servers.2.resolve_server_by_dns False --servers.2.static False --servers.2.rewrite_host_header False --servers.3.ip 3.3.3.3 --servers.3.hostname 3.3.3.3 --servers.3.enabled True --servers.3.ratio 1 --servers.3.verify_network False --servers.3.resolve_server_by_dns False --servers.3.static False --servers.3.rewrite_host_header False --server_count 3 --lb_algorithm lb_algorithm_least_connections --inline_health_monitor True --use_service_port False --capacity_estimation False --server_auto_scale False --vrf_ref global --fewest_tasks_feedback_delay 10 --enabled True --request_queue_enabled False --request_queue_depth 128 --host_check_enabled False --sni_enabled True --rewrite_host_header_to_sni False --rewrite_host_header_to_server_name False --tenant_ref admin --cloud_ref Default-Cloud
Note:

The index starts with 1 in the CLI but is converted to 0 based on the API interactions.

Configure using the Linux Command Line Mode

configure pool p2 --uuid pool-7fce112f-c340-4c31-8c65-95e52f4b85ba --servers.1.ip 3.3.3.3 --servers.1.hostname 3.3.3.3 --servers.2.ip 2.2.2.2 --servers.2.hostname 2.2.2.2 --servers.3.ip 1.1.1.1 --servers.3.hostname 1.1.1.1 --servers.4.ip 4.4.4.4 --servers.4.hostname 4.4.4.4 --server_count 4 --tenant_ref admin
Updating an existing object.
p2 --uuid pool-7fce112f-c340-4c31-8c65-95e52f4b85ba --servers.1.ip 3.3.3.3 --servers.1.hostname 3.3.3.3 --servers.2.ip 2.2.2.2 --servers.2.hostname 2.2.2.2 --servers.3.ip 1.1.1.1 --servers.3.hostname 1.1.1.1 --servers.4.ip 4.4.4.4 --servers.4.hostname 4.4.4.4 --server_count 4 --tenant_ref admin

Some objects are relatively large, so interacting with the CLI with all these parameters specified in a single line becomes cumbersome. To address this, use multi_line, the CLI setting to change the Linux command output. This enables the CLI interaction one parameter per line.

Consider the example given below:

terminal --linux_cmd_output multi_line

show pool p2
--uuid pool-7fce112f-c340-4c31-8c65-95e52f4b85ba
--servers.1.ip 3.3.3.3
--servers.1.hostname 3.3.3.3
--servers.2.ip 2.2.2.2
--servers.2.hostname 2.2.2.2
--servers.3.ip 1.1.1.1
--servers.3.hostname 1.1.1.1
--server_count 3
--tenant_ref admin

configure pool p2 << END
--uuid pool-7fce112f-c340-4c31-8c65-95e52f4b85ba
--servers.1.ip 3.3.3.3
--servers.1.hostname 3.3.3.3
--servers.2.ip 2.2.2.2
--servers.2.hostname 2.2.2.2
--servers.3.ip 1.1.1.1
--servers.3.hostname 1.1.1.1
--servers.4.ip 4.4.4.4
--servers.4.hostname 4.4.4.4
--tenant_ref admin
END

Updating an existing object.
--uuid pool-7fce112f-c340-4c31-8c65-95e52f4b85ba
--servers.1.ip 3.3.3.3
--servers.1.hostname 3.3.3.3
--servers.2.ip 2.2.2.2
--servers.2.hostname 2.2.2.2
--servers.3.ip 1.1.1.1
--servers.3.hostname 1.1.1.1
--servers.4.ip 4.4.4.4
--servers.4.hostname 4.4.4.4
--server_count 4
--tenant_ref admin