Forum Discussion
yuanqiang_22112
Nimbostratus
Oct 23, 2018use rest api create ucs archive
Hello:
I want to use rest api create ucs archive ,and send to my external storage ; Can you give me the python code .
import requests
import json
import urllib3
urllib3.disable_warnings() ...
Lee_Sutcliffe
Nacreous
Oct 23, 2018You 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"))
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects