(fleetsV2())
CreateFleet
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.CreateFleetResponse;
import dev.hathora.cloud_sdk.models.shared.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
CreateFleetResponse res = sdk.fleetsV2().createFleet()
.createFleetV2(CreateFleetV2.builder()
.autoscalerConfig(AutoscalerConfig.builder()
.scaleUpThreshold(599396)
.build())
.name("production")
.nodeShapeId(NodeShapeId.SHAPE_AMD6432128)
.build())
.call();
if (res.fleetV2().isPresent()) {
// handle response
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
createFleetV2 |
CreateFleetV2 |
✔️ |
N/A |
|
orgId |
Optional<String> |
➖ |
N/A |
org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
CreateFleetResponse
| Error Type |
Status Code |
Content Type |
| models/errors/ApiError |
401, 404, 408, 422, 429 |
application/json |
| models/errors/ApiError |
500 |
application/json |
| models/errors/SDKError |
4XX, 5XX |
*/* |
Returns a fleet.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetFleetResponse;
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()
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
GetFleetResponse res = sdk.fleetsV2().getFleet()
.fleetId("<id>")
.call();
if (res.fleetV2().isPresent()) {
// handle response
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
fleetId |
String |
✔️ |
N/A |
|
orgId |
Optional<String> |
➖ |
N/A |
org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
GetFleetResponse
| Error Type |
Status Code |
Content Type |
| models/errors/ApiError |
401, 404, 408, 422, 429 |
application/json |
| models/errors/ApiError |
500 |
application/json |
| models/errors/SDKError |
4XX, 5XX |
*/* |
Gets aggregate metrics for a fleet.
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.Security;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
GetFleetMetricsRequest req = GetFleetMetricsRequest.builder()
.fleetId("<id>")
.build();
GetFleetMetricsResponse res = sdk.fleetsV2().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, 408, 422, 429 |
application/json |
| models/errors/ApiError |
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()
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
GetFleetRegionResponse res = sdk.fleetsV2().getFleetRegion()
.fleetId("<id>")
.region(Region.SINGAPORE)
.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, 408, 422, 429 |
application/json |
| models/errors/SDKError |
4XX, 5XX |
*/* |
Gets metrics for a region in a fleet.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetFleetRegionMetricsRequest;
import dev.hathora.cloud_sdk.models.operations.GetFleetRegionMetricsResponse;
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()
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
GetFleetRegionMetricsRequest req = GetFleetRegionMetricsRequest.builder()
.fleetId("<id>")
.region(Region.CHICAGO)
.build();
GetFleetRegionMetricsResponse res = sdk.fleetsV2().getFleetRegionMetrics()
.request(req)
.call();
if (res.fleetMetricsData().isPresent()) {
// handle response
}
}
}
GetFleetRegionMetricsResponse
| Error Type |
Status Code |
Content Type |
| models/errors/ApiError |
401, 404, 408, 422, 429 |
application/json |
| models/errors/ApiError |
500 |
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()
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
GetFleetsResponse res = sdk.fleetsV2().getFleets()
.call();
if (res.fleetsPageV2().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, 408, 429 |
application/json |
| models/errors/ApiError |
500 |
application/json |
| models/errors/SDKError |
4XX, 5XX |
*/* |
GetNodeShapes
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetNodeShapesResponse;
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()
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
GetNodeShapesResponse res = sdk.fleetsV2().getNodeShapes()
.call();
if (res.classes().isPresent()) {
// handle response
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
orgId |
Optional<String> |
➖ |
N/A |
org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
GetNodeShapesResponse
| Error Type |
Status Code |
Content Type |
| models/errors/ApiError |
401, 404, 408, 422, 429 |
application/json |
| models/errors/ApiError |
500 |
application/json |
| models/errors/SDKError |
4XX, 5XX |
*/* |
Updates a fleet's configuration.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.UpdateFleetResponse;
import dev.hathora.cloud_sdk.models.shared.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
UpdateFleetResponse res = sdk.fleetsV2().updateFleet()
.updateFleetV2(UpdateFleetV2.builder()
.autoscalerConfig(AutoscalerConfig.builder()
.scaleUpThreshold(979840)
.build())
.name("production")
.build())
.fleetId("<id>")
.call();
// handle response
}
}
| Parameter |
Type |
Required |
Description |
Example |
updateFleetV2 |
UpdateFleetV2 |
✔️ |
N/A |
|
fleetId |
String |
✔️ |
N/A |
|
orgId |
Optional<String> |
➖ |
N/A |
org-6f706e83-0ec1-437a-9a46-7d4281eb2f39 |
UpdateFleetResponse
| Error Type |
Status Code |
Content Type |
| models/errors/ApiError |
401, 404, 408, 422, 429 |
application/json |
| models/errors/ApiError |
500 |
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.*;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
UpdateFleetRegionRequest req = UpdateFleetRegionRequest.builder()
.fleetRegionConfig(FleetRegionConfig.builder()
.cloudMinVcpus(503995)
.build())
.fleetId("<id>")
.region(Region.CHICAGO)
.build();
UpdateFleetRegionResponse res = sdk.fleetsV2().updateFleetRegion()
.request(req)
.call();
// handle response
}
}
UpdateFleetRegionResponse
| Error Type |
Status Code |
Content Type |
| models/errors/ApiError |
401, 404, 408, 422, 429 |
application/json |
| models/errors/ApiError |
500 |
application/json |
| models/errors/SDKError |
4XX, 5XX |
*/* |