Cisco Cisco ASA 5580 Adaptive Security Appliance

Page of 29
 
About the ASA REST API v1.3.2 
REST API Online Documentation 
 
27 
The REST API Agent must be enabled to access the Doc-UI; the Doc-UI is accessible from https://<asa management 
interface ip>
/doc/
 (note that the ending '/' is necessary for accessing the Doc-UI). 
Note: When you access the local REST API documentation pages, your browser sends a request to the ASA for the 
pages, and also requests certain jQuery and JSON files from various Web locations. One of these locations is 
https://cdnjs.cloudflare.com
However, when passing through an ASA with FirePOWER Services enabled, such requests may be blocked by 
the FirePOWER module if there is a “Categories: ad portal” blocking filter configured. To unblock the 
cloudflare
 site, create an access control rule that explicitly allows this site, and place it above the rule which 
includes an application condition blocking “ad portals.” 
 for information on excluding a Website/Web application from blocking due to URL 
filtering or application control. 
Types of Scripts 
Three types of scripts can be generated from the Doc-UI so you can automate REST API operations: Javascript, Python, 
and Perl. 
Prerequisites for Using Generated Scripts 
The JavaScript scripts require the installation of Node.js, which can be found at 
. Node.js lets you use 
JavaScript applications, typically written for a browser, like a command-line script (such as Python or Perl). Simply follow 
the installation instructions, and then run your script with: 
node script.js  
The Python scripts require you to install Python, found at 
. Once you have installed Python, you 
can run your script with: 
python script.py <username> <password>  
The Perl scripts require some additional set-up. You will need five components: Perl itself, and four Perl libraries: 
Perl, found at 
Bundle::CPAN, found at 
REST::Client, found at 
MIME::Base64, found at 
JSON, found at 
Here is an example Perl installation on a Macintosh: 
Boot strapping for MAC: 
$ sudo perl -MCPAN e shell