cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

This community is for technical, feature, configuration and deployment questions.
For production deployment issues, please contact the TAC!

Register for the monthly Cisco DNA Center Ask the Expert Sessions to learn about Cisco DNA Center configuration and deployment.
333
Views
0
Helpful
4
Replies
Highlighted

DNA-C API - Get all fabric-sites

I want to retrieve an overview of all fabric sites using DNA-C API. But where I can get an overview of all sites using a get request on https://{controller_ip}/dna/intent/api/v1/site, I can't get an overview of all fabrics using https://{controller_ip}/dna/intent/api/v1/business/sda/fabric. It looks like a siteNameHierarchy is required. But how do I retrieve that siteNameHierarchy if there is no top level request? Or am I totally searching into the wrong direction?

 

Best regards,

 

Chris Donkelaar

-If I helped you somehow, please, rate it as useful.-
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

I don't see a direct API to get all fabric sites. So, what you can potentially do is find all sites using the 'https://<DNAC_IP_address>/dna/intent/api/v1/site' API, retrieve the relevant site hierarchies from here and then feed each site hierarchy combination into the fabric site API 'https://<DNAC_IP_address>/dna/intent/api/v1/business/sda/fabric' to determine if it is a fabric site or not.

View solution in original post

4 REPLIES 4
Highlighted
Cisco Employee

I don't see a direct API to get all fabric sites. So, what you can potentially do is find all sites using the 'https://<DNAC_IP_address>/dna/intent/api/v1/site' API, retrieve the relevant site hierarchies from here and then feed each site hierarchy combination into the fabric site API 'https://<DNAC_IP_address>/dna/intent/api/v1/business/sda/fabric' to determine if it is a fabric site or not.

View solution in original post

Highlighted

Thank you @Aninda Chatterjee, this does indeed verify if sites are also fabric sites, and it does respond with a fabricName item. But when you still have empty fabrics, you're basically screwed? Do you know if any API call is in development to escape reverse engineering this way?

-If I helped you somehow, please, rate it as useful.-
Highlighted

I don't think there's an API in development specifically for this, but I can check. What is your end goal here? Is it just to determine which sites are fabric sites?

 

Cheers,

Aninda

Highlighted

Automated fabric creation, so build it all (fabric, site, VNs, devices, etc) from one or a couple of scripts with some input file. And also to get info from DNA-C, such as fabric, and then select the fabric as new input to get all the fabric-sites related, etc.

-If I helped you somehow, please, rate it as useful.-
Content for Community-Ad