Этот пример кода python можно использовать для передачи любого значения любым параметрам задания Rundeck. Просто измените «строковые» переменные на свои значения из любого источника (другой вызов API, fuzzytable output, et c).
import requests
# host definition
rdeck_instance = "localhost"
rdeck_port = "4440"
rdeck_api = "35"
rdeck_token = "lL4CwBiHHmxirZtTUHDJEHu4ZGTontjX"
jobid = "f68e73cb-54e5-483e-b451-b7ae484c54fe"
# variable strings (for testing, in this case, you can put from the result from any source: another API call, fuzzy table output, etc.)
string1="one"
string2="two"
string3="three"
s = requests.Session()
r = s.post("http://" + rdeck_instance + ":" + rdeck_port +"/api/" + rdeck_api + "/job/" + jobid + "/run?authtoken=" + rdeck_token,
headers = {"Accept" : "application/json"},
data = { "argString" : "-opt1 {} -opt2 {} -opt3 {}".format(string1, string2, string3)})
# print data (for debug)
print ('######################')
print (r.status_code)
print (r.url)
print ('######################')
# json response
print(r.json())