HarshadS
Jun 28, 2022Altostratus
Restoring UCS archive using REST API
Hi,
I was trying to figure out how to load an already uploaded UCS archive on bigip ltm using the rest API. The UCS file exists in /var/local/ucs and I'm trying to load it as shown below in the code sample but getting this as response:
{
"code": 400,
"message": "UCS loading process failed.",
"errorStack": [],
"apiError": 26214401
}
Any ideas what I'm doing wrong?
import requests
import json
url = "https://<mgmtip>/mgmt/tm/sys/ucs"
payload = json.dumps({
"command": "load",
"name": "/var/local/ucs/myucsfile.ucs"
})
headers = {
'X-F5-Auth-Token': '<token>',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)