(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.DeploymentConfigV3;
import dev.hathora.cloud_sdk.models.shared.Security;
import dev.hathora.cloud_sdk.models.shared.TransportType;
import java.lang.Exception;
import java.util.List;
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();
CreateDeploymentResponse res = sdk.deploymentsV3().createDeployment()
.deploymentConfigV3(DeploymentConfigV3.builder()
.buildId("bld-6d4c6a71-2d75-4b42-94e1-f312f57f33c5")
.containerPort(4000)
.env(List.of(
))
.idleTimeoutEnabled(true)
.requestedCPU(0.5d)
.requestedMemoryMB(1024d)
.roomsPerProcess(3)
.transportType(TransportType.TCP)
.additionalContainerPorts(List.of(
))
.deploymentTag("alpha")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.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, 422, 429, 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()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
GetDeploymentResponse res = sdk.deploymentsV3().getDeployment()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.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, 429 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |
Returns an array of deployments for an application, optionally filtered by deploymentTag.
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()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
GetDeploymentsResponse res = sdk.deploymentsV3().getDeployments()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.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 |
deploymentTag |
Optional<String> |
➖ |
N/A |
alpha |
GetDeploymentsResponse
Error Type |
Status Code |
Content Type |
models/errors/ApiError |
401, 404, 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()
.security(Security.builder()
.hathoraDevToken("<YOUR_BEARER_TOKEN_HERE>")
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.orgId("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39")
.build();
GetLatestDeploymentResponse res = sdk.deploymentsV3().getLatestDeployment()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.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, 422, 429 |
application/json |
models/errors/SDKError |
4XX, 5XX |
*/* |