diff --git a/src/main/java/io/github/jopenlibs/vault/api/Debug.java b/src/main/java/io/github/jopenlibs/vault/api/Debug.java index 32c4f1e5..476a8df9 100644 --- a/src/main/java/io/github/jopenlibs/vault/api/Debug.java +++ b/src/main/java/io/github/jopenlibs/vault/api/Debug.java @@ -58,7 +58,7 @@ public Debug withNameSpace(final String nameSpace) { * */ public HealthResponse health() throws VaultException { - return health(null, null, null, null); + return health(null, null, null, null, null); } /** @@ -81,6 +81,8 @@ public HealthResponse health() throws VaultException { * node instead of the default of 429 * @param sealedCode (optional) Indicates the status code that should be returned for a sealed * node instead of the default of 500 + * @param performanceStandbyCode (optional) Indicates the status code that should be + * returned for a performanceStandbyCode node instead of the default of 473 * @return The response information returned from Vault * @throws VaultException If an error occurs or unexpected response received from Vault */ @@ -88,7 +90,8 @@ public HealthResponse health( final Boolean standbyOk, final Integer activeCode, final Integer standbyCode, - final Integer sealedCode + final Integer sealedCode, + final Integer performanceStandbyCode ) throws VaultException { final String path = "sys/health"; @@ -116,6 +119,8 @@ public HealthResponse health( if (sealedCode != null) { rest.parameter("sealedcode", sealedCode.toString()); } + if (performanceStandbyCode != null) rest.parameter("performancestandbycode", + performanceStandbyCode.toString()); // Execute request final RestResponse restResponse = rest.get(); @@ -124,6 +129,7 @@ public HealthResponse health( validCodes.add(200); validCodes.add(429); validCodes.add(500); + validCodes.add(473); if (activeCode != null) { validCodes.add(activeCode); } @@ -133,6 +139,9 @@ public HealthResponse health( if (sealedCode != null) { validCodes.add(sealedCode); } + if (performanceStandbyCode != null) { + validCodes.add(performanceStandbyCode); + } if (!validCodes.contains(restResponse.getStatus())) { throw new VaultException( diff --git a/src/test-integration/java/io/github/jopenlibs/vault/api/DebugTests.java b/src/test-integration/java/io/github/jopenlibs/vault/api/DebugTests.java index 9b542611..10aad73b 100644 --- a/src/test-integration/java/io/github/jopenlibs/vault/api/DebugTests.java +++ b/src/test-integration/java/io/github/jopenlibs/vault/api/DebugTests.java @@ -49,7 +49,7 @@ public void testHealth_Plain() throws VaultException { @Test public void testHealth_WithParams() throws VaultException { - final HealthResponse response = vault.debug().health(null, 212, null, null); + final HealthResponse response = vault.debug().health(null, 212, null, null, null); assertTrue(response.getInitialized()); assertFalse(response.getSealed()); assertFalse(response.getStandby()); @@ -67,7 +67,7 @@ public void testHealth_WithParams() throws VaultException { @Test public void testHealth_WonkyActiveCode() throws VaultException { final HealthResponse response = vault.debug().health(null, 204, null, - null); + null, null); assertNull(response.getInitialized()); assertNull(response.getSealed()); assertNull(response.getStandby());