def enable_survey(tower_config, job_template_id):
url = 'https://{0}/api/v1/job_templates/{1}/'.format(
tower_config['host'],
job_template_id)
headers = {'Content-type': 'application/json'}
response = requests.patch(
url,
verify=False,
auth=(tower_config['username'], tower_config['password']),
headers=headers,
data=json.dumps({
'survey_enabled': True}))
if response.status_code != 200:
exit_failure('error enabling job template survey')
add-user-survey.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录