Skip to content

Commit

Permalink
client sync
Browse files Browse the repository at this point in the history
  • Loading branch information
robotdan committed Jun 24, 2024
1 parent e46ed79 commit 0823124
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/main/java/io/fusionauth/client/FusionAuthClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -3789,6 +3790,42 @@ public ClientResponse<SystemConfigurationResponse, Void> 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<Void, Void> 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<StatusResponse, Void> 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<StatusResponse, Void> retrieveSystemStatusUsingAPIKey() {
return start(StatusResponse.class, Void.TYPE)
.uri("/api/status")
.get()
.go();
}

/**
* Retrieves the tenant for the given Id.
*
Expand Down
26 changes: 26 additions & 0 deletions src/main/java/io/fusionauth/domain/api/StatusResponse.java
Original file line number Diff line number Diff line change
@@ -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<String, Object> {
}

0 comments on commit 0823124

Please sign in to comment.