update to not require a 'load balancer' section
This commit is contained in:
parent
a21d71cb62
commit
3b677cd582
@ -187,10 +187,9 @@ def commitRecord(ip):
|
|||||||
|
|
||||||
|
|
||||||
def updateLoadBalancer(ip):
|
def updateLoadBalancer(ip):
|
||||||
|
try:
|
||||||
for option in config["load_balancer"]:
|
for option in config["load_balancer"]:
|
||||||
pools = cf_api('user/load_balancers/pools', 'GET', option)
|
pools = cf_api('user/load_balancers/pools', 'GET', option)
|
||||||
|
|
||||||
if pools:
|
if pools:
|
||||||
name = option['origin']
|
name = option['origin']
|
||||||
idxr = dict((p['id'], i) for i, p in enumerate(pools['result']))
|
idxr = dict((p['id'], i) for i, p in enumerate(pools['result']))
|
||||||
@ -207,6 +206,9 @@ def updateLoadBalancer(ip):
|
|||||||
|
|
||||||
print("📡 Updating LB Pool: " + name)
|
print("📡 Updating LB Pool: " + name)
|
||||||
response = cf_api(f'user/load_balancers/pools/{option["pool_id"]}', 'PATCH', option, {}, data)
|
response = cf_api(f'user/load_balancers/pools/{option["pool_id"]}', 'PATCH', option, {}, data)
|
||||||
|
except:
|
||||||
|
print("No load balancer section found")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def cf_api(endpoint, method, config, headers={}, data=False):
|
def cf_api(endpoint, method, config, headers={}, data=False):
|
||||||
|
|||||||
Reference in New Issue
Block a user