Change name and add skip for uptime

This commit is contained in:
SebClem 2024-03-29 11:59:32 +01:00
parent 7d49ce1ce3
commit 5165f9d704
Signed by: sebclem
GPG Key ID: 5A4308F6A359EA50

View File

@ -232,13 +232,13 @@ class ActionModule(ActionBase):
"target": dns_target,
"state": state,
})
results['uptime_config'].append({
"name": main_hostname,
"url": 'https://{0}.{1}/{2}'.format(main_hostname, domain, uptime_raw_config.get("endpoint", "")),
"protected": protected,
"state": uptime_raw_config.get("state", state)
})
if not uptime_raw_config.get('skip', False):
results['uptime_config'].append({
"name": '{0}.{1}'.format(main_hostname, domain),
"url": 'https://{0}.{1}/{2}'.format(main_hostname, domain, uptime_raw_config.get("endpoint", "")),
"protected": protected,
"state": uptime_raw_config.get("state", state)
})
for host in additionnal_hostname:
@ -266,10 +266,11 @@ class ActionModule(ActionBase):
"target": this_dns_target,
"state": this_state
})
results['uptime_config'].append({
"name": host.get("hostname"),
"url": 'https://{0}/{1}'.format(full_domain, this_uptime_raw_config.get("endpoint", "")),
"protected": this_protected,
"state": this_uptime_raw_config.get("state", this_state)
})
if not this_uptime_raw_config.get('skip', uptime_raw_config.get('skip', False)):
results['uptime_config'].append({
"name": host.get("full_domain"),
"url": 'https://{0}/{1}'.format(full_domain, this_uptime_raw_config.get("endpoint", "")),
"protected": this_protected,
"state": this_uptime_raw_config.get("state", this_state)
})
return failed, err_msg, results