Skip to content

Latest commit

 

History

History
230 lines (162 loc) · 10.9 KB

File metadata and controls

230 lines (162 loc) · 10.9 KB

DeploymentsV3

(DeploymentsV3)

Overview

Operations that allow you configure and manage an application's build at runtime.

Available Operations

CreateDeployment

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.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;
using System.Collections.Generic;

var sdk = new HathoraCloudSDK(
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    });

CreateDeploymentRequest req = new CreateDeploymentRequest() {
    DeploymentConfigV3 = new DeploymentConfigV3() {
        AdditionalContainerPorts = new List<ContainerPort>() {
            new ContainerPort() {
                Name = "default",
                Port = 8000,
                TransportType = TransportType.Udp,
            },
        },
        BuildId = "bld-6d4c6a71-2d75-4b42-94e1-f312f57f33c5",
        ContainerPort = 4000,
        DeploymentTag = "alpha",
        Env = new List<DeploymentConfigV3Env>() {
            new DeploymentConfigV3Env() {
                Name = "EULA",
                Value = "TRUE",
            },
        },
        ExperimentalRequestedGPU = 1D,
        IdleTimeoutEnabled = false,
        RequestedCPU = 0.5D,
        RequestedGPU = 1D,
        RequestedMemoryMB = 1024D,
        RoomsPerProcess = 3,
        TransportType = TransportType.Udp,
    },
};


using(var res = await sdk.DeploymentsV3.CreateDeploymentAsync(req))
{
    // handle response
}

Parameters

Parameter Type Required Description
request CreateDeploymentRequest ✔️ The request object to use for the request.

Response

CreateDeploymentResponse

Errors

Error Type Status Code Content Type
HathoraCloud.Models.Errors.ApiError 400, 401, 404, 408, 422, 429 application/json
HathoraCloud.Models.Errors.ApiError 500 application/json
HathoraCloud.Models.Errors.SDKException 4XX, 5XX */*

GetDeployment

Get details for a deployment.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    });

GetDeploymentRequest req = new GetDeploymentRequest() {
    DeploymentId = "dep-6d4c6a71-2d75-4b42-94e1-f312f57f33c5",
};


using(var res = await sdk.DeploymentsV3.GetDeploymentAsync(req))
{
    // handle response
}

Parameters

Parameter Type Required Description
request GetDeploymentRequest ✔️ The request object to use for the request.

Response

GetDeploymentResponse

Errors

Error Type Status Code Content Type
HathoraCloud.Models.Errors.ApiError 401, 404, 408, 429 application/json
HathoraCloud.Models.Errors.SDKException 4XX, 5XX */*

GetDeployments

Returns an array of deployments for an application, optionally filtered by deploymentTag or buildTag.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    });

GetDeploymentsRequest req = new GetDeploymentsRequest() {
    BuildTag = "0.1.14-14c793",
    DeploymentTag = "alpha",
};


using(var res = await sdk.DeploymentsV3.GetDeploymentsAsync(req))
{
    // handle response
}

Parameters

Parameter Type Required Description
request GetDeploymentsRequest ✔️ The request object to use for the request.

Response

GetDeploymentsResponse

Errors

Error Type Status Code Content Type
HathoraCloud.Models.Errors.ApiError 401, 404, 408, 429 application/json
HathoraCloud.Models.Errors.SDKException 4XX, 5XX */*

GetLatestDeployment

Get the latest deployment for an application.

Example Usage

using HathoraCloud;
using HathoraCloud.Models.Shared;
using HathoraCloud.Models.Operations;

var sdk = new HathoraCloudSDK(
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    });

GetLatestDeploymentRequest req = new GetLatestDeploymentRequest() {};


using(var res = await sdk.DeploymentsV3.GetLatestDeploymentAsync(req))
{
    // handle response
}

Parameters

Parameter Type Required Description
request GetLatestDeploymentRequest ✔️ The request object to use for the request.

Response

GetLatestDeploymentResponse

Errors

Error Type Status Code Content Type
HathoraCloud.Models.Errors.ApiError 401, 404, 408, 422, 429 application/json
HathoraCloud.Models.Errors.SDKException 4XX, 5XX */*