feat: add ip module for automated free IP discovery in agent pool
This commit is contained in:
parent
064144134e
commit
a6f61ad2ac
3 changed files with 58 additions and 7 deletions
|
|
@ -162,6 +162,31 @@ def dns_list(config):
|
|||
click.echo(data['hosts'])
|
||||
click.echo(data['dns'])
|
||||
|
||||
@cli.group()
|
||||
def ip():
|
||||
"""Manage and discover available IP addresses"""
|
||||
pass
|
||||
|
||||
@ip.command(name='list-free')
|
||||
@click.option('--count', default=5, help='Number of free IPs to show')
|
||||
@click.pass_obj
|
||||
def ip_list_free(config, count):
|
||||
mgr = DNSManager(config)
|
||||
free = mgr.get_free_ips()
|
||||
for ip in free[:count]:
|
||||
click.echo(ip)
|
||||
|
||||
@ip.command(name='next-free')
|
||||
@click.pass_obj
|
||||
def ip_next_free(config):
|
||||
mgr = DNSManager(config)
|
||||
free = mgr.get_free_ips()
|
||||
if free:
|
||||
click.echo(free[0])
|
||||
else:
|
||||
click.echo("Error: No free IPs in agent pool!", err=True)
|
||||
sys.exit(1)
|
||||
|
||||
@cli.group()
|
||||
def ingress():
|
||||
"""Manage HAProxy Ingress"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue