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

Adding multiple roles to device through API

trondaker
Level 1
Level 1

So we have upgraded DNA to 2.3.3.3. The API is getting better, and we are close to actually automating the whole process of migrating a vanilla switched site to a SDA fabric. However theres one API-call that i cant get to work. The "Add border"-call to add roles to devices in a fabric. Here, it now is possible to send in  ["Border_Node", "Control_Plane_Node","Edge_Node"]. This in my mind should create a fabric in a box, as we have many locations with just one 9300 and needs all roles. But, when i make the call, the device only gets the Control Plane role. The URL for this call is:

https://dnac-ip/dna/intent/api/v1/business/sda/border-device

The log on DNA after the call:

Received request to add device switchname with role(s) [ENDPOINT_PROXY, MAPSERVER, EDGENODE, BORDERNODE] to Fabric Site Global/test/testsite_Default_LAN_Fabric.

Appears to be accepted OK, but the role in the fabric for this device just has the "CP" badge, appears that the border config is just skipped. The payload looks like this:

 {
           
"deviceManagementIpAddress": 1.2.3.4,
           
"siteNameHierarchy": sitenamehierarchy,
           
"deviceRole": ["Border_Node", "Control_Plane_Node", "Edge_Node"],
           
"externalDomainRoutingProtocolName": "BGP",
           
"externalConnectivityIpPoolName": site_transit_pool,
           
"internalAutonomouSystemNumber": "66666",
           
"borderPriority": "10",
           
"connectedToInternet": True,
           
"sdaTransitNetworkName": "test-transit",
           
"borderWithExternalConnectivity": True,
           
"externalConnectivitySettings": [
                {
                   
"interfaceName": "GigabitEthernet1/1/1",
                   
"externalAutonomouSystemNumber": "66665",
                   
"l3Handoff": [
                        {
                           
"virtualNetwork": {
                               
"virtualNetworkName": "testvrf1",
                               
"vlanId": "3001"
                            }
                        }

               ]
 

        }    
    ]

Anyone gotten this to work? Just DNACenterSDK through Python to call.

1 Accepted Solution

Accepted Solutions

trondaker
Level 1
Level 1

For anyone stumbling across this, to make this call work, this is a workable payload:

[{

    "deviceManagementIpAddress": «1.1.1.1»,

    "siteNameHierarchy": "Global/Sites/Site»,

    "deviceRole": ["Border_Node", "Control_Plane_Node", "Edge_Node"],

    "externalDomainRoutingProtocolName": "BGP",

    "externalConnectivityIpPoolName": «transit_pool»,

    "internalAutonomouSystemNumber": "64666",

    "borderPriority": "10",

    "borderSessionType": "ANYWHERE",

    "connectedToInternet": "True",

    "borderWithExternalConnectivity": "True",

    "externalConnectivitySettings": [

        {

            "interfaceName": "GigabitEthernet1/1/1»,

            "externalAutonomouSystemNumber": "64667»,

            "interfaceDescription": «mandatory interface description»,

            "l3Handoff": [

                {

                    "virtualNetwork": {

                        "virtualNetworkName": «vrf1»,

                        "vlanId": "3101"

                    }

                },

                {

                    "virtualNetwork": {

                        "virtualNetworkName": «vrf2,

                        "vlanId": "3102"

                    }

                },

                {

                    "virtualNetwork": {

                        "virtualNetworkName": «vrf3»,

                        "vlanId": "3103"

                    }

                }

                }

            ]

        }

    ]

}

]

Have to be tweaked a bit to use with DnacenterSDK, but the structure works. So many quirks about this API, in this call, the booleans are no longer boolean, but strings with "True" or "False" in them. If youre using SDA-transits, check the docs for correct values, some parameters will change. 

View solution in original post

4 Replies 4

Preston Chilcote
Cisco Employee
Cisco Employee

This sounds like a possible bug to me.  Would you please open a TAC case to have them investigate?

Yea, can do. But this should work with the payload i have sent?

It didn't give you an error and told you, "Received request to add device switchname with role(s) [ENDPOINT_PROXY, MAPSERVER, EDGENODE, BORDERNODE] to Fabric Site Global/test/testsite_Default_LAN_Fabric." so that should mean the payload is ok.  The API should be user friendly, and it clearly isn't friendly enough in this case.

trondaker
Level 1
Level 1

For anyone stumbling across this, to make this call work, this is a workable payload:

[{

    "deviceManagementIpAddress": «1.1.1.1»,

    "siteNameHierarchy": "Global/Sites/Site»,

    "deviceRole": ["Border_Node", "Control_Plane_Node", "Edge_Node"],

    "externalDomainRoutingProtocolName": "BGP",

    "externalConnectivityIpPoolName": «transit_pool»,

    "internalAutonomouSystemNumber": "64666",

    "borderPriority": "10",

    "borderSessionType": "ANYWHERE",

    "connectedToInternet": "True",

    "borderWithExternalConnectivity": "True",

    "externalConnectivitySettings": [

        {

            "interfaceName": "GigabitEthernet1/1/1»,

            "externalAutonomouSystemNumber": "64667»,

            "interfaceDescription": «mandatory interface description»,

            "l3Handoff": [

                {

                    "virtualNetwork": {

                        "virtualNetworkName": «vrf1»,

                        "vlanId": "3101"

                    }

                },

                {

                    "virtualNetwork": {

                        "virtualNetworkName": «vrf2,

                        "vlanId": "3102"

                    }

                },

                {

                    "virtualNetwork": {

                        "virtualNetworkName": «vrf3»,

                        "vlanId": "3103"

                    }

                }

                }

            ]

        }

    ]

}

]

Have to be tweaked a bit to use with DnacenterSDK, but the structure works. So many quirks about this API, in this call, the booleans are no longer boolean, but strings with "True" or "False" in them. If youre using SDA-transits, check the docs for correct values, some parameters will change.