06-06-2023 09:51 AM
Hello All,
New to NDFC. Trying to use the API to create a network via postman. I have been unsuccessful to this point. I can login. I can get a list of existing network, but cannot create a network. May be my stupidity. Hopefully someone can point in in the right direction to understand creating/attaching/deploying a network from the API. Using postman for now.
The GUI screenprints in https://developer.cisco.com/docs/nexus-dashboard-fabric-controller/latest/#!introduction
do not match my NDFC 12.1.2e install. Is there an update to this doc pending?
Where * is listed, its a required field and where it is not listed its an optional field? When i post the example code for creating a network with only the * data, its fails. Though the graphic implies they are all required.
watching the video shows a subset are required.
The json body has a networkTemplateConfig. This is looks to be a json string. Where can i find details about what are list of keys that can be put into this field.
https://www.youtube.com/watch?v=Dg5FuiqFAKg
(I dont see a label for NDFC for posting this message, used orchestrator.)
06-06-2023 10:04 AM
Also, where i find more details on the attach api. Swagger has no details on what is a valid list for the lanAttachList. Also, the login api has arrows to show the expected response field. for NDFC, this is not available.
06-06-2023 10:39 AM
For me, the minimum to post was the following via the form. this output is captured in the chrome inspect output. Posting the same via the json form generates an error with the following details.
{
"fabric": "NDFC",
"networkName": "Test5",
"displayName": "Test5",
"networkId": 30405,
"networkTemplate": "Default_Network_Universal",
"networkExtensionTemplate": "Default_Network_Extension_Universal",
"vrf": "CVS_VRF",
"type": "Normal"
}
06-06-2023 11:09 AM
Interesting...I didnt need the networkTemplateConfig field in early testing or didnt see it in the json code but stated to fail without it.
Note: On additional testing, if no data is put in the networkTemplateConfig, it is excluded from the JSON payload. If its added, pushed, then field is cleared, and pushed. The key is still present but with an empty string. This is seen in chrome inspect tool.
{
"fabric": "NDFC",
"networkName": "T21",
"displayName": "T21",
"networkId": 30221,
"networkTemplate": "Default_Network_Universal",
"networkExtensionTemplate": "Default_Network_Extension_Universal",
"vrf": "CVS_VRF",
"type": "Normal",
"networkTemplateConfig": ""
}
06-06-2023 01:00 PM
On the topic of the networkTemplateConfig field in creating a network, are the column titles of a network export the keys of the fields that can be passed in via the networkTemplateConfig field?
fabric,vrf,displayName,networkId,networkTemplate,networkExtensionTemplate,networkName,secondaryGW3,suppressArp,secondaryGW2,secondaryGW1,loopbackId,enableL3OnBorder,type,SVI_NETFLOW_MONITOR,enableIR,rtBothAuto,isLayer2Only,ENABLE_NETFLOW,dhcpServerAddr3,gatewayIpV6Address,dhcpServerAddr2,tag,nveId,secondaryGW4,vlanId,gatewayIpAddress,vlanName,mtu,intfDescription,mcastGroup,trmEnabled,VLAN_NETFLOW_MONITOR,dhcpServers
06-06-2023 02:12 PM
[
{
"networkName": "T23",
"lanAttachList": [
{
"fabric": "SDC-NDFC",
"networkName": "T23",
"serialNumber": "xxxxxxxxxxxxxxx",
"switchPorts": "",
"detachSwitchPorts": "Ethernet1/1",
"torPorts": "",
"vlan": 23,
"dot1QVlan": 1,
"untagged": false,
"freeformConfig": "",
"deployment": true,
"extensionValues": "",
"instanceValues": "{}"
}
]
}
]
used to detach...use the detachSwitchPorts key
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