/cisco-pxgrid-samples

some public examples for cisco's pxgrid

Primary LanguagePython

cisco pxgrid examples

in this repo you will find some python examples for working with cisco ISE and the pxgrid REST API/websocket interface. the examples are basic but should give an idea of how to use python with the cisco ISE and pxgrid interface.

examples included

  • program_1.py

this example shows you how to put a set device into a cisco ISE policy group using command "ANCApplyByIP".

  • program_2.py

an example that lists the endpoints on a cisco ISE w/ command "ANCGetEndpoints"

installation / setup

  1. install PIP requirements
pip install -r requirements.txt
  1. set up authentication
openssl pkcs12 -in mycert.p12 -out ./keys/file.key.pem -nocerts -nodes
openssl pkcs12 -in mycert.p12 -out ./keys/file.crt.pem -clcerts -nokeys
  1. enable pxGrid in cisco ISE click here for instructions

running examples

in the examples below i am assuming the ISE is running on "ise24198.acme.local" please replace with your own ISE IP.

  • example 1
python ./program_1.py -a ise24198.acme.local:8910 -w ise24198 -n xRqoa9zHF3YdCXkb -c ./keys/file.crt.pem -k ./keys/file.key.pem -s ./keys/file.crt.pem -p Testtest10
  • example 2
python ./program_2.py -a ise24198.acme.local:8910 -w ise24198 -n xRqoa9zHF3YdCXkb -c ./keys/file.crt.pem -k ./keys/file.key.pem -s ./keys/file.crt.pem -p Testtest10