infobloxopen / infoblox-client

Infoblox NIOS Python WAPI Client
Apache License 2.0
142 stars 104 forks source link

Add option to exclude IP's in IPAllocation.next_available_ip #377

Open KjellComputer opened 8 months ago

KjellComputer commented 8 months ago

From the examples, you can request next available IP like this:

next = objects.IPAllocation.next_available_ip_from_cidr('default', '10.0.0.0/24')

Sometimes there is a need to exclude IPs from the request, in the REST API this is possible with including in the body:

{"exclude": ["10.0.0.1","10.0.0.2","10.0.0.3"]}

This should also be a possibility with the IPAllocation.next_available_ip function, for example like this:

next = objects.IPAllocation.next_available_ip_from_cidr('default', '10.0.0.0/24', exclude={'10.0.0.1','10.0.0.2','10.0.0.3'})