Cisco Cisco ASA 5580 Adaptive Security Appliance

Page of 37
 
About the ASA REST API v1.1.1 
REST-API Online Documentation 
 
35 
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). 
Types of Scripts 
There are three types of scripts that can be generated by the Doc-UI that will allow you to perform REST API operations: 
Javascript, Python, and Perl. 
Pre-requisites for Using Generated Scripts 
The Javascript scripts require the installation of node.js, which can be found at http://nodejs.org/. Node.js allows 
you to use Javascript, typically written for a browser, like a command line script (such as Python or Perl). Simply follow 
the installation instructions, and run your script with: 
node script.js  
The Python scripts require you to install Python, found at https://www.python.org/. 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 installation on a Macintosh: 
Boot strapping for MAC: 
$ sudo perl -MCPAN e shell 
cpan> install Bundle::CPAN 
cpan> install REST:: Client 
cpan> install MIME::Base64 
cpan> install JSON