03-25-2022 03:43 PM
The following Python code works to reserve the next available IP excluding a list of IPs (though I would prefer to use a range vs individual IPs).
What doesn't work is having it reserve\return multiple IPs. I believe I am adding the Num: parameter in the correct place, but it still only reserves 1.
I am also curious how this call might actually return the subnet ref object name, so I could use that to grab the router, dns, and other option info in a subesquent call.
Thanks for any help!
'_object' : 'network',
requests.post(ibx_ip_request_url, auth=(ibx_user, ibx_pass), json=body, headers=ibx_headers, verify=False
03-31-2022 12:28 PM
It looks like you are trying to run the function against a Host object. "nextavailableip" is a function of the network object. And I believe the "exclude" parameter needs to be an array (list) of IP addresses. Regardless of how many IP addresses you request, the result should be an array (list) that looks like this:
04-04-2022 09:37 AM
Thanks for the reply. I should have written it better. The script works for everything but getting multiple IPs. I'm passing in the host name, exclude list (which is a list of 20 IPs), requested subnet, wapi url and headers.
The primary question I have is where to put the "num" parameter to get more than one IP for a given host. In its current form I get no error and do get the next IP in the subnet after the exclusion list.
Examples of the objects I'm passing in for clarity
host_name = 'server01.domain.com'
exclude_ip = ['192.168.0.1','192.168.0.2']
network = '192.168.0.0/24'
should return 192.168.0.3, - .7
04-05-2022 07:50 AM
The 'num' should be part of the parameter, so your original code should work. The following curl command works for me (swap out xxxx with your network reference):
$ curl -k -u admin:infoblox -H 'Content-Type:application/json' -X POST \