Uri error return behavior – Brocade Network Advisor REST API Guide (Supporting Network Advisor 12.3.0) User Manual
Page 50

36
Brocade Network Advisor REST API Guide
53-1003160-01
Handling errors
3
URI error return behavior
This section explains the error a user can expect when a URI fails. Parsing of the URI follows a
pattern and returns an error in the following order.
1. The server checks the URI, including the path parameters, for correctness. If the URI is not
valid (for example, a word in the URI is misspelled), the resource cannot be found and you get
back an HTTP status code of 404 (Not Found).
2. If the URI is correct, the server checks the query parameter values for correctness. If the query
parameters are invalid, the REST operation fails with HTTP status code of 500 (Internal Server
Error) and an RSException. The value of the error code depends on the exact error.
3. If the previous two steps succeed, which means that the URI is syntactically correct, the server
parses the URI from left to right. If any resource corresponding to the path parameters is not
present, then the appropriate “Does Not Exist” or “Not Found” error is reported. For example:
In the example URI, if the resource group specified by rgkey does not exist, you receive the
appropriate error code. If rgkey is valid, then the server checks whether fcskey exists. If not, the
appropriate error code is generated.
4. The server returns “Not Found” errors if you are looking for a specific object that cannot be
found.
5. In the case of a collection like fcswitches, the response is either a populated or empty list. The
return of an empty list indicates that there are no instances within the requested collection.
6. If you are using a filter like “/fcswitches?property1=
fabric with that property, an empty response is returned.
NOTE
Filtering is not the same as using a key. Filters let you sift out a smaller list from a larger one.
The smaller list could be an empty list.
The following is an example of an exception generated due to a REST operation failure:
REST FAILED WITH HTTPSTATUS = 500
RSException [errorCode=2001, errorMsg=Switch not found]
8006
Range from start date to end date exceeds limit for given granularity.
8007
Start date is beyond end date.
99010
Opaque key value not found
TABLE 10
Error codes (Continued)
Error code
Error message