cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
261
Views
0
Helpful
2
Replies

Cisco DNA: array POST Rest AP

Hello guys.

I'm trying to perform a POST Rest API toward Cisco DNAC (Catalyst Center).

The body it's like that:

 

 

 

 

[
    {
        "name": "Pool-1",
        "type": "Generic",
        "ipv4GlobalPool": "10.0.0.0/8",
        "ipv4PrefixLength": 24,
        "ipv4Subnet": "x.x.x.x",
        "ipv4GateWay": "x.x.x.x",
        "ipv4DhcpServers": [
            "x.x.x.x",
            "x.x.x.x"
        ],
        "ipv4DnsServers": [
            "x.x.x.x",
            "x.x.x.x"
        ]
    },
    {
        "name": "Pool-2",
        "type": "Generic",
        "ipv4GlobalPool": "10.0.0.0/8",
        "ipv4PrefixLength": 24,
        "ipv4Subnet": "x.x.x.x",
        "ipv4GateWay": "x.x.x.x",
        "ipv4DhcpServers": [
            "x.x.x.x",
            "x.x.x.x"
        ],
        "ipv4DnsServers": [
            "x.x.x.x",
            "x.x.x.x"
        ]
    }
]

 

 

 

 

Basically, not work.

base URL: dna/intent/api/v1/reserve-ip-subpool/

My question: The array not working for this POST base url?

Thanks a lot.

2 Replies 2

Torbjørn
Spotlight
Spotlight

Which version of Catalyst Center are you running, and what response are you getting? Are you appending the correct site ID to the path?

Using a list as the root object doesn't work assuming that you are using 2.3.5 or 2.3.6 (I haven't checked the others, but I don't imagine that they would be much different). You will have to do one call per subpool to be reserved. You must also specify ipv4Prefix (boolean) for each subpool.

Happy to help! Please mark as helpful/solution if applicable.
Get in touch: https://torbjorn.dev

To add on to what Torbjorn stated, you are missing a couple of required fields like "ipv6AddressSpace", which is a required boolean field. Also, your API is missing the site id that the sub pool would be reserved to at the end of the query. If you would like to see the design structure you can go to the UI of the Catalyst Center and then Menu -> Platform -> Developer Toolkit. Then in the mid-right of the screen you can search the available APIs for "Reserve IP Subpool" and click on that API. It will show you the expected and optional schema model for the API call.