cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4710
Views
20
Helpful
2
Replies

Python Scripts for Automation with ISE API

Mike.Cifelli
VIP Alumni
VIP Alumni

Per @Arne Bier request from another post :)

 

Sharing two python scripts that have helped me automate some manual tasks here in our environment.  

get_img_grp_macs_scrub: Runs and dumps a specific endpoint group to screen and creates a csv file with total endpoint count & a list of endpoint MACs.  We purge certain groups weekly so this assists with other teams checking to determine whether or not hosts are present in the group or not.  To take this a step further, depending on what you use, you could setup a cronjob to email the csv file weekly as well.

img_prt_ISE_rest_scrub: prompts the end user with several questions to determine type of host, mac, description, new/existing & executes different functions based on the input to move an endpoint to a specific group and/or create & statically assign an endpoint to a specific group.  It even does some validation as well.

 

Hopefully these shed some light for others & community members will share some of their python projects that may assist us.  I am fairly new to the automation & python game so I am sure even these scripts could be written better.

 

HTH! Cheers!

 

1 Accepted Solution

Accepted Solutions

Charlie Moreton
Cisco Employee
Cisco Employee

Thanks for sharing these with the community, @Mike.Cifelli!  Automation is the path forward and any way we can make it easier for everyone is most welcome  

View solution in original post

2 Replies 2

daneiljack030
Level 1
Level 1

VWAP in Python or Python scripts can be a powerful tool for automating tasks with the Cisco Identity Services Engine (ISE) API. To get started, you'll need to authenticate with the ISE server, typically using HTTP requests and providing the necessary credentials. Once authenticated, you can perform a wide range of automation tasks. For example, you can retrieve information about endpoints connected to the network, modify network policies, or even create and delete network objects. You can use Python's requests library to make HTTP requests to the ISE API endpoints, and the responses will contain the data you need for your automation tasks. Remember to handle errors and exceptions gracefully and ensure that your scripts have the appropriate permissions to interact with the ISE API.

 

 

Charlie Moreton
Cisco Employee
Cisco Employee

Thanks for sharing these with the community, @Mike.Cifelli!  Automation is the path forward and any way we can make it easier for everyone is most welcome