cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1804
Views
10
Helpful
2
Replies

PYTHON API REST CODE FOR DELETE MAC ADD ENDPOINT FROM ISE 2.7 DB

cbarredo1972
Level 1
Level 1

Hello, sorry for my english. I writed a python api post code for add a mac add to endpoint group (whitelist), but now need another python api rest code for delete a mac add form DB ise directly.. (not from whitelist)..

The new code need question it the mac add y only eliminate from DB code. Is possible?.

 

THX in advance.

1 Accepted Solution

Accepted Solutions

Mike.Cifelli
VIP Alumni
VIP Alumni

Yes this is possible using an API.  Take a look at the online sdk (https://your ise pan ip:9060/ers/sdk#) - specifically Endpoint Delete

The trick here will be the fact that you will need to first query to get the endpoint ID string, to then use the ID string in the delete request.

 

This snippet of python should shed some light on how to extract the endpoint ID string first:

r = p_APIold(HW_ADDR)
print r.encoding

data = r.text
#Store response unicode file contents as string so we can extract unique ID
hostIDJSON = json.loads(data)
for client in hostIDJSON['SearchResult']['resources']:
temp = client['id']
print temp
p_APIupdate(temp)

 Good luck & HTH!

View solution in original post

2 Replies 2

Mike.Cifelli
VIP Alumni
VIP Alumni

Yes this is possible using an API.  Take a look at the online sdk (https://your ise pan ip:9060/ers/sdk#) - specifically Endpoint Delete

The trick here will be the fact that you will need to first query to get the endpoint ID string, to then use the ID string in the delete request.

 

This snippet of python should shed some light on how to extract the endpoint ID string first:

r = p_APIold(HW_ADDR)
print r.encoding

data = r.text
#Store response unicode file contents as string so we can extract unique ID
hostIDJSON = json.loads(data)
for client in hostIDJSON['SearchResult']['resources']:
temp = client['id']
print temp
p_APIupdate(temp)

 Good luck & HTH!

cbarredo1972
Level 1
Level 1

THX very much!