Skip to content

Commit 0823124

Browse files
committed
client sync
1 parent e46ed79 commit 0823124

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

src/main/java/io/fusionauth/client/FusionAuthClient.java

+37
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@
129129
import io.fusionauth.domain.api.ReactorRequest;
130130
import io.fusionauth.domain.api.ReactorResponse;
131131
import io.fusionauth.domain.api.ReindexRequest;
132+
import io.fusionauth.domain.api.StatusResponse;
132133
import io.fusionauth.domain.api.SystemConfigurationRequest;
133134
import io.fusionauth.domain.api.SystemConfigurationResponse;
134135
import io.fusionauth.domain.api.TenantDeleteRequest;
@@ -3789,6 +3790,42 @@ public ClientResponse<SystemConfigurationResponse, Void> retrieveSystemConfigura
37893790
.go();
37903791
}
37913792

3793+
/**
3794+
* Retrieves the FusionAuth system health. This API will return 200 if the system is healthy, and 500 if the system is un-healthy.
3795+
*
3796+
* @return The ClientResponse object.
3797+
*/
3798+
public ClientResponse<Void, Void> retrieveSystemHealth() {
3799+
return startAnonymous(Void.TYPE, Void.TYPE)
3800+
.uri("/api/health")
3801+
.get()
3802+
.go();
3803+
}
3804+
3805+
/**
3806+
* 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.
3807+
*
3808+
* @return The ClientResponse object.
3809+
*/
3810+
public ClientResponse<StatusResponse, Void> retrieveSystemStatus() {
3811+
return startAnonymous(StatusResponse.class, Void.TYPE)
3812+
.uri("/api/status")
3813+
.get()
3814+
.go();
3815+
}
3816+
3817+
/**
3818+
* 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.
3819+
*
3820+
* @return The ClientResponse object.
3821+
*/
3822+
public ClientResponse<StatusResponse, Void> retrieveSystemStatusUsingAPIKey() {
3823+
return start(StatusResponse.class, Void.TYPE)
3824+
.uri("/api/status")
3825+
.get()
3826+
.go();
3827+
}
3828+
37923829
/**
37933830
* Retrieves the tenant for the given Id.
37943831
*
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/*
2+
* Copyright (c) 2024, FusionAuth, All Rights Reserved
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing,
11+
* software distributed under the License is distributed on an
12+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
13+
* either express or implied. See the License for the specific
14+
* language governing permissions and limitations under the License.
15+
*/
16+
package io.fusionauth.domain.api;
17+
18+
import java.util.LinkedHashMap;
19+
20+
/**
21+
* The public Status API response
22+
*
23+
* @author Daniel DeGroff
24+
*/
25+
public class StatusResponse extends LinkedHashMap<String, Object> {
26+
}

0 commit comments

Comments
 (0)