Cisco Cisco ASA 5555-X Adaptive Security Appliance

下载
页码 29
 
About the ASA REST API v1.2.1 
REST API Codes 
 
•  An auto-created configuration (resource) will not support a create-and-delete REST operation; for example, 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 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 standards: 
HTTP Error Code appearing in 
HTTP header 
Description 
400 Bad Request 
Invalid query parameters – unrecognized parameters or, missing parameters, or invalid 
values. 
404 Not Found 
The URL does not match a resource that exists. For example, a HTTP DELETE of a resource 
fails because the resource is unavailable. 
405 Method not Allowed 
An HTTP verb that is not allowed, such as a POST on a read-only resource.