- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
Get next available network from network container and then register it via curl
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2021 06:17 AM
Hello I'm trying to get the next available /22 from a network container
curl -s -k -u userw -X GET "https://infoblox.com/wapi/v2.11/networkcontainer?network=10.0.0.0/8&_return_type=json&_max_results=1..."
When the running the above command I get the _ref but now need help to get the next available /22 and then register it with a comment. Is there a good write on this?
Re: Get next available network from network container and then register it via curl
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2021 06:41 AM
curl --location --request POST 'https://grid-master.lab.com/wapi/v2.11/network' \ --header 'Authorization: Basic YWRtaW46aW5mb2Jsb3g=' \ --header 'Content-Type: application/json' \ --data-raw '{ "network":{ "_object_function": "next_available_network", "_parameters": { "exclude": ["192.168.0.0/24","192.168.1.0/24"], "cidr":27 }, "_result_field": "networks", "_object": "networkcontainer", "_object_parameters": { "network": "192.168.0.0/16" } } }'
If there is no reason to not do it, the simpler option would probably be to create 10.0.2.0/24 network and fetch the next available /27 network within it.
If you want to query the next available networks in a network container, you can do using the following call:
curl --location --request POST 'https://grid-master.lab.com/wapi/v2.11/networkcontainer/ZG5zLm5ldHdvcmtfY29udGFpbmVyJDE5Mi4xNjguMC4wLzE2LzA:192.168.0.0/16/default?_function=next_available_network' \ --header 'Authorization: Basic YWRtaW46aW5mb2Jsb3g=' \ --header 'Content-Type: application/json' \ --data-raw '{ "cidr":27, "num":20 }'
Re: Get next available network from network container and then register it via curl
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-19-2021 06:53 AM
Found another post on how to get next available network, just need one to register