Reply

Creating and reparenting subnets via wapi

New Member
Posts: 2
3043     0

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!

Re: Creating and reparenting subnets via wapi

Superuser
Posts: 65
3044     0

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

New Member
Posts: 2
3044     0

It worked beautifully, thank you!

Showing results for 
Search instead for 
Did you mean: 

Recommended for You

Businesses are investing heavily into securing company resources from cyber-attacks form cybercrimin