01-20-2023 11:47 AM
I am trying to use the NDFC API to create some networks (I have a lot to create and am trying to automate).
Creating networks from the GUI is straightforward. (In the fabric -> Actions -> Create Network)
But from the API, I basically can't figure out how to do it.
I think the endpoint I need is "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/top-down/v2/fabrics/{fabric-name}/networks" .
But this doesn't take certain fields that the GUI takes, for example, IPv4 Gateway, Description, VLAN Name, etc.
Is there another endpoint to use in combination with this? Or does anyone have an example of how they did it?
Documentation is very dry and doesn't really explain things.
I am using python for this.
This is what the endpoint above is expecting, but as you can see, it doesn't have all that the GUI has, and is even is expecting some things the GUI doesn't ask for.
{
"fabric": "string",
"networkName": "string",
"displayName": "string",
"networkId": 0,
"networkTemplate": "string",
"networkExtensionTemplate": "string",
"networkTemplateConfig": "string",
"vrf": "string",
"tenantName": "string", <---No idea what this is referencing
"serviceNetworkTemplate": "string", <---Not sure why you need this, I'm not creating service networks
"interfaceGroups": "string",
"hierarchicalKey": "string" <---No idea what this is referencing
}
Thanks!!
Solved! Go to Solution.
02-02-2023 09:10 PM
Hi Jeremy,
As you already found, all supported NDFC REST APIs are posted at https://developer.cisco.com/docs/nexus-dashboard-fabric-controller/latest/#!api-reference-lan
I also noticed there's no any information/parameter of Network - IPv4 Gateway, Description, VLAN Name included yet.
So I don't think we could configure these info with API for now.
And for the meaning of some fields you mentioned, an easy way to check that information you can try use GET method for an existing Network object, then you will get some related information on that.
For creating Network, you could leave other fields empty, just input the fabric name, then have a try.
Hope this helps.
If you find my reply solved your question or issue, kindly click the 'Accept as Solution' button and vote it as helpful.
You can also learn more about Cisco NDFC through our live Ask the Experts (ATXs) session. Check out this ATXs Resources [https://community.cisco.com/t5/data-center-and-cloud-knowledge/cisco-aci-ask-the-experts-resources/ta-p/4394491] to view the latest schedule for upcoming sessions, as well as the useful references, e.g. online guides, FAQs.
Thanks,
John
02-02-2023 09:10 PM
Hi Jeremy,
As you already found, all supported NDFC REST APIs are posted at https://developer.cisco.com/docs/nexus-dashboard-fabric-controller/latest/#!api-reference-lan
I also noticed there's no any information/parameter of Network - IPv4 Gateway, Description, VLAN Name included yet.
So I don't think we could configure these info with API for now.
And for the meaning of some fields you mentioned, an easy way to check that information you can try use GET method for an existing Network object, then you will get some related information on that.
For creating Network, you could leave other fields empty, just input the fabric name, then have a try.
Hope this helps.
If you find my reply solved your question or issue, kindly click the 'Accept as Solution' button and vote it as helpful.
You can also learn more about Cisco NDFC through our live Ask the Experts (ATXs) session. Check out this ATXs Resources [https://community.cisco.com/t5/data-center-and-cloud-knowledge/cisco-aci-ask-the-experts-resources/ta-p/4394491] to view the latest schedule for upcoming sessions, as well as the useful references, e.g. online guides, FAQs.
Thanks,
John
06-07-2023 08:46 AM
https://www.youtube.com/watch?v=Dg5FuiqFAKg
I found the about to be useful.
I have been able to create networks via postman with the following url and body..
https://{{nd}}/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/top-down/fabrics/{{fabric-name}}/networks
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide