Python
python3
rundeck

RUNDECKのジョブをAPI経由でオプション指定して実行(Python)

import requests

api_token = 'XXXXXXXXXXXXXXX'
base_url = "https://www.example.com:8888"
job_id = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXXX"
url = base_url + "/api/12/job/" + job_id + "/executions"

headers = {'X-Rundeck-Auth-Token': api_token}

# messageという名前のオプションにHELLOを指定する場合
payload = {"argString": "-message HELLO"}

response = requests.post(url, headers=headers, data=payload)
print(response.status_code)
print(response.text)