Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
KjellComputer opened this issue Feb 28, 2024 · 0 comments
Open

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

KjellComputer opened this issue Feb 28, 2024 · 0 comments

Comments

@KjellComputer
Copy link

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'})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant