Cisco Cisco ASA 5555-X Adaptive Security Appliance

下载
页码 29
 
About the ASA REST API v1.3.2 
REST API Codes 
 
•  An HTTP POST response to a Create request will have a 201 return code and a Location header containing the 
URI of the newly created resource in the HTTP header. 
•  An auto-created configuration (resource) will not support a create-and-delete REST operation; that is, no HTTP 
POST and DELETE request. For example, you cannot create or delete the logging-related configuration, but it 
can be modified (PUT) or retrieved (GET). 
•  Neither HTTP GET nor HTTP DELETE has a request body. 
•  An HTTP DELETE of a collection of resources is not supported since you would be deleting the resource 
identified by that URL. If that resource was deleted, you would not be able to create a sub-resource (the “item” 
in the collection). 
•  An HTTP GET response has a “kind” attribute to indicate the name of the object or collection of objects. 
•  All REST API requests and responses must be in JSON format. 
•  All JSON attributes must employ the “CamelCase” naming convention; for example, “policyType.” 
•  JSON values of type String must be in double quotes; values of type Boolean or Number need not be double 
quoted. A Boolean value is either true or false, in lower case. 
•  Every received HTTP request is expected to have this “Accept: application/json” statement in its HTTP header, 
indicating the REST client expects the REST response to be in JSON format. 
•  Every HTTP POST request must include a JSON body (an attribute). 
•  The Location header in the HTTP response will contain the complete URL for all the POST (create) scenarios. 
•  Brackets, as in [<items>] in the JSON representation of a schema, indicate a list of items. 
•  Unless otherwise specified, an HTTP GET returns the currently configured state. 
•  Whether an attribute will be shown if it has no value depends if it is an optional attribute or not. If it is optional, it 
can be omitted in the HTTP GET response. If it is not optional, its value will be presented as an empty string if 
the attribute is of type String, or as a 0 (zero) if it is a Number. 
•  Pagination is supported and will be restrict the maximum number of items that can be retrieved through a GET 
or Query API call. 
REST API Codes 
HTTP error codes will be reported based on these standards: 
HTTP Error Code in HTTP header  Description 
400 Bad Request 
Invalid query parameters: unrecognized parameters, missing parameters, or invalid 
values. 
404 Not Found 
The URL does not match an existing resource. For example, an HTTP DELETE of a 
resource fails because the resource is unavailable.