CLI Guide

}
]
In a script, each command should check the previous command’s status before proceeding. If the value of the status object’s return-
code property is 0, the command succeeded; any other value means that the command failed.
NOTE: If you script an operation to repeatedly add and remove disk groups, set a delay of at least two minutes between
deleting a disk group and creating the next one.
Example command input and API output
The following example shows a command formatted for use with the command-line interface, the same command formatted for use with
the HTTPS interface, and command output in the XML and JSON APIs.
Command-line interface format: create user JSmith interfaces wbi password Abc#1379
HTTPS interface format: create/user/JSmith/interfaces/wbi/password/Abc#1379
XML API output:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<RESPONSE VERSION="L100">
<OBJECT basetype="status" name="status" oid="1">
<PROPERTY name="response-type" type="string" size="12" draw="false" sort="nosort"
display-name="Response Type">Success</PROPERTY>
<PROPERTY name="response-type-numeric" type="uint32" size="12" draw="false" sort="nosort"
display-name="Response Type">0</PROPERTY>
<PROPERTY name="response" type="string" size="180" draw="true" sort="nosort"
display-name="Response">Command completed successfully. (JSmith) - The new user was
created.
(2014-07-10 14:16:29)</PROPERTY>
<PROPERTY name="return-code" type="sint32" size="15" draw="false" sort="nosort"
display-name="Return Code">0</PROPERTY>
<PROPERTY name="component-id" type="string" size="80" draw="false" sort="nosort"
display-name="Component ID">JSmith</PROPERTY>
<PROPERTY name="time-stamp" type="string" size="25" draw="false" sort="datetime"
display-name="Time">2014-07-10 14:16:29</PROPERTY>
<PROPERTY name="time-stamp-numeric" type="uint32" size="25" draw="false"
sort="datetime"
display-name="Time">1405001789</PROPERTY>
</OBJECT>
</RESPONSE>
JSON API output:
{
"status":[
{
"object-name":"status",
"response-type":"Success",
"response-type-numeric":0,
"response":"Command completed successfully. (JSmith) - The new user was created.
(2017-07-27 10:27:46)",
"return-code":0,
"component-id":"JSmith",
"time-stamp":"2017-07-27 10:27:46",
"time-stamp-numeric":1501151266
}
]
}
XML API optimization
For the XML API only, the following are two ways to optimize performance:
Use embedded objects. This allows one object to contain not only properties but also other objects. In general, parsing a structure such
as this is easier as the association between objects is simpler. This is an alternative to using COMP elements.
Use brief mode. In brief mode, which is disabled by default, returns a subset of attributes of object properties. The name and type
attributes are always returned. Other properties can be obtained by using the meta command with the basetype of the object. This
optimization reduces the number of bytes transmitted for each request and allows caching of CLI metadata. Brief mode can be
enabled or disabled by using the set cli-parameters command.
16
Using the CLI