Commands APIs
Description – return supported commands that could be executed via web.
Request URL – GET /cablevalidation/commands
Request Content Type – application/json
Status Codes
200 – OK
Response Data Example
{
"load_topo": {"args": {"dns": {"type":"bool","mandatory":false},"files": {"type":"list","mandatory":true},"cluster": {"type":"str","mandatory":false} },"is_async":false},"load_ip": {"args": {"files": {"type":"list","mandatory":true},"cluster": {"type":"str","mandatory":false} },"is_async":false}, …. etc. }
Description – get command help.
Request URL – GET /cablevalidation/commands/<command_name>/help
Request Content Type – application/json
Status Codes
200 – OK
404 – NOT FOUND
Response Data Example - It depends on the CLI command you need to run. The following is an example of running load_ptp
\{
"command":"load_topo","help": \[""," load_topo filename \[dns=true/false\] \[type=topo/dot\] \[cluster=\u003Ccluster name\u003E\] \[servers=true/false\]"," loads a topology file",""," Parameters"," 1. dns \[optional, boolean(true/false), default is true\]:"," if dns=true, hostname will be used to communication, otherwise user have to load IP file."," 2. cluster \[optional, string, default is 'default`\] cluster name."," 3. servers \[optional, boolean(true/false), default varies\]: flag whether to manage agents on servers."," default is true for ETH clusters, not supported for IB clusters."," 4. type \[optional, string(topo/dot), default varies\]"," for IB clusters, the default is `topo`, and for ETH clusters the default is `dot`.",""\] \}
Description – return the status of commands processing, the status is either 'Idle' of 'Executing <cmd_name>' .
Request URL – GET /cablevalidation/commands/status
Request Content Type – application/json
Status Codes
200 – OK
Response Data Example
{
"status":"Idle"or"Executing <cmd_name>"}
Description – processes a Bringup CLI command
Request URL – POST /cablevalidation/commands/<command_name>
Request Content Type – application/json
Status Codes
200 – OK
400 – BAD REQUEST
404 – NOT FOUND
Request Data Example – It depends on the CLI command you need to run. The following is an example of running load_ptp.
{
"file":"/cable_bringup_root/data/uploads/topology/ptp/proton-ptp.xlsx"}
Response – text message e.g. Command 'load_ptp' completed successfully
Description – get the output of the given command name.
Request URL – GET /cablevalidation/commands/<command_name>/output? timestamp=<timestamp>
Request Content Type – application/json
Request Data Example
{
"file":"/cable_bringup_root/data/uploads/topology/ptp/proton-ptp.xlsx"}
Status Codes
200 – OK
404 – NOT FOUND
-
Response \{
"command":"load_ptp","request_ts":0,"last_ts":1732376613333429,"status":"Completed","content": \["Warning: Rack unit mismatch for MQM8700 sw-hdr-proton01: 30, 27","Loaded 1 switches, 2 hosts, 2 links.","Loaded IP addresses of 1 switches/hosts!"\] \}