

- #CISCO ASAV REST API HOW TO#
- #CISCO ASAV REST API INSTALL#
- #CISCO ASAV REST API DRIVER#
- #CISCO ASAV REST API CODE#
- #CISCO ASAV REST API DOWNLOAD#
has a nice write up on how to setup an ASAv with Vagrant. One of the most convenient ways is to use an ASAv running on Virtualbox + Vagrant. Mock tests are usefull for quickly iterating when writing a new getter of fixing a bug, but you do want to test on a 'real' device to make sure everything works as expected.
#CISCO ASAV REST API DRIVER#
API documentation of all supported methods is also included in REST API package that was uploaded to firewall and available via https using url napalm import get_network_driver driver = get_network_driver( "asa")ĭevice = driver( hostname = '192.168.1.1', username = 'cisco', password = "cisco", optional_args = )Ĭheck the full NAPALM Docs for more detailed instructions. This is DevOps, this is SDN so definitely something you want to get to know 😉 REST API DocumentationĬisco provided some nice documentation of REST API including basic steps. The answer is yes you can but whole power of REST API is that you can program/script your work introducing automation. Of course such data can be retreived also via SNMP so you may be asking now “so why this way?” and “why can’t I use SNMP for that?”.

“selfLink” : “/api/monitoring/device/version” ,Īs you can see response contain multiple values identified by their names.The information we requested is encoded withing Response Body Vary : Accept-Charset, Accept-Encoding, Accept-Language, Accept.Content-Type : application/json charset=UTF-8.First is Header that is carrying information of query execution status During execution we will be prompted for credential to account that have permission to execute REST API requests. To do that we will use GET method and URL We put this data into form in RESTClient plug-in in Firefox and leave Body field empty. Lets do something to provide REST API is working by getting information about firmware version installed on firewall. Each object within structure can return some values. There is hierarchical tree-based structure we can access using methods. So by great simplification we can compare REST API to SNMP.
#CISCO ASAV REST API CODE#
As a response to method we receive response code and response data tha is also stored in pairs containing name an value.To each method attributes may or have to be defined and are stored in pairs containing name an value.Each feature that can be used via API is available under dedicated URL, the structure of URLs is hierarchical, similar to SNMP.REST API relies on executing methods (GET, PUT, POST, DELETE and PATCH).We will get into some theory to better understand how REST API works in different chapter. REST API can be used to all the tasks on your ASA, which usually includes provisioning, configuration, deployment, monitoring and most other day-to-day activities. I personally use RESTClient extension for Firefox. We will go through some of them in other chapters of tutorial.įor some browsers, like Firefox, there are add-ons available you to use REST API which is useful for learning and testing. There are multiple ways of using REST API interface. In case of any problems some debugging can be enabled on ASA using debug rest-api It’s always good to verify if Agent started correctly ciscoasa# show rest-api agent To enable REST API image must be specified and agent enabled rest-api image disk0:/asa-restapi-132-lfbff-k8.SPA Level 3 or greater is required for monitoring requests,level 5 or greater for GET requests, and level 15 is necessary if we want to modify configuration using PUT/POST/DELETE methods. Privilege level for user should be set to proper value depending what permission we want to assign. Also AAA should be configured for proper local or remote authentication for http access.

If you are using ASAv on Cisco VIRL you will be required to upload REST API first.īefore enabling REST API make sure that https access is properly configured and include host from which you’re going to execute the scripts.
#CISCO ASAV REST API DOWNLOAD#
For physical boxes REST API is available for download on (valid contract is required) then upload it to firewall. Virtual ASA (ASAv) includes the REST API image but it’s disabled by default. I assume that you know how to enable HTTPS access to firewall and if you are working not in isolated lab environment this access is properly secured.
#CISCO ASAV REST API INSTALL#
But if you gain some experience its a good way of learning and getting familiar with whole new world when you more program devices than configure it.īefore you start you need to install and enable REST API on ASA. It fully rely on HTTPS as transport protocol and requires programming skills from administrators.

This API provide administrators an option to perform CRUD operations which is Create, Read, Update, Delete. REST is an acronym of Representational State Transfer (REST) API.
