Debugging

If you encounter a variety of errors, the Cloudlets API responds with appropriate HTTP status codes and a response object that explains them, detailed below. There are many possible causes for failure, such as malformed JSON or missing fields.

Error Responses

The Cloudlets API responds with HTTP problem error objects that provide details useful for debugging.

The following is an example of a response with a validation error:

{
     "detail": "Exceeds maximum rules (5000). Received rule count:5001",
     "errorCode": -1,
     "errorMessage": "Exceeds maximum rules (5000). Received rule count:5001",
     "instance": "2d8290b4-30df-4025-88a8-3f596a52aef7",
     "status": 400,
     "title": "Too Many Rules",
     "type": "/cloudlets/error-types/policy-rule-count-exceeded",
     "maxRules": 5000,
     "ruleCount": 5001
}

In the response above, the error is caused by the fact that the number of rules allowed per policy has been exceeded. To resolve this issue, divide your rules up between different policies to avoid the rule maximum.

The errorCode and errorMessage members are currently included to maintain backwards compatibility with earlier error messaging formats. These members will be removed sometime during the third quarter of 2017, and will eventually disappear.

HTTP Codes

The following are common HTTP codes that are used by this API:

Code Description
200 OK. The operation was successful.
201 Created.
204 No content. Displays when a DELETE operation is successful.
400 Bad Request. Please provide all the required parameters.
403 User is not authenticated.
404 Not Found. The object you were trying to reach could not be found.
409 Validation exception. For example, you might receive this status if a policy already exists with the same policy name. In the case of a duplicate policy name, the message body contains data for the existing policy.
429 Too Many Requests. This code may appear if the API caller is rate limited.
500 There is a problem processing your request. Please try again later. The details are provided in the response body. For example, the request may be missing a required parameter.

Last modified: 1/9/2017