|
@@ -118,6 +118,23 @@ def main():
|
|
|
break
|
|
|
net_obj = org.create_network(nname, **nargs)
|
|
|
|
|
|
+ if "client_limit" in network:
|
|
|
+ if not isinstance(network["client_limit"], int) or network["client_limit"] < 0:
|
|
|
+ print(
|
|
|
+ "{}Client limit for network {} must be an integer greater than or equal to 0!{}".format(
|
|
|
+ Fore.RED, nname, Style.RESET_ALL
|
|
|
+ )
|
|
|
+ )
|
|
|
+ nerrors += 1
|
|
|
+ continue
|
|
|
+
|
|
|
+ shape_ret = net_obj.apply_shaping(network["client_limit"])
|
|
|
+ if shape_ret:
|
|
|
+ print("{}update: added traffic shaping to network {}{}".format(Fore.YELLOW, nname, Style.RESET_ALL))
|
|
|
+ else:
|
|
|
+ print("{}Error adding shaping to network {}!{}".format(Fore.RED, nname, Style.RESET_ALL))
|
|
|
+ nerrors += 1
|
|
|
+
|
|
|
if net_obj is None:
|
|
|
print("{}Error creating new network {}!{}".format(Fore.RED, nname, Style.RESET_ALL))
|
|
|
errors += 1
|
|
@@ -188,9 +205,13 @@ def main():
|
|
|
|
|
|
dev_location = network["address"]
|
|
|
dev_name = dev["name"]
|
|
|
+ dparams = {}
|
|
|
if "location" in dev:
|
|
|
dev_location += "\n" + dev["location"]
|
|
|
- dev_obj.update_device(name=dev_name, address=dev_location, move_map_marker=True)
|
|
|
+ dparams["address"] = dev_location
|
|
|
+ if "tags" in dev:
|
|
|
+ dparams["tags"] = dev["tags"]
|
|
|
+ dev_obj.update_device(name=dev_name, move_map_marker=True, **dparams)
|
|
|
print("{}update: updated {} name and location{}".format(Fore.YELLOW, inv_dev[0]["serial"], Style.RESET_ALL))
|
|
|
|
|
|
else:
|
|
@@ -254,7 +275,7 @@ def main():
|
|
|
for sname, ssid in network["ssids"].items():
|
|
|
ssid_obj = SSID(key=config["api_key"], id=si, name=sname, net=net_obj)
|
|
|
sargs = {}
|
|
|
- for key in ["name", "enabled", "auth_mode", "encryption_mode", "psk", "ip_assignment_mode"]:
|
|
|
+ for key in ["name", "enabled", "auth_mode", "encryption_mode", "psk", "ip_assignment_mode", "tags"]:
|
|
|
if key in ssid:
|
|
|
sargs[key] = ssid[key]
|
|
|
res = ssid_obj.update_ssid(**sargs)
|