10-15-2019 09:09 AM - edited 02-21-2020 11:11 AM
ISE 1.3
Using Postman,
I have tried using:
GET (ise-admin-url:9060)/ers/config/guestuser
Accept: application/vnd.com.cisco.ise.identity.guestuser.2.0+xml
Content-Type: application/vnd.com.cisco.ise.identity.guestuser.2.0+xml
This returns:
10-16-2019 04:28 AM
@ropauljr87 - it's been a while since I did any REST stuff. But I recall that you can append a ?size=100 (100 is the max apparently) to the REST call, and then it tells the server to return up to that many items in your XML/JSON response.
if you need more than 100 then you have no option but to script it. It's not that scary ...
I will also refer you to this neat little Python procedure that someone posted on this Community forum - I am sure you can hack something together to suit your needs ;-)
def get_device_list(s): """ Return list of the Network Devices Maximum is 100 devices per page ?size=100 Go through the pages &page = 1 """ url = "https://" + ISE_SERVER + ":9060/ers/config/networkdevice?size=100&page=" url = url + "1" resp= requests.request("GET", url, data=payload, headers=headers, params=querystring) device_list = [] if resp.status_code == 200: result = resp.json()['SearchResult'] total = result['total'] pages = total / 100 + 1 for page in range (1, int(pages + 1)): resp= requests.request("GET", url + str(page), data=payload, headers=headers, params=querystring) if resp.ok: result = resp.json()['SearchResult']['resources'] for item in result: device = {} device['id'] = item['id'] device['name'] = item['name'] """ Not all devices has description field """ # device['description'] = item['description'] device['link'] = item['link']['href'] device_list.append(device) return device_list
10-17-2019 12:59 PM
Thank you for your answer Arne.
In Postman, it has some query params for page size, and I can increase that value out to 100. This does increase the number of responses returned, but they are only just username and ID-string. I can then utilize those ID-strings in another GET, but I have only been able to figure out how to get these one at a time. NOTE: this second get returns more specific guest account information.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: