def add_check(module, check):
 if ((not check.name) and (not service_id)):
  module.fail_json(msg='a check name is required for a node level check, one not attached to a service')
 consul_api = get_consul_api(module)
 check.register(consul_api)
 module.exit_json(changed=True, check_id=check.check_id, check_name=check.name, script=check.script, interval=check.interval, ttl=check.ttl, http=check.http, timeout=check.timeout, service_id=check.service_id)

def add_check ( module , check ) : if ( ( not check . name ) and ( not service_id ) ) : module . fail_json ( msg = 'a check name is required for a node level check, one not attached to a service' ) consul_api = get_consul_api ( module ) check . register ( consul_api ) module . exit_json ( changed = True , check_id = check . check_id , check_name = check . name , script = check . script , interval = check . interval , ttl = check . ttl , http = check . http , timeout = check . timeout , service_id = check . service_id )
registers a check with the given agent .