/** * Registers a script Health Check with the Agent. * * @param checkId The Check ID to use. Must be unique for the Agent. * @param name The Check Name. * @param script Health script for Consul to use. * @param interval Health script run interval in seconds. */ public void registerCheck(String checkId, String name, String script, long interval) { registerCheck(checkId, name, script, interval, null); }
/** * Registers an HTTP Health Check with the Agent. * * @param checkId The Check ID to use. Must be unique for the Agent. * @param name The Check Name. * @param http Health check URL. * @param interval Health script run interval in seconds. */ public void registerCheck(String checkId, String name, URL http, long interval) { registerCheck(checkId, name, http, interval, null); }
/** * Registers a TCP Health Check with the Agent. * * @param checkId The Check ID to use. Must be unique for the Agent. * @param name The Check Name. * @param tcp Health check TCP host and port. * @param interval Health script run interval in seconds. */ public void registerCheck(String checkId, String name, HostAndPort tcp, long interval) { registerCheck(checkId, name, tcp, interval, null); }
/** * Registers a Health Check with the Agent. * * @param checkId The Check ID to use. Must be unique for the Agent. * @param name The Check Name. * @param ttl Time to live for the Consul dead man's switch. */ public void registerCheck(String checkId, String name, long ttl) { registerCheck(checkId, name, ttl, null); }
/** * Registers a script Health Check with the Agent. * * @param checkId The Check ID to use. Must be unique for the Agent. * @param name The Check Name. * @param args Specifies command argument to run to update the status of the check. * @param interval Health script run interval in seconds. * @param notes Human readable notes. Not used by Consul. */ public void registerCheck(String checkId, String name, String args, long interval, String notes) { Check check = ImmutableCheck.builder() .id(checkId) .name(name) .args(Collections.singletonList(args)) .interval(String.format("%ss", interval)) .notes(Optional.ofNullable(notes)) .build(); registerCheck(check); }
/** * Registers a Health Check with the Agent. * * @param checkId The Check ID to use. Must be unique for the Agent. * @param name The Check Name. * @param ttl Time to live for the Consul dead man's switch. * @param notes Human readable notes. Not used by Consul. */ public void registerCheck(String checkId, String name, long ttl, String notes) { Check check = ImmutableCheck.builder() .id(checkId) .name(name) .ttl(String.format("%ss", ttl)) .notes(Optional.ofNullable(notes)) .build(); registerCheck(check); }
/** * Registers a HTTP Health Check with the Agent. * * @param checkId The Check ID to use. Must be unique for the Agent. * @param name The Check Name. * @param http Health check URL. * @param interval Health script run interval in seconds. * @param notes Human readable notes. Not used by Consul. */ public void registerCheck(String checkId, String name, URL http, long interval, String notes) { Check check = ImmutableCheck.builder() .id(checkId) .name(name) .http(http.toExternalForm()) .interval(String.format("%ss", interval)) .notes(Optional.ofNullable(notes)) .build(); registerCheck(check); }
/** * Registers a script Health Check with the Agent. * * @param checkId The Check ID to use. Must be unique for the Agent. * @param name The Check Name. * @param args Health script for Consul to use. * @param interval Health script run interval in seconds. * @param notes Human readable notes. Not used by Consul. */ public void registerCheck(String checkId, String name, List<String> args, long interval, String notes) { Check check = ImmutableCheck.builder() .id(checkId) .name(name) .args(args) .interval(String.format("%ss", interval)) .notes(Optional.ofNullable(notes)) .build(); registerCheck(check); }
/** * Registers a TCP Health Check with the Agent. * * @param checkId The Check ID to use. Must be unique for the Agent. * @param name The Check Name. * @param tcp Health check TCP host and port. * @param interval Health script run interval in seconds. * @param notes Human readable notes. Not used by Consul. */ public void registerCheck(String checkId, String name, HostAndPort tcp, long interval, String notes) { Check check = ImmutableCheck.builder() .id(checkId) .name(name) .tcp(tcp.toString()) .interval(String.format("%ss", interval)) .notes(Optional.ofNullable(notes)) .build(); registerCheck(check); }