Hi iasimov,
You can use an asynchronous task to create a UCS using REST
From the REST API User Guide you can try following
curl -X POST \
https://192.168.25.42/mgmt/tm/task/sys/ucs \
-H 'Content-Type: application/json' \
-H 'X-F5-Auth-Token: ABCDEFG' \
-d ' {
"command": "save",
"name": "myUcs"
} '
Using Python (3) You could use the following (code generated by Postman):
import http.client
conn = http.client.HTTPConnection("192,168,25,42")
payload = "{\"command\": \"save\",\"name\": \"myUcs\"}"
headers = {
'X-F5-Auth-Token': "ABCDEFG",
'Content-Type': "application/json",
}
conn.request("POST", "mgmt,tm,task,sys,ucs", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
https://cdn.f5.com/websites/devcentral.f5.com/downloads/icontrol-rest-api-user-guide-14-1-0.pdf
https://clouddocs.f5.com/api/
https://clouddocs.f5.com/f5-aci-servicecenter/latest/rest_api.html
https://community.f5.com/t5/technical-forum/restoring-ucs-archive-using-rest-api/td-p/297493
There could be a possibility of a known issue with BIG-IP sometimes, the UCS creation with passphrase isn't working with admin user.
https://cdn.f5.com/product/bugtracker/ID791365.html
Here is the workaround:
This affects users logged in with the Admin role; you will be able to create a UCS with a passphrase while logged in as either the root user or as a user with the resource-admin role.
If you’re looking to browse through some of the capabilities of iControl REST, here are some reference topics that will help get you on your way. The User Guide is of particular interest as it is jam packed with examples and deep dive information that should answer darn near any question you might have while getting started.