The implementing class for operations on REST endpoints, under the "Debug" section of the Vault HTTP API docs (https://www.vaultproject.io/docs/http/index.html).
This class is not intended to be constructed directly. Rather, it is meant to used by way of
Vault in a DSL-style builder pattern. See the Javadoc comments of each
public
method for usage examples.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.github.jopenlibs.vault.api.OperationsBase
OperationsBase.EndpointOperation<T> -
Field Summary
Fields inherited from class io.github.jopenlibs.vault.api.OperationsBase
config -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionhealth()Returns the health status of Vault.health(Boolean standbyOk, Boolean perfstandbyOk, Integer activeCode, Integer standbyCode, Integer drsecondaryCode, Integer performanceStandbyCode, Integer sealedCode, Integer uninitCode) An overloaded version ofhealth()that allows for passing one or more optional parameters.withNameSpace(String nameSpace) Methods inherited from class io.github.jopenlibs.vault.api.OperationsBase
getRest, retry
-
Constructor Details
-
Debug
-
-
Method Details
-
withNameSpace
-
health
Returns the health status of Vault. This matches the semantics of a Consul HTTP health check and provides a simple way to monitor the health of a Vault instance.
- Returns:
- The response information returned from Vault
- Throws:
VaultException- If any errors occurs with the REST request (e.g. non-200 status code, invalid JSON payload, etc), and the maximum number of retries is exceeded.- See Also:
-
- https://www.vaultproject.io/docs/http/sys-health.html
final VaultConfig config = new VaultConfig.address(...).token(...).build(); final Vault vault = Vault.create(config); final HealthResponse response = vault.sys().debug().health(); final Boolean sealed = response.getSealed(); // Warning: CAN be null!
- https://www.vaultproject.io/docs/http/sys-health.html
-
health
public HealthResponse health(Boolean standbyOk, Boolean perfstandbyOk, Integer activeCode, Integer standbyCode, Integer drsecondaryCode, Integer performanceStandbyCode, Integer sealedCode, Integer uninitCode) throws VaultException An overloaded version of
health()that allows for passing one or more optional parameters.WARNING: In testing, we've found that changing the default HTTP status codes can result in the operation succeeding, but returning an empty JSON payload in the response. For example, this seems to happen when you set
activeCodeto 204, but not for 212 (the regular default is 200). When this happens, theHealthResponsereturn object will havenullvalues in most of its fields, and you will need to checkHealthReponse.getRestResponse().getStatus()to determine the result of the operation.- Parameters:
standbyOk- (optional) Indicates that being a standby should still return the active status code instead of the standby codeperfstandbyOk- (optional) Indicates that being a performance standby should still return the active status code instead of the performance standby code.activeCode- (optional) Indicates the status code that should be returned for an active node instead of the default of 200standbyCode- (optional) Indicates the status code that should be returned for a standby node instead of the default of 429drsecondaryCode- (optional) Indicates the status code that should be returned for a DR secondary node instead of the default of 472performanceStandbyCode- (optional) Indicates the status code that should be returned for a performance standby node instead of the default of 473sealedCode- (optional) Indicates the status code that should be returned for a sealed node instead of the default of 500uninitCode- (optional) Indicates the status code that should be returned for a uninitialized node instead of the default of 500- Returns:
- The response information returned from Vault
- Throws:
VaultException- If an error occurs or unexpected response received from Vault
-