Gilroy
Gilroy

Reputation: 326

How to Run a Rundeck Job via One-liner Curl Command with an Option Value?

I'm planning on running a one liner curl command like this:

https://rundeck.url.com/api/1/job/${job_id_here}/run?authtoken=${token_here}&Message=hello

wherein the Message is an option or if a variable inside a Rundeck job.

Upvotes: 1

Views: 5309

Answers (2)

curl -D - \
-X "POST" -H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "X-Rundeck-Auth-Token: j97rbzw19u9pT1a0JvQTcmFuzaFYW71W" \
-d "{\"argString\":\" -servername $servername -foldername $foldername \"}" \
http://192.168.43.50:4440/api/16/job/c0649a32-1264-47fd-a345-e061794b2326/executions

Upvotes: 2

MegaDrive68k
MegaDrive68k

Reputation: 4325

You can use:

curl --data-urlencode "argString=-optionname value" http://yourhost:4440/api/29/job/${your-job-id}/run?authtoken=${your-auth-token}

Upvotes: 1

Related Questions