Showcommand API
In this section we will see how to use the showcommand API. This type of API is used for obtaining an output of regular CLI show commands using API. Most of the show commands present a well structured JSON response.
Syntax for a GET request using cURL to use show commands over API:
curl --insecure -b "aruba-cookie" -X GET -i 'https://<mcr-ip>:4343/v1/configuration/showcommand?command=<show-command>&UIDARUBA=<session-token>'
Note
--insecure or -k option can be used with the cURL command if the certificate of the Mobility Conductor cannot be validated
-b is used to read the cookie from "aruba-cookie" file
-i is used to include protocol headers in the output
Description of user-specific values used in the cURL example
Showcommand API Request
Request URL:
https://:4343/v1/configuration/showcommand
Request Query Params:
command =
UIDARUBA =
Request Method:
GET
Request Headers:
Content-Type: application/json
Accept: application/json
Cookie: SESSION=
Request Payload:
None
Sample response for showcommand API request:
{
"Vlan Status": [
{
"AAA Profile": "N/A",
"Adminstate": "Enabled",
"IPAddress": "111.1.1.1/255.0.0.0",
"Mode": "Regular",
"Nat Inside": "Disabled",
"Operstate": "Up",
"Option-82": "Disabled",
"PortCount": "1",
"Ports": "GE0/0/0",
"VlanId": "198"
}
],
"_meta": [
"VlanId",
"IPAddress",
"Adminstate",
"Operstate",
"PortCount",
"Nat Inside",
"Mode",
"Ports",
"AAA Profile",
"Option-82"
]
}
Note
Most of the showcommand API response will give structured JSON response.
Updated 5 months ago