Cisco DNAC, /dna/data/api/v1/clients/query no results for macAddress
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 02:29 AM
Hi, I'm using https://developer.cisco.com/docs/dna-center/2-3-7/retrieves-the-list-of-clients-by-applying-complex-filters-while-also-supporting-aggregate-attributes/ (/dna/data/api/v1/clients/query) to query our Catalyst Center (2.3.7.7) for endpoints connected to our campus network. This works very well if I query for an IP address or a short hostname using the following payload:
payload = {
'filters': [
# qtype: macAddress, ipv4Address, ipv6Address or name
{'key': qtype, 'operator': 'eq', 'value': addr}
],
# Include 4 weeks, Unix epoch in ms.
'startTime': int((time.time() - 86400 * 28) * 1000)
}
However, it does not find any endpoint if I query by MAC address (tested with MAC address that I got from an IP address query).
As workaround I use https://developer.cisco.com/docs/dna-center/2-3-7/retrieves-the-list-of-clients-while-also-offering-basic-filtering-and-sorting-capabilities/ (/dna/data/api/v1/clients) to query for MAC addresses. This works, but it needs extra code. It would be very nice if I could handle all these queries in one parametrised method.
Do I overlook something in my query or is this a bug in the API?
- Labels:
-
Cisco DNA

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 03:34 AM
Sounds like you have tried it all, and the only think i can think of is the MAC address is in the correct format, if that does not help your issue here, i think you are right that it could be a bug or limitation in the API, as the fact that the /dna/data/api/v1/clients
endpoint works for MAC addresses but /dna/data/api/v1/clients/query
does not suggests that the latter might have a problem with MAC address queries.
This then is a TAC issue or you can and should use the Make a Wish feature in the Help menu to communicate this directly to the Product Managers at Cisco. It means a lot coming right from the customer or run this via your account manager.
Hope this helps.
Connect with me https://bigevilbeard.github.io
