cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
667
Views
0
Helpful
5
Replies

API work with python

Leftz
Level 4
Level 4

Hi We are configuring cisco devices via python. and also trying to exploring with API. When using API, there are some connection issues which are not clear yet. So I would like to know what kinds of cisco device can support API. and how can we use API to work with python together. Thanks!

5 Replies 5

Ben Walters
Level 3
Level 3

There are a ton of devices and software from Cisco that supports API functionality. I use the REST APIs on ASA and ISE to automate a lot of different tasks. I don't use python but it plays well with that too. 

I would check out https://developer.cisco.com/docs/

They have a bunch of great info here depending on what devices/software you are using with tutorials and code examples. Are you looking to do something specific?

Leftz
Level 4
Level 4

Thank you Ben for your reply! Yes there are a lot devices that can support API. and there are a lot documents to talk about it. I read and watched some video. I tried to configure and i can see configuring devices via API still needs some tools such as python etc. so I feel python alone also can do what API+python can do well and also do efficiently work. Maybe I have not understand API completely. Can you explain or send link or youtube to explain why API plus python or plus some thing like python can be more efficiently? Thank you very much

Depending on your proficiency with Python and the devices you work with you may not have a need to ever use APIs if you don't want to.

APIs are another way to access the data from the device or environment. Instead of connecting to the device with SSH and using the CLI to view configuration or implement changes you can use web requests to the API to do the same thing. For something like ISE that doesn't have a dedicated CLI for making changes the API is required to be able to automate changes to data within that environment.

I like to use APIs because JSON is really easy to read and work with instead of reading output from the CLI and trying to apply formatting or other data manipulation.     

Hello,

can you elaborate on what kind of connectivity issues you are having, and can you post the Python script you are using ?

jasonwebb
Level 1
Level 1

Most Cisco devices support API. It would probably be easier to identify which devices don't in your list then those that do. Consider using DevNetUI. It makes it allot easier and more reusable if you are journeying into python backed programmability into Cisco devices. www.devnetui.com is the app.

Review Cisco Networking for a $25 gift card