cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
780
Views
0
Helpful
5
Replies

Need more clarity on create NDFC network from API call.

dan.laden
Level 1
Level 1

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.

danladen_0-1686069285508.png

watching the video shows a subset are required.

danladen_1-1686069934251.png

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

5 Replies 5

dan.laden
Level 1
Level 1

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.

danladen_0-1686070758615.png

danladen_1-1686071051123.png

 

 

dan.laden
Level 1
Level 1

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"
}

 

 

danladen_4-1686073132748.png

 

danladen_3-1686073007013.png

 

 

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": ""
}

dan.laden
Level 1
Level 1

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

 

 

dan.laden
Level 1
Level 1

[
{
"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