Forum Discussion
Tim_Harber
Feb 08, 2017Cirrus
Running BASH commands via REST API
I am trying to run bash commands via the REST API but am getting an error. When trying to use the following syntax I am getting a 403 running with Admin authentication...
GET: https://F5LTM/mgmt/tm...
Kai_Wilke
Feb 08, 2017MVP
Hi Tim,
try these Postman settings...
Request Settings:
Method: POST
URL: https://YOURBOX/mgmt/tm/util/bash
Authorization: BasicAuth = YourCredentials
Headers: Content-Type = application/json
Body: {"command":"run","utilCmdArgs":"-c 'echo \"Hello World\"'"}
Note: You can also set the Content-Type on Postmans "Body" pane. Click on the down arrow to see the predifined JSON setting...
Expected Result:
{
"kind": "tm:util:bash:runstate",
"command": "run",
"utilCmdArgs": "-c 'echo \"Hello World\"'",
"commandResult": "Hello World\n"
}
Cheers, Kai
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