cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2277
Views
4
Helpful
16
Replies

DNAC REST API: Assign device to site doesn't move device to site

uheil
Level 1
Level 1

Hi folks,

I try to move devices from the 'Unassigned Devices' section to the correct site but even though the business-api returns OK the device still remains in the 'Unassigned Devices' section.

First I tried the dnacentersdk 2.3.3.0, then I moved to bare calls via python request library but both report for the task 

'message': 'The request has been accepted for execution'

and for the query to 'executionStatusUrl': '/dna/platform/management/business-api/v1/execution-status/.... I get

'bapiName': 'AssignDeviceToSite',
'status': 'SUCCESS',

Has anyone managed to successfully move a newly added device to a site ?

16 Replies 16

Alex Stevenson
Cisco Employee
Cisco Employee

Hi  @Alex Stevenson 

thx for your reply!

Under Platform > Manage > Bundles I disabled the REST API for 30 sec. and tried again but unfortunately the device stayed in the Unassigned Devices section. If you think there is anything else I can try or if you might know what kind of service I could monitor from the terminal with magctl service logs ... I'd give it a try. If not I'd open a TAC request.

 

CoffeOfCup
Level 1
Level 1

Hi @uheil 

I am experiencing the same problem on DNAC 2.2.3.6. Did you manage to solve this issue, if so how?

Hi @CoffeOfCup 

I did not manage to solve it.

I wanted to open a TAC case but got caught by other tasks.

yawming
Cisco Employee
Cisco Employee

I have Version 2.3.3.6, just tried and it worked for me. - /dna/intent/api/v1/assign-device-to-site/${siteId}/device

Hi @yawming 

I only tried a specific version with the SDK, how do I specify which version to use when using pure REST requests?

yawming
Cisco Employee
Cisco Employee

Hi I am using REST API not SDK.

Thanks

yawming_0-1677605394881.png

 

Hi @yawming 

jeah, while driving home it occurred that I mixed things up between Versions of the REST APi and the dnacentersdk...

For the record, I'm having the problem wit DNAC v2.2.3.6, tried the dnacentersdk using v 2.3.3.0 and pure REST requests with the URL /dna/intent/api/v1/assign-device-to-site/${siteId}/device.

CoffeOfCup
Level 1
Level 1

Hi @uheil 

Thank you for the response. 

 

I will proceed with upgrading to 2.2.3.6 this weekend, and then see if it solves the issue. 


If not i will be opening a TAC case. 

Is there any issue if assign it via UI ?

@yawming sorry for the late reply, assigning devices via UI just works fine. Only via API (REST & SDK) won't do.

TahirAli12881
Level 1
Level 1

How do you get a list of all devices that are in "Unassigned Devices" via API call. Because you need the IP address of the device to be used in the json body.

I have tried dna/intent/api/v1/network-device then i get all devices with there status, but not the devices that are under "Unassigned Devices" how can i get a list of "Unassigned Devices" 

 

Regards

T

Since I know the IPs of the devices I wnat to assign I can't tell you.

But feel free to open a new thread for a new question, maybe someone will answer there.

regards

Very good question, I cannot find an API to list "unassigned device" but there is an ApI can list all the devices under that site.

/dna/intent/api/v1/membership/${siteId}

response sample:

{
"site": {
"response": [
{}
],
"version": "string"
},
"device": [
{
"response": [
{}
],
"version": "string",
"siteId": "string"
}
]
}

Under "device" it will list all devices (with IP and detail)

If you don't have too many sites it's not hard to search all sites and find out if that particular IP is assigned or not.