- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
URGENT, PLEASE HELP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2019 01:06 PM
Hi Team,
I have an urgent question.
I have a question wrt API.
If I ask for next available IP from a subnet using Infoblox API and don’t create any host record against it.
Now after 5 sec , I shoot another API asking for next available IP , will I get the same IP???
My question is will the Infoblox save the IP temporarily for some time or not ?? If yes, what’s the time??
Solved! Go to Solution.
Re: URGENT, PLEASE HELP
[ Edited ]- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2019 01:56 PM - edited 09-16-2019 02:02 PM
Calling next_available_ip on a network does not reserve it for any future use. If you run next_available_ip on the same network multiuple times, you will get the same address back every time.
$ curl -k1 -u admin:infoblox -X POST 'https://192.168.1.6/wapi/v2.9/network/ZG5zLm5ldHdvcmskMTAuOS4xNi4wLzI0LzA:192.168.1.0/2/default?_function=next_available_ip' { "ips": [ "192.168.1.25" ] } $ curl -k1 -u admin:infoblox -X POST 'https://192.168.1.6/wapi/v2.9/network/ZG5zLm5ldHdvcmskMTAuOS4xNi4wLzI0LzA:192.168.1.0/2/default?_function=next_available_ip' { "ips": [ "192.168.1.25" ] } $ curl -k1 -u admin:infoblox -X POST 'https://192.168.1.6/wapi/v2.9/network/ZG5zLm5ldHdvcmskMTAuOS4xNi4wLzI0LzA:192.168.1.0/2/default?_function=next_available_ip' { "ips": [ "192.168.1.25" ] } $
To reserve it immediately against future use, you would need to create an object on that ip address, or create an object using the next_available_ip function.
Here's a host record example, which excludes the .1 address in the requested network:
curl -k1 -u admin:infoblox -H 'Content-Type: application/json' -X POST \ 'https://192.168.1.6/wapi/v2.9/record:host' -d '{"name": "test.example.org", "ipv4addrs": [{"ipv4addr": {"_object_function": "next_available_ip", "_object": "network", "_object_parameters": {"network": "192.168.1.0/24"}, "_result_field": "ips", "_parameters": {"num": 1, "exclude": ["192.168.1.1"]}}}]}'
Re: URGENT, PLEASE HELP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2019 03:29 PM
Thanks for your answer.
Can I use API asking for next available IP and in the same request pass on few IP's which Infoblox should ignore while giving me next available IP ??
Re: URGENT, PLEASE HELP
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-17-2019 04:28 AM
Yes, anything in square brackets is an array. That section would look like this:
"exclude": ["192.168.1.1","192.168.1.2","192.168.1.3"]
You could also place an exclusion range or a set of reservations in the network, to block out addresses.