09-04-2023 02:13 AM
Hi,
I am attempting to retrieve a list from DNAC with devices assigned to specific sites.
The Get Membership API documentation states that the device information should be returned with this call. However, the data retrieved with this call never returns the device information. This is regardless of whether I'm trying to retrieve the data from our own physical DNAC appliance or one of the cloud instances (dcloud, sandbox). Only site information is returned.
DNAC version: 2.3.3.7
09-04-2023 03:10 AM
- Could you try this : GET /dna/intent/api/v1/site-membership?siteId=1234567890&includeDeviceInfo=true
M.
09-04-2023 03:58 AM
The fault was in my own code. Your reply helped me look closer.
def get_site_devices(headers, site_id):
response = requests.get(BASE_URL + MEMBERSHIP_SITE_URL.format(site_id=site_id), headers=headers, verify=False)
return response.json()['site']['response']
I was returning the response and selecting ['site'] in the json output. By just writing the line as return response.json() shows the device info as expected.
Thank you for your time.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide