Class CheckOptions
java.lang.Object
io.vertx.ext.consul.CheckOptions
Options used to register checks in Consul.
- Author:
- Ruslan Sennov
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorCheckOptions(JsonObject options) Constructor from JSONCheckOptions(CheckOptions options) Copy constructor -
Method Summary
Modifier and TypeMethodDescriptionGet deregister timeoutgetGrpc()Specifies a gRPC check's endpoint that supports the standard gRPC health checking protocol.Get header mapgetHttp()Get HTTP addressgetId()Get check IDGet checking intervalgetName()Get check namegetNotes()Get check notesGet scriptArgsGet the service ID to associate the registered check with an existing service provided by the agent.Get the check status to specify the initial state of the health check.getTcp()Get TCP address.getTtl()Get Time to Live of checkbooleanSpecifies whether to use TLS for this gRPC health check.booleanSpecifies if the certificate for an HTTPS check should not be verified.setDeregisterAfter(String deregisterAfter) Set deregister timeout.Specifies a gRPC check's endpoint that supports the standard gRPC health checking protocol.setGrpcTls(boolean grpcTls) Specifies whether to use TLS for this gRPC health check.setHeaders(Map<String, List<String>> header) Set headers to checkSet HTTP address to check.Set check IDsetInterval(String interval) Set checking intervalSet check name.Set check notessetScriptArgs(List<String> scriptArgs) Set scriptArgs.setServiceId(String serviceId) Set the service ID to associate the registered check with an existing service provided by the agent.setStatus(CheckStatus status) Set the check status to specify the initial state of the health check.Set TCP address to check.setTlsSkipVerify(boolean tlsSkipVerify) Specifies if the certificate for an HTTPS check should not be verified.Set Time to Live of check.toJson()Convert to JSON
-
Constructor Details
-
CheckOptions
public CheckOptions()Default constructor -
CheckOptions
-
CheckOptions
-
-
Method Details
-
toJson
-
getServiceId
Get the service ID to associate the registered check with an existing service provided by the agent.- Returns:
- the service ID
-
setServiceId
Set the service ID to associate the registered check with an existing service provided by the agent.- Parameters:
serviceId- the service ID- Returns:
- reference to this, for fluency
-
getStatus
Get the check status to specify the initial state of the health check.- Returns:
- the check status
-
setStatus
Set the check status to specify the initial state of the health check.- Parameters:
status- the check status- Returns:
- reference to this, for fluency
-
getScriptArgs
-
setScriptArgs
Set scriptArgs. Also you should set checking interval- Parameters:
scriptArgs-- Returns:
- reference to this, for fluency
-
getHttp
-
setHttp
Set HTTP address to check. Also you should set checking interval- Parameters:
http- HTTP address- Returns:
- reference to this, for fluency
-
getHeaders
-
setHeaders
Set headers to check- Parameters:
header- header map- Returns:
- reference to this, for fluency
-
getGrpc
Specifies a gRPC check's endpoint that supports the standard gRPC health checking protocol. The state of the check will be updated at the given Interval by probing the configured endpoint. The endpoint must be represented asaddress:port/service- Returns:
- gRPC endpoint
-
setGrpc
Specifies a gRPC check's endpoint that supports the standard gRPC health checking protocol. The state of the check will be updated at the given Interval by probing the configured endpoint. The endpoint must be represented asaddress:port/service- Parameters:
grpc- endpoint
-
isGrpcTls
public boolean isGrpcTls()Specifies whether to use TLS for this gRPC health check. If TLS is enabled, then by default, a valid TLS certificate is expected. Certificate verification can be turned off by settingTLSSkipVerifytotrue.- Returns:
- true if TLS is enabled
-
setGrpcTls
Specifies whether to use TLS for this gRPC health check. If TLS is enabled, then by default, a valid TLS certificate is expected. Certificate verification can be turned off by settingTLSSkipVerifytotrue.- Parameters:
grpcTls- true if TLS is enabled
-
isTlsSkipVerify
public boolean isTlsSkipVerify()Specifies if the certificate for an HTTPS check should not be verified.- Returns:
- true if the certificate for an HTTPS check should not be verified.
-
setTlsSkipVerify
Specifies if the certificate for an HTTPS check should not be verified.- Parameters:
tlsSkipVerify- true if the certificate for an HTTPS check should not be verified.
-
getTtl
-
setTtl
Set Time to Live of check.- Parameters:
ttl- Time to Live of check- Returns:
- reference to this, for fluency
-
getTcp
-
setTcp
Set TCP address to check. Also you should set checking interval- Parameters:
tcp- TCP address- Returns:
- reference to this, for fluency
-
getInterval
-
setInterval
Set checking interval- Parameters:
interval- checking interval in Go's time format which is sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h"- Returns:
- reference to this, for fluency
-
getId
-
setId
Set check ID- Parameters:
id- check ID- Returns:
- reference to this, for fluency
-
getName
-
setName
Set check name. This is mandatory field- Parameters:
name- check name- Returns:
- reference to this, for fluency
-
getNotes
-
setNotes
Set check notes- Parameters:
notes- check notes- Returns:
- reference to this, for fluency
-
getDeregisterAfter
-
setDeregisterAfter
Set deregister timeout. This is optional field, which is a timeout in the same time format as Interval and TTL. If a check is associated with a service and has the critical state for more than this configured value, then its associated service (and all of its associated checks) will automatically be deregistered. The minimum timeout is 1 minute, and the process that reaps critical services runs every 30 seconds, so it may take slightly longer than the configured timeout to trigger the deregistration. This should generally be configured with a timeout that's much, much longer than any expected recoverable outage for the given service.- Parameters:
deregisterAfter- timeout- Returns:
- reference to this, for fluency
-