Forum Discussion
Lee_Sutcliffe
Oct 23, 2018Nacreous
You can use an asynchronous task to create a UCS using REST
From the 13.0 REST API User Guide: https://devcentral.f5.com/d/icontrolr-rest-api-user-guide-version-1300-241
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"))