cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1326
Views
5
Helpful
3
Replies

How to get AP country code from DNAC API?

777GE90
Level 1
Level 1

Hello, I am trying to get the AP Country Code from the DNAC API, but I can't seem to find it anywhere obvious.

 

I was expecting to find it under the `network-device` endpoint.

 

E.g: /dna/intent/api/v1/network-device/{uuid} but this does not seem to have it in the results.

3 Replies 3

Alexander Stevenson
Cisco Employee
Cisco Employee

Hello @777GE90,

 

In regards to the API call you have referenced:

 

The Get Device List API call does not return the AP Country Codes.

https://developer.cisco.com/docs/dna-center/#!get-device-list

 

As you can see, it is not contained in the response.

 

• response:array[]
o apManagerInterfaceIp:string
o associatedWlcIp:string
o bootDateTime:string
o collectionInterval:string
o collectionStatus:string
o errorCode:string
o errorDescription:string
o family:string
o hostname:string
o id:string
o instanceTenantId:string
o instanceUuid:string
o interfaceCount:string
o inventoryStatusDetail:string
o lastUpdateTime:string
o lastUpdated:string
o lineCardCount:string
o lineCardId:string
o location:string
o locationName:string
o macAddress:string
o managementIpAddress:string
o memorySize:string
o platformId:string
o reachabilityFailureReason:string
o reachabilityStatus:string
o role:string
o roleSource:string
o serialNumber:string
o series:string
o snmpContact:string
o snmpLocation:string
o softwareType:string
o softwareVersion:string
o tagCount:string
o tunnelUdpPort:string
o type:string
o upTime:string
o waasDeviceMode:string

 

Although, you can see it does return the ‘location’ and ‘locationName’ fields.


If we dive deeper with the Get Device Detail API call, we get even less, with only the location field returned.

https://developer.cisco.com/docs/dna-center/#!get-device-detail

 

I would try the Get Wireless Profile API call. That might give you a country code for the AP, but I’m not sure.

https://developer.cisco.com/docs/dna-center/#!get-wireless-profile


Some notes:


• You may be able to get the country code from the location information returned above. Perhaps you can write a script to deduce the country code from the location string.

• The AP country code is set at the factory and usually can’t be changed. Look at the product code on the back of the AP. If the product code does not contain “UX” then you can’t change the regulatory domain of the AP.

• You can verify your WLC’s country code via CLI with this command from the WLC: show country

• The only way I’ve seen to get the Country Code for an AP is to run this command from the WLC: show ap summary (see https://www.cisco.com/en/US/docs/wireless/controller/7.4/command/reference/lwap/lwapcr74_chapter_010.pdf) see page 35

• I’ve looked everywhere on the DNAC Dashboard and I can find no trace of country codes. It seems it was in some older versions under ‘Wireless’. I’m using https://sandboxdnac.cisco.com to search.

Hi @Alexander Stevenson 

 

Thanks for the comprehensive response, very useful.

 

So to give you some background, what I am trying to achieve here is to get the AP Country Code setting via the API, so that I can validate that it is set to the correct value.

 

Our DNAC instance is showing "Installed Version:2.3.3.0-70399", which I think is the latest.

 

I too did struggle to find the "AP Country Code" in the UI, but managed to find it by doing the following:

1. Login to DNAC.

2. Click on the left hand menu and select "Assurance --> Health".

3. Select the "Network" tab.

4. Select an AP device to enter the "Device 360" area.

5. Under "DEVICE DETAILS", press "View All Details" and the "Country Code" is displayed under "GENERAL INFORMATION".

 

In regards to the network-device API response contents, unfortunately, both the "location" and "locationName" fields appear to be null values for us, so are not usable.  We also need to make sure that the location we are obtaining is the actual location setting of the AP, as that is the setting we are trying to validate, as opposed to just getting a generic location. 

 

I'm not sure how I can use the get-wireless-profile endpoint, as it seems to require me to specify a profile name, which I am not familiar enough with DNAC to know how it links to specific AP's or whether our AP's are even linked to a profile name in the first place.

 

Ideally, I want to avoid SSH'ing into the device as we plan to automate these checks and the API would be the best way to do that.

 

Given how difficult it seems to retrieve this information and as you suggest it may not be possible to change the country code in the first place, I will also have a check to see if this requirement is still valid for us.

 

But please do let me know if there is any way to get this information via the API.

 

Hello @777GE90,

 

You're right. I did see the country code as a field in the Device 360 area. I forgot about that, since it was blank.

 

I'm seeing much more granularity of API details returned by using the DNAC Developer Toolkit.

 

  1. In the DNAC Dashboard, go to Platform --> Developer Toolkit
  2. On the right, type 'Assurance' into the search bar.
  3. Click 'Devices' in blue (this is the device-health request)
  4. Click the blue button 'Try it'
  5. For 'deviceRole', specify 'AP' (You can also leave it blank to get all devices)
  6. Click 'Run'

 

 This will give you the IP and MAC of every AP. There must be a way to find the AP Country Code from that

 

I thought for sure I was going to get lucky in the Reports section of the DNAC Dashboard when I saw 3 different reports for APIs. Unfortunately, none of them specify a country code.

 

https://sandboxdnac.cisco.com/data-sets-reports?reports-item=report-templates