Service Manual
REST API Framework to Execute the
CLIs
REST CLI is an alternative approach for Telnet and SSH to send the Dell Networking OS commands to the
system.
The command is sent as an XML payload and the corresponding command output or error message returns
in an unstructured format in the XML response. There are three sets of XML commands:
• config-commands — to send the configuration commands to the system. Commands with
submodes are allowed within a single XML tag by using the separator
\r\n.
• show-command — to send the show commands to the system. The keyword show is not required
explicitly in the tag (for example, for show version, use version).
• exec-command — to configure the exec commands on the system.
NOTE: Interactive CLIs (for example, clear counters, reload, and so on) are not supported via the
REST API framework. Also, the commands sent in XML payload are restricted to a maximum of 1000
characters length.
To execute REST-CLI on the device, the HTTP username and password needs the appropriate privilege. The
REST-CLI request returns HTTP/1.1 200 OK on a successful completion. All the other HTTP error codes are
treated as failure. Multiple command tags are not allowed inside the <input> tag.
The tree structure of the REST CLI is as follows:
module: dell
+--rw dell?
|
+--ro cli
+--ro input
| +--ro config-commands? string
| +--ro show-command? dell:show-cmd-str
| +--ro exec-command? dell:cli-cmd-str
+--ro output
+--ro command string
Samples of the config-command
Following is the sample output of CONFIG command:
To configure an IP address:
Input.xml:
<input>
<config-commands>
interface vlan 100\r\n
ip address 1.2.3.4/24
</config-commands>
</input>
curl -u demo:demo -X POST -T Input.xml http://<IP>:8008
/api/running/dell/
_operations/cli
REST API 221