06-26-2024 03:40 AM
Hi,
I would like to retrieve the details of the networking devices (switch) connected to the access points in Catalyst center.
I am using the version 2.3.7.5
I can generate a report for all the network devices like swithces and access points
But it would be nice to know the switch port to which the access points are connected.
Hoping to get some leads on this topic.
Thanks in advance
Solved! Go to Solution.
07-01-2024 07:24 AM
From what you are asking, you can find everything you need in the Report for APs. The "Last Disconnect Time" will correlate with the "Uptime" value. Just subtract the uptime days from the day that your ran the report and you should have your Last Disconnect Time. This of course is tied together since most Cisco APs are connected to a Cisco Switch in which POE is used.
For Example:
06-26-2024 03:50 AM
@beginnerciscouser The most direct method is to use the Get Device Detail API (https://developer.cisco.com/docs/dna-center/get-device-detail/) the API provides comprehensive information about a specific device, including its interfaces and connections.
Hope this helps.
06-26-2024 04:32 AM
Thank you for your response.
Using the API device detail, i did not find the switch port details to which the AP is connected.
06-26-2024 05:13 AM
In which case you will also need the /dna/intent/api/v1/network-device/{id}
API endpoint, that should provide the connected switch port details within the interfaceDetails
attribute of the AP's data for you.
Hope this helps.
06-27-2024 05:11 AM - edited 06-27-2024 05:11 AM
Hi @bigevilbeard ,
I tried using the /dna/intent/api/v1/network-device/{id} API, but it does not provide any details about the switch port the AP is connected.
Please find the sample output.
{'description': None, 'serialNumber': 'xxxxxxxx', 'lastUpdateTime': 1719478329120, 'macAddress': 'xx:xx:xx:xx:xx:xx', 'deviceSupportLevel': 'Supported', 'softwareType': None, 'softwareVersion': '8.10.183.0', 'collectionInterval': 'NA', 'dnsResolvedManagementAddress': '', 'managementState': 'Managed', 'pendingSyncRequestsCount': '0', 'reasonsForDeviceResync': '', 'reasonsForPendingSyncRequests': '', 'inventoryStatusDetail': 'NA', 'upTime': '15 days, 20:30:00.280', 'roleSource': 'AUTO', 'interfaceCount': '0', 'lastUpdated': '2024-06-27 08:52:09', 'associatedWlcIp': '172.20.0.10', 'apEthernetMacAddress': '8c:1e:80:24:c4:7c', 'errorCode': 'null', 'errorDescription': None, 'lastDeviceResyncStartTime': '', 'lineCardCount': '0', 'lineCardId': '', 'managedAtleastOnce': False, 'memorySize': 'NA', 'tagCount': '0', 'tunnelUdpPort': '16666', 'uptimeSeconds': 1381435, 'vendor': 'NA', 'waasDeviceMode': None, 'bootDateTime': None, 'apManagerInterfaceIp': '172.20.0.10', 'collectionStatus': 'Managed', 'family': 'Unified AP', 'hostname': 'CAP521', 'locationName': None, 'managementIpAddress': '172.20.3.9', 'platformId': 'C9120AXI-E', 'reachabilityFailureReason': 'NA', 'reachabilityStatus': 'Reachable', 'series': 'Cisco Catalyst 9120AXI Series Unified Access Points', 'snmpContact': '', 'snmpLocation': '16.4/vor_320', 'type': 'Cisco Catalyst 9120AXI Unified Access Point', 'location': None, 'role': 'ACCESS', 'instanceUuid': '484c4847-31a4-4860-8acf-1dec72af1dbd', 'instanceTenantId': '610ba8b937231100c7b2cf9f', 'id': '484c4847-31a4-4860-8acf-1dec72af1dbd'}
06-27-2024 06:58 AM
@beginnerciscouser wonder if that is version issue idk, i am not up to date on version these days. How about this one /dna/intent/api/v1/network-device/{deviceUuid}/interface/{interfaceUuid}/neighbor https://developer.cisco.com/docs/dna-center/get-connected-device-detail/
06-30-2024 11:28 PM
I have found a solution for this by downloading AP report from the catalyst center.
But the report does not provide information about the last seen. However the last disconnected time can be seen in the table in the catalyst center (Assurance -> Health -> Network ) In the table, when filtering to get the access point details, last disconnected time is visible.
Happy to receive some leads on this.
07-01-2024 07:24 AM
From what you are asking, you can find everything you need in the Report for APs. The "Last Disconnect Time" will correlate with the "Uptime" value. Just subtract the uptime days from the day that your ran the report and you should have your Last Disconnect Time. This of course is tied together since most Cisco APs are connected to a Cisco Switch in which POE is used.
For Example:
07-01-2024 09:51 PM
To retrieve the details of the networking devices (like switches) connected to access points in Cisco Catalyst Center using an API call, you will need to use the appropriate endpoints provided by the Cisco DNA Center (DNAC) API.
Steps to Retrieve Information
1. Authenticate to the API: You will need to get an authentication token from the DNA Center to make subsequent API calls.
POST /dna/system/api/v1/auth/token
Example Python code to get the token:
import requests
from requests.auth import HTTPBasicAuth
DNAC_URL = "https://<dnac-url>"
DNAC_USER = "<username>"
DNAC_PASS = "<password>"
auth_response = requests.post(
f"{DNAC_URL}/dna/system/api/v1/auth/token",
auth=HTTPBasicAuth(DNAC_USER, DNAC_PASS),
verify=False
)
token = auth_response.json()["Token"]
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