(deploymentsV3())
Operations that allow you configure and manage an application's build at runtime.
Create a new deployment. Creating a new deployment means all new rooms created will use the latest deployment configuration, but existing games in progress will not be affected.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.CreateDeploymentResponse;
import dev.hathora.cloud_sdk.models.shared.*;
import java.lang.Exception;
import java.util.List;
public class Application {
public static void main(String[] args) throws ApiError, Exception {
HathoraCloud sdk = HathoraCloud.builder()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
CreateDeploymentResponse res = sdk.deploymentsV3().createDeployment()
.deploymentConfigV3(DeploymentConfigV3.builder()
.buildId("bld-6d4c6a71-2d75-4b42-94e1-f312f57f33c5")
.containerPort(4000)
.env(List.of(
DeploymentConfigV3Env.builder()
.name("EULA")
.value("TRUE")
.build(),
DeploymentConfigV3Env.builder()
.name("EULA")
.value("TRUE")
.build()))
.idleTimeoutEnabled(true)
.requestedCPU(0.5)
.requestedMemoryMB(1024d)
.roomsPerProcess(3)
.transportType(TransportType.UDP)
.additionalContainerPorts(List.of(
ContainerPort.builder()
.name("default")
.port(8000)
.transportType(TransportType.UDP)
.build(),
ContainerPort.builder()
.name("default")
.port(8000)
.transportType(TransportType.UDP)
.build()))
.deploymentTag("alpha")
.experimentalRequestedGPU(1d)
.requestedGPU(1d)
.build())
.call();
if (res.deploymentV3().isPresent()) {
// handle response
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
deploymentConfigV3 |
DeploymentConfigV3 |
✔️ |
N/A |
|
appId |
Optional<String> |
➖ |
N/A |
app-af469a92-5b45-4565-b3c4-b79878de67d2 |
CreateDeploymentResponse
| Error Type |
Status Code |
Content Type |
| models/errors/ApiError |
400, 401, 404, 408, 422, 429 |
application/json |
| models/errors/ApiError |
500 |
application/json |
| models/errors/SDKError |
4XX, 5XX |
*/* |
Get details for a deployment.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetDeploymentResponse;
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()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
GetDeploymentResponse res = sdk.deploymentsV3().getDeployment()
.deploymentId("dep-6d4c6a71-2d75-4b42-94e1-f312f57f33c5")
.call();
if (res.deploymentV3().isPresent()) {
// handle response
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
appId |
Optional<String> |
➖ |
N/A |
app-af469a92-5b45-4565-b3c4-b79878de67d2 |
deploymentId |
String |
✔️ |
N/A |
dep-6d4c6a71-2d75-4b42-94e1-f312f57f33c5 |
GetDeploymentResponse
| Error Type |
Status Code |
Content Type |
| models/errors/ApiError |
401, 404, 408, 429 |
application/json |
| models/errors/SDKError |
4XX, 5XX |
*/* |
Returns an array of deployments for an application, optionally filtered by deploymentTag or buildTag.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetDeploymentsResponse;
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()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
GetDeploymentsResponse res = sdk.deploymentsV3().getDeployments()
.buildTag("0.1.14-14c793")
.deploymentTag("alpha")
.call();
if (res.deploymentsV3Page().isPresent()) {
// handle response
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
appId |
Optional<String> |
➖ |
N/A |
app-af469a92-5b45-4565-b3c4-b79878de67d2 |
buildTag |
Optional<String> |
➖ |
N/A |
0.1.14-14c793 |
deploymentTag |
Optional<String> |
➖ |
N/A |
alpha |
GetDeploymentsResponse
| Error Type |
Status Code |
Content Type |
| models/errors/ApiError |
401, 404, 408, 429 |
application/json |
| models/errors/SDKError |
4XX, 5XX |
*/* |
Get the latest deployment for an application.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetLatestDeploymentResponse;
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()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.security(Security.builder()
.hathoraDevToken(System.getenv().getOrDefault("HATHORA_DEV_TOKEN", ""))
.build())
.build();
GetLatestDeploymentResponse res = sdk.deploymentsV3().getLatestDeployment()
.call();
if (res.deploymentV3().isPresent()) {
// handle response
}
}
}
| Parameter |
Type |
Required |
Description |
Example |
appId |
Optional<String> |
➖ |
N/A |
app-af469a92-5b45-4565-b3c4-b79878de67d2 |
GetLatestDeploymentResponse
| Error Type |
Status Code |
Content Type |
| models/errors/ApiError |
401, 404, 408, 422, 429 |
application/json |
| models/errors/SDKError |
4XX, 5XX |
*/* |