diff --git a/src/main/java/io/fusionauth/client/FusionAuthClient.java b/src/main/java/io/fusionauth/client/FusionAuthClient.java index 3681171b..e46cf814 100644 --- a/src/main/java/io/fusionauth/client/FusionAuthClient.java +++ b/src/main/java/io/fusionauth/client/FusionAuthClient.java @@ -129,6 +129,7 @@ import io.fusionauth.domain.api.ReactorRequest; import io.fusionauth.domain.api.ReactorResponse; import io.fusionauth.domain.api.ReindexRequest; +import io.fusionauth.domain.api.StatusResponse; import io.fusionauth.domain.api.SystemConfigurationRequest; import io.fusionauth.domain.api.SystemConfigurationResponse; import io.fusionauth.domain.api.TenantDeleteRequest; @@ -3789,6 +3790,42 @@ public ClientResponse retrieveSystemConfigura .go(); } + /** + * Retrieves the FusionAuth system health. This API will return 200 if the system is healthy, and 500 if the system is un-healthy. + * + * @return The ClientResponse object. + */ + public ClientResponse retrieveSystemHealth() { + return startAnonymous(Void.TYPE, Void.TYPE) + .uri("/api/health") + .get() + .go(); + } + + /** + * Retrieves the FusionAuth system status. This request is anonymous and does not require an API key. When an API key is not provided the response will contain a single value in the JSON response indicating the current health check. + * + * @return The ClientResponse object. + */ + public ClientResponse retrieveSystemStatus() { + return startAnonymous(StatusResponse.class, Void.TYPE) + .uri("/api/status") + .get() + .go(); + } + + /** + * Retrieves the FusionAuth system status using an API key. Using an API key will cause the response to include the product version, health checks and various runtime metrics. + * + * @return The ClientResponse object. + */ + public ClientResponse retrieveSystemStatusUsingAPIKey() { + return start(StatusResponse.class, Void.TYPE) + .uri("/api/status") + .get() + .go(); + } + /** * Retrieves the tenant for the given Id. * diff --git a/src/main/java/io/fusionauth/domain/api/StatusResponse.java b/src/main/java/io/fusionauth/domain/api/StatusResponse.java new file mode 100644 index 00000000..f2bc0acd --- /dev/null +++ b/src/main/java/io/fusionauth/domain/api/StatusResponse.java @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024, FusionAuth, All Rights Reserved + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific + * language governing permissions and limitations under the License. + */ +package io.fusionauth.domain.api; + +import java.util.LinkedHashMap; + +/** + * The public Status API response + * + * @author Daniel DeGroff + */ +public class StatusResponse extends LinkedHashMap { +}