Hello,
I'd like to set the boot partition on our controllers using the API (we have quite a lot of controllers so it's easiier than doing it by hand, and I'd prefer to use the API than script SSH CLI commands), but I'm not sure I can see a way of doing it. There's /object/config_boot_partition but the wording sounds a bit odd:
"Create a new instance or update existing instance or delete parts of the instance or full object of type config_boot_partition"
Will this do what I want? I tried it out and nothing happened but it's more than possible I'm doing something wrong (my Python scripting skills are pretty basic)?:
def set_ctlr_boot_partition(host,uid,part):
hostname = host
uidaruba = uid
part_num = str("partition"+part)
url = f"https://{hostname}:4343/v1/object/config_boot_partition"
payload = {
"verbose": True,
"test_type": "fast",
"partition_num": part_num
}
headers = {"Content-Type": "application/json",
"Accept" : "application/json",
"Cookie" : f"SESSION={uid}",
}
response = requests.request("POST", url, json=payload, headers=headers, verify=False)
print(response.raise_for_status())
return response
The API reference on the developer site doesn't seem to include this particular call so I can't verify my function is correct. response.raise_for_status() returns 'None'.
I'd also like to be able to reload controllers via the API, there's an /object/reload call but again the language is a bit ambiguous:
"Create a new instance or update existing instance or delete parts of the instance or full object of type reload"
Any advice appreciated.
Guy