Commands APIs
Description – Returns supported commands that could be executed via web.
Request URL –
GET /cablevalidation/commandsResponse 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 – Gets command help.
Request URL –
GET /cablevalidation/commands/<command_name>/helpResponse 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=<cluster name>] [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 – Returns the status of commands processing, the status is either 'Idle' of 'Executing <cmd_name>' .
Request URL –
GET /cablevalidation/commands/statusResponse 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 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 Content Type – application/json
Status Codes
200 – OK
400 – BAD REQUEST
404 – NOT FOUND
Response – text message e.g. Command 'load_ptp' completed successfully
Description – Gets the output of the given command name.
Request URL –
GET /cablevalidation/commands/<command_name>/output?timestamp=<timestamp>Response Content Type – application/json
Status Codes
200 – OK
404 – NOT FOUND
Response Data Example
{
"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!"] }