rundeck中的变量(servicename),runningservices(sshd),我想在这里传递给rundeck服务器
import requests
runningservice=sshd
headers = {
'Accept': 'application/json',
'Content-Type': 'application/json',
'X-Rundeck-Auth-Token': 'API',
}
data = '{"argString":"-servicename runningservice "}'
response = requests.post('http://IP:PORT/api/16/job/JOBID/executions', headers=headers, data=data)
您可以通过以下方式进行尝试:
具有三个选项的作业定义:
Python代码(检查数据部分):
结果:
相关问题 更多 >
编程相关推荐