Cisco Cisco ASA 5555-X Adaptive Security Appliance

下载
页码 32
 
About the ASA REST API 
REST API Codes 
 
•  An HTTP PUT accepts a complete resource. It does not return the updated version in the response. If a modified 
resource in not sent in the response, the HTTP status code is 204 (not 200 OK) in the HTTP header response. 
•  HTTP PATCH is supported where applicable to partially update a resource. Any attribute not specified will take 
the value of the server value. 
Note: As noted for HTTP PUT, use of HTTP PATCH can change an object’s identifying hash value, and as with 
HTTP PUT, this does not mean that the HTTP PATCH call created a new object.  
•  An HTTP POST request contains the details of a new resource to be created in JSON format. 
•  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, 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 
Description