Skip to content

Latest commit

 

History

History
233 lines (165 loc) · 10.8 KB

README.md

File metadata and controls

233 lines (165 loc) · 10.8 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(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
    orgId: "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39");

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,
        RequestedMemoryMB = 1024D,
        RoomsPerProcess = 3,
        TransportType = TransportType.Tcp,
    },
    AppId = "app-af469a92-5b45-4565-b3c4-b79878de67d2",
};


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, 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(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
    orgId: "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39");

GetDeploymentRequest req = new GetDeploymentRequest() {
    DeploymentId = "dep-6d4c6a71-2d75-4b42-94e1-f312f57f33c5",
    AppId = "app-af469a92-5b45-4565-b3c4-b79878de67d2",
};


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, 429 application/json
HathoraCloud.Models.Errors.SDKException 4XX, 5XX */*

GetDeployments

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

Example Usage

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

var sdk = new HathoraCloudSDK(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
    orgId: "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39");

GetDeploymentsRequest req = new GetDeploymentsRequest() {
    AppId = "app-af469a92-5b45-4565-b3c4-b79878de67d2",
    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, 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(
    security: new Security() {
        HathoraDevToken = "<YOUR_BEARER_TOKEN_HERE>",
    },
    appId: "app-af469a92-5b45-4565-b3c4-b79878de67d2",
    orgId: "org-6f706e83-0ec1-437a-9a46-7d4281eb2f39");

GetLatestDeploymentRequest req = new GetLatestDeploymentRequest() {
    AppId = "app-af469a92-5b45-4565-b3c4-b79878de67d2",
};


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, 422, 429 application/json
HathoraCloud.Models.Errors.SDKException 4XX, 5XX */*