Python class for Aruba's Clearpass Policy Manager
https://www.emerickcc.com
Aruba Networks
Examples
from clearpasspy import Clearpass
server = '<SERVER NAME>'
grant_type = 'client_credentials'
client_secret = 'SUPER SECRET'
client_id = 'clearpassapi'
data = {
'server' : server,
'grant_type' : grant_type,
'secret' : client_secret,
'client' : client_id
}
CPPM = ClearPass(data)
print(CPPM.access_token)
3ea61fd137df506515ae45f0887df1163c4080f9
print(CPPM.online_status('0000af23e980'))
True
print(CPPM.get_endpoints(10))
[{'id': 4814, 'mac_address': '0000e349473f', 'status': 'Unknown', 'attributes': {}, '_links': {'self': {'href': 'https://clearpass.server.com/api/endpoint/4814'}}}
print('Endpoint: {}'.format(CPPM.get_endpoint(4814)))
Endpoint {'id': 4814, 'mac_address': '0000e349473f', 'status': 'Unknown', 'attributes': {}, '_links': {'self': {'href': 'https://clearpass.server.com/api/endpoint/4814'}}}
print('API Call: {}'.format(CPPM.api('/auth-method')))