Forum Discussion
Call TMSH script with a curl command?
I am trying to allow some users access to a simple TMSH script on our GTM's. I've looked through various documents and I can't find exactly what I need. Has anyone done this, and if so can you provide an example? Or point me to the right documentation. I would need to call the script, and pass it 2 or 3 parameters.
Thanks in advance. Jeff
5 Replies
- ekaleido
Cirrus
What command do you want to run?
- Jeff_41411
Altocumulus
It's a custom TMSH script that I would like to execute. I'm really looking for the general procedure to call any script in that manner.
Thanks, Jeff
- ekaleido
Cirrus
You can't, but there's a good chance the commands can be executed via REST calls. That's why I was curious what command(s) you were wanting to run, I could potentially offer up the REST call.
- Jeff_41411
Altocumulus
I'm open to any suggestions on how this could be done. The developers asked about using curl, but they would be open to other alternatives. Can you demonstrate what that might look like using a REST call?
Thanks
- R_Marc
Nimbostratus
I think you need a 11.6 or better, but here's an example:
curl -sk -u 'admin:admin' -H "Content-Type: application/json" -X POST https://localhost/mgmt/tm/util/bash -d "{\"command\":\"run\",\"utilCmdArgs\":\"-c 'tmsh list sys crypto csr test.csr'\"}" | python -m json.tool
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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