Error Reporting and Response Messages

In SLX-OS, an HTTP status code reports success or failure for RESTCONF operation. The error information is returned for "4xx" and "5xx" class of status code.

The following table shows the supported are the error-tag with status -code .

Status Code Error Tag
Invalid-value 400
unknown-element 400
operation-not-supported 404 or 501
operation-failed 412 or 500
Access-denied 401 or 403
Data-exists 409
Unknown-namespace 400
Bad-element 400
Unknown-element 400
Malformed-message 400
Missing-attribute 400
Unknown-attribute 400
Bad-attribute 400
data-exists 409
In-use 409

When an error occurs for a request message on any resource type, and the status code that is returned is in the "4xx" range, the server sends a response message-body containing the information described by the "yang-errors”. The Content-Type of this response message is a subtype of application/yang-data.

The following is an example of an error message.
HTTP/1.1 401 Not Found
 Date: Tue, 2 Aug 2016 17:11:00 GMT
 Server: SLX-OS WWW
 Content-Type: application/yang-data+json
  {
        "ietf-restconf:errors": {
          "error": [
           {
              "error-type": " application",
              "error-tag": "unknown-element",
              "error-message": "Element not found"
            }
          ]
        }
   }