cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1140
Views
0
Helpful
4
Replies

DNA-C API - Get all fabric-sites

Chris Donkelaar
Level 1
Level 1

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

Aninda Chatterjee
Cisco Employee
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

Aninda Chatterjee
Cisco Employee
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.

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

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

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.-
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: