- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Creating and reparenting subnets via wapi
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 01:47 PM
Hello, Im hoping some larger brains than mine can help me here.
I am trying to create networks via api. The problem that I am running in to is that if a network already exists that would be part of a larger network that gets created later, the api errors out saying that the new larger network would overlap existing networks. If you perform this same thing via the gui then it nests it as you would think it should.
Looking through the api docs I do not see any examples specifically about reparenting just a subnet into a new container. Not looking to delete any existing networks.
Any assistance would be appreciated!
Solved! Go to Solution.
Re: Creating and reparenting subnets via wapi
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-31-2023 02:20 PM
When using the API, you can distinguish between the network (subnet) and the network container. For example, if I create a 10.1.1.0/24 network using this API call:
curl -k -u admin:infoblox -H 'content-type: application/json' -X POST "https://grid-master/wapi/v2.12/network?_return_fields%2B=network&_return_as_object=1" -d '{"network": "10.1.1.0/24"}'
I can then create a 10.1.0.0/16 network container using this API call:
curl -k -u admin:infoblox -H 'content-type: application/json' -X POST "https://grid-master/wapi/v2.12/networkcontainer?_return_fields%2B=network&_return_as_object=1" -d '{"network": "10.1.0.0/16"}'
The 10.1.1.0/24 network will be reparented under the new network container.
Re: Creating and reparenting subnets via wapi
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2023 05:56 AM
It worked beautifully, thank you!