cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
350
Views
2
Helpful
8
Replies

Get Access Point Network Information in catalyst center via API call

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

 

1 Accepted Solution

Accepted Solutions

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.

  • Using the Cisco Catalyst Center Admin UI, Go to the Reports Page
  • Select Report Templates
  • Select Access Point Category
  • Select the "AP" Card and Click Generate
  • Proceed through the Report Work flow and Click "Generat Report"
  • When the report is completed, you can download the .CSV File (if selected) and review the CDP Neighbors of the inventory managed Access Points

For Example:

Report_01.pngReport_02.pngReport_03b.png

View solution in original post

8 Replies 8

@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.

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

Thank you for your response.

Using the API device detail, i did not find the switch port details to which the AP is connected.

 

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.

 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

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'}

@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/ 

Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io

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.

 

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.

  • Using the Cisco Catalyst Center Admin UI, Go to the Reports Page
  • Select Report Templates
  • Select Access Point Category
  • Select the "AP" Card and Click Generate
  • Proceed through the Report Work flow and Click "Generat Report"
  • When the report is completed, you can download the .CSV File (if selected) and review the CDP Neighbors of the inventory managed Access Points

For Example:

Report_01.pngReport_02.pngReport_03b.png

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"]