Forum Discussion
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:
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)
Hi HarshadS,
Can you try this?
import requests import json url = "https://<mgmtip>/mgmt/tm/shared/sys/backup" payload = json.dumps({ "file":"myucs.ucs", "action":"RESTORE", "generation":0, "lastUpdateMicros":0 }) headers = { 'X-F5-Auth-Token': '<token>', 'Content-Type': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text)
I didn't test it.
- HarshadSAltostratus
Thanks for the reply - i think I found that my issue was the version of OS where the UCS was obtained from was different than the OS Version I was trying to import into - once I fixed that, the import worked with the same command I had.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com