/** * 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); }
args(argsOptional);
/** * 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); }
builder.args(json.args);