07-03-2024 03:36 AM
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.
07-03-2024 03:57 AM - edited 07-03-2024 04:24 AM
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.
07-03-2024 05:58 AM
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.
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