Response

Describes the different return responses.

The commands return responses in JSON or in a tabular format. When you run commands from the command line, the response is returned in tabular format unless you specify JSON using the -json option; when you run commands through the REST interface, the response is returned in JSON.

NOTE The columns returned by operations such as get, list, info, and so on are not sorted in any particular order.

Success

On a successful call, each command returns the error code zero (OK) and any data requested. When JSON output is specified, the data is returned as an array of records along with the status code and the total number of records. In the tabular format, the data is returned as a sequence of rows, each of which contains the fields in the record separated by tabs.

JSON
{
              "status":"OK",
              "total":<number of records>,
              "data":[
              {
              <record>
              }
              ...
              ]
              }
Tabular
status
              0
Or
<heading>   <heading>   <heading> ...
              <field>     <field>     <field> ...
              ...

Error

When an error occurs, the command returns the error code and descriptive message.

JSON
{
            "status":"ERROR",
            "errors":[
            {
            "id":<error code>,
            "desc":"<command>: <error message>"
            }
            ]
            }
Tabular
ERROR (<error code>) -  <command>: <error message>