(deploymentsV2())
createDeploymentV2Deprecated- CreateDeploymentV2Deprecated⚠️ DeprecatedgetDeploymentInfoV2Deprecated- GetDeploymentInfoV2Deprecated⚠️ DeprecatedgetDeploymentsV2Deprecated- GetDeploymentsV2Deprecated⚠️ DeprecatedgetLatestDeploymentV2Deprecated- GetLatestDeploymentV2Deprecated⚠️ Deprecated
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.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.CreateDeploymentV2DeprecatedResponse;
import dev.hathora.cloud_sdk.models.shared.DeploymentConfigV2;
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();
CreateDeploymentV2DeprecatedResponse res = sdk.deploymentsV2().createDeploymentV2Deprecated()
.deploymentConfigV2(DeploymentConfigV2.builder()
.containerPort(4000)
.env(List.of(
))
.idleTimeoutEnabled(false)
.requestedCPU(0.5d)
.requestedMemoryMB(1024d)
.roomsPerProcess(3)
.transportType(TransportType.TCP)
.additionalContainerPorts(List.of(
))
.build())
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.buildId(1)
.call();
if (res.deploymentV2().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
deploymentConfigV2 |
DeploymentConfigV2 | ✔️ | N/A | |
appId |
Optional<String> | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
buildId |
int | ✔️ | N/A | 1 |
CreateDeploymentV2DeprecatedResponse
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.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetDeploymentInfoV2DeprecatedResponse;
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();
GetDeploymentInfoV2DeprecatedResponse res = sdk.deploymentsV2().getDeploymentInfoV2Deprecated()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.deploymentId(1)
.call();
if (res.deploymentV2().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
appId |
Optional<String> | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
deploymentId |
int | ✔️ | N/A | 1 |
GetDeploymentInfoV2DeprecatedResponse
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.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetDeploymentsV2DeprecatedResponse;
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();
GetDeploymentsV2DeprecatedResponse res = sdk.deploymentsV2().getDeploymentsV2Deprecated()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.call();
if (res.classes().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
appId |
Optional<String> | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
GetDeploymentsV2DeprecatedResponse
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.
⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.
package hello.world;
import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetLatestDeploymentV2DeprecatedResponse;
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();
GetLatestDeploymentV2DeprecatedResponse res = sdk.deploymentsV2().getLatestDeploymentV2Deprecated()
.appId("app-af469a92-5b45-4565-b3c4-b79878de67d2")
.call();
if (res.deploymentV2().isPresent()) {
// handle response
}
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
appId |
Optional<String> | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
GetLatestDeploymentV2DeprecatedResponse
Error Type | Status Code | Content Type |
---|---|---|
models/errors/ApiError | 401, 404, 422, 429 | application/json |
models/errors/SDKError | 4XX, 5XX | */* |