Forum Discussion
NiHo_202842
Aug 19, 2015Cirrostratus
Run mkdir over iControl REST for disappearing /var/config/rest/downloads/tmp
Hello,
I am currently writing the code for automating our ssl cert deployment among other things.
I upload files to the Bigip device to shared/file-transfer/uploads/
This only works when the dir...
Aug 19, 2015
Something like this should work. This basic example is in python, using the requests module and the json module to convert the dict to json.
import requests
import json
s = requests.session()
s.auth = ('admin','admin')
s.verify = False
ip = "some.IP"
url = "/mgmt/tm/util/bash"
payload = { "command":"run",
"utilCmdArgs":"-c 'mkdir /var/config/rest/downloads/tmp'" }
resp = s.post("https://"+ip+url, data=json.dumps(payload))
print resp.text
Returns: {"kind":"tm:util:bash:runstate","utilCmdArgs":"-c 'mkdir /var/config/rest/downloads/tmp'","command":"run","commandResult":"mkdir: cannot create directory `/var/config/rest/downloads/tmp': File exists\n"}
The equivalent command in tmsh would be: run /util bash -c 'mkdir /var/config/rest/downloads/tmp'
Now I don't know how well supported this method is or if it will continue to exist, but it works for me.
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