(fleetsV1())
Operations to manage and view a fleet.
Gets metrics for a fleet in a region.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetFleetMetricsRequest;
import dev.hathora.cloud_sdk.models.operations.GetFleetMetricsResponse;
import dev.hathora.cloud_sdk.models.shared.Region;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
GetFleetMetricsRequest req = GetFleetMetricsRequest.builder()
.fleetId("<id>")
.region(Region.LONDON)
.build();
GetFleetMetricsResponse res = sdk.fleetsV1().getFleetMetrics()
.request(req)
.call();
if (res.fleetMetricsData().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
request |
GetFleetMetricsRequest |
✔️ |
The request object to use for the request. |
GetFleetMetricsResponse
Error Type |
Status Code |
Content Type |
models/errors/ApiError |
401, 404, 422, 429, 500 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Gets the configuration for a given fleet in a region.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetFleetRegionResponse;
import dev.hathora.cloud_sdk.models.shared.Region;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
GetFleetRegionResponse res = sdk.fleetsV1().getFleetRegion()
.fleetId("<id>")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.region(Region.SAO_PAULO)
.call();
if (res.fleetRegion().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
fleetId |
String |
✔️ |
N/A |
|
orgId |
Optional<String> |
➖ |
N/A |
org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
region |
Region |
✔️ |
N/A |
|
GetFleetRegionResponse
Error Type |
Status Code |
Content Type |
models/errors/ApiError |
401, 404, 422, 429 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Returns an array of fleets.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetFleetsResponse;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
GetFleetsResponse res = sdk.fleetsV1().getFleets()
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.call();
if (res.fleetsPage().isPresent()) {
// handle response
}
}
}
Parameter |
Type |
Required |
Description |
Example |
orgId |
Optional<String> |
➖ |
N/A |
org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
GetFleetsResponse
Error Type |
Status Code |
Content Type |
models/errors/ApiError |
401, 404, 429 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Updates the configuration for a given fleet in a region.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.UpdateFleetRegionRequest;
import dev.hathora.cloud_sdk.models.operations.UpdateFleetRegionResponse;
import dev.hathora.cloud_sdk.models.shared.FleetRegionConfig;
import dev.hathora.cloud_sdk.models.shared.Region;
import dev.hathora.cloud_sdk.models.shared.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
UpdateFleetRegionRequest req = UpdateFleetRegionRequest.builder()
.fleetRegionConfig(FleetRegionConfig.builder()
.cloudMinVcpus(511402)
.build())
.fleetId("<id>")
.region(Region.SINGAPORE)
.build();
UpdateFleetRegionResponse res = sdk.fleetsV1().updateFleetRegion()
.request(req)
.call();
// handle response
}
}
UpdateFleetRegionResponse
Error Type |
Status Code |
Content Type |
models/errors/ApiError |
401, 404, 422, 429, 500 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |