DNAC API - Get Membership issues
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Labels:
-
Cisco DNA Automation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 03:10 AM
- Could you try this : GET /dna/intent/api/v1/site-membership?siteId=1234567890&includeDeviceInfo=true
M.
-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
