Security

Upcoming community maintenance Oct. 27th through Oct. 29th
For more info click here
Reply
Highlighted
Super Contributor I

Getting started with ClearPass API and Python

Hello,

 

I've done the steps needed to get going with the API (I think). I've had a play with cURL and with the built-in API Explorer. It all looks good. My question is really are there any resources specifically for Python? Or do I just write a standard Python script using Python modules like request & json? I haven't used a REST API before.

 

My use-case is pretty  simple, I just want to get a list of devices from Guest, check the status of the people who have registered them (by running their IDs through our own identity db) and then delete any devices in Guest that belong to users who are now cancelled (ie have left the university). Before I start I just want to make sure there isn't anything I'm missing about how to do this.

 

Thank you


Accepted Solutions
Highlighted
Frequent Contributor I

Re: Getting started with ClearPass API and Python


All Replies
Highlighted
Frequent Contributor I

Re: Getting started with ClearPass API and Python

Highlighted
Super Contributor I

Re: Getting started with ClearPass API and Python

aah this looks brilliant - thank you

Highlighted
Aruba Employee

Re: Getting started with ClearPass API and Python

I bashed this Python program primarily to teach myself Python. This uses Python3. The program is reasonably logically setup with helpful comments - though I'm new to Python. It sets up the RESTful API's Bearer and then allows updating of various Endpoint and Guest Device attributes. Hopefully the README file is self explanatory?

WARNING: This has only had rudimentary testing but is provided to show the principles. Treat with care

Highlighted
Super Contributor I

Re: Getting started with ClearPass API and Python

Thank you - I'll take a look

Search Airheads
cancel
Showing results for 
Search instead for 
Did you mean: