Cisco Cisco ASA 5580 Adaptive Security Appliance

Page of 28
 
About the ASA REST API v1.2.2 
Resource Identity 
 
Resource Identity 
All Resources will have a unique identifier “objectId” which will be either a natural unique name for the given type, 
assigned by the user, or a hash generated from composite unique attributes. Note that since the CLI has no notion of 
unique identifiers (UIDs), and since the REST Agent is stateless, it is not possible for the REST Agent to generate distinct 
unique identifiers. 
Example: 
  "kind": "object#AccessGroup", 
  "selfLink": "https://<asa_ip>/api/access/in/inside", 
  "ACLName": "inside_in_acl", 
 " direction": "IN", 
  "interface": { 
    "kind": "objectRef#Interface", 
    "refLink": "https://<asa_ip>/api/interfaces/physical/GigabitEthernet0_API_SLASH_1", 
    "objectId": "GigabitEthernet0_API_SLASH_1", 
    "name": "inside" 
  } 
 
Resource URL: ‘selfLink’ Attribute 
The “selfLink” attribute is the complete URL for a resource, specified within the JSON definition of that object. This 
allows direct access to a collection of object elements, without needing to construct the URL from its objectID. This 
attribute will be specified in the JSON definition of every resource object. 
The objectId part of the selfLink will be URL-encoded, regardless of whether the selfLink is part of a JSON response or a 
location header. 
Upon receipt of an API request, a canonicalization check for double or mixed encodings is performed on the request 
URL. If the URL is double encoded, a “400 bad request” will be returned. If the URL passes the canonicalization check, 
the request URL is decoded and sent for further processing. 
Note: The objectId within the JSON response is never URL-encoded. So, if a URL is being explicitly constructed using 
the objectId from a JSON response (as opposed to using selfLink), then the URL should be constructed after 
appropriately URL-encoding the objectId. 
Resource Type: ‘kind’ Attribute 
All JSON objects have a “kind” attribute indicating the type of object content—if the object represents a list, it will have a 
kind attribute of ‘collection#{type}’; otherwise it will be some form of ‘object#{type}’ or a primitive kind, as described in 
the next section. 
Examples: 
kind: collection#accessPolicySet => represents a list of ACL entries 
kind: object#networkobject => represents an object of type ‘networkobject’