cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2995
Views
15
Helpful
5
Replies

DNAC Provision Device via API

pmerlitt
Cisco Employee
Cisco Employee

One of the more fundamental things you do in DNA Center in every deployment is once the device is discovered and the network settings established in design, you provision the device.  To do this in the GUI you check the box next to the device in inventory, then Actions -> Provision -> Provision Device.  

 

I can't find how to do this in the API.  I see how to do this in SDA, but that's even more advanced.  I also see how to use configuration templates, again, this is more advanced.  Can some point me to how to do the basic "Provision Device" explained above.  I simply want to kick off this process with an API.  Or let me know if it does not exist or I'm looking at this wrong somehow.  Thanks!

1 Accepted Solution

Accepted Solutions

Mike,

 

Thanks for pointing me in the right direction.  I tried that API and it actually did NOT work for me at first.  See, I don't have an SDA fabric built yet and it sent me back an error (I forget exactly what it said) that it could not find the location I specified.  From an SDA fabric perspective, that made sense since that location exists in DNAC but not in the SDA Fabric tool.  So as a workaround, I created the SDA fabric for my location Global/Richfield, used the provisioning API that you mentioned, then removed the fabric.  In essence, I used 3 API calls:

POST https://{{DNAC_IP}}/dna/intent/api/v1/business/sda/fabric-site

{
"siteNameHierarchy": "Global/Richfield"
}
 
POST https://{{DNAC_IP}}/dna/intent/api/v1/business/sda/provision-device
{
"deviceManagementIpAddress": "10.112.255.9",
"siteNameHierarchy": "Global/Richfield/REQ01/Basement"
}
 
DEL https://{{DNAC_IP}}/dna/intent/api/v1/business/sda/fabric-site?siteNameHierarchy=Global/Richfield
 
That did the basic Design... "Network Settings" provisioning I needed.  That's what I need for now, but hopefully there is a simpler way in the future.
 
 

View solution in original post

5 Replies 5

Preston Chilcote
Cisco Employee
Cisco Employee

I'll admit I haven't actually tried to do a provision via API, but I looked through the Developer Toolkit and it looks to me like this is the one to try (I found it under the Site Management->Configuration Template menu

 

https://< dna  ip>/dna/intent/api/v1/template-programmer/template/deploy

Preston, Thanks for the response.  I went through the effort of trying the API you suggested.  I had to create templates, that honestly, I don't need.  But after going through the excercise, it ONLY deployed the template I created and did not deploy the aaa servers, NTP servers, etc. that I had established under Design... Network Settings.  So I guess I'm back to square 1.  Thanks for chiming in, though.

Mike.Cifelli
VIP Alumni
VIP Alumni

Can some point me to how to do the basic "Provision Device" explained above.  I simply want to kick off this process with an API.

-I think what you are looking for is this: https://developer.cisco.com/docs/dna-center/#!provision-wired-device

Specifically this api: dna/intent/api/v1/business/sda/provision-device

 

Not sure what version of DNAC you are running, but later 2.2.3 versions support it.  Lastly, I have attached an ansible playbook I made that does the job too.  Pay attention to the specifics of your payload as there are some items that are required in order to be successful.  HTH!

Mike,

 

Thanks for pointing me in the right direction.  I tried that API and it actually did NOT work for me at first.  See, I don't have an SDA fabric built yet and it sent me back an error (I forget exactly what it said) that it could not find the location I specified.  From an SDA fabric perspective, that made sense since that location exists in DNAC but not in the SDA Fabric tool.  So as a workaround, I created the SDA fabric for my location Global/Richfield, used the provisioning API that you mentioned, then removed the fabric.  In essence, I used 3 API calls:

POST https://{{DNAC_IP}}/dna/intent/api/v1/business/sda/fabric-site

{
"siteNameHierarchy": "Global/Richfield"
}
 
POST https://{{DNAC_IP}}/dna/intent/api/v1/business/sda/provision-device
{
"deviceManagementIpAddress": "10.112.255.9",
"siteNameHierarchy": "Global/Richfield/REQ01/Basement"
}
 
DEL https://{{DNAC_IP}}/dna/intent/api/v1/business/sda/fabric-site?siteNameHierarchy=Global/Richfield
 
That did the basic Design... "Network Settings" provisioning I needed.  That's what I need for now, but hopefully there is a simpler way in the future.
 
 

for the record, I'm running DNAC 2.2.3.4

Review Cisco Networking for a $25 gift card