Skip to content

Latest commit

 

History

History
185 lines (130 loc) · 8.94 KB

File metadata and controls

185 lines (130 loc) · 8.94 KB

ProcessesV1

(processesV1())

Overview

Deprecated. Use ProcessesV3.

Available Operations

getProcessInfoDeprecated

Get details for a process.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetProcessInfoDeprecatedResponse;
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();

        GetProcessInfoDeprecatedResponse res = sdk.processesV1().getProcessInfoDeprecated()
                .processId("cbfcddd2-0006-43ae-996c-995fff7bed2e")
                .call();

        if (res.process().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
appId Optional<String> N/A app-af469a92-5b45-4565-b3c4-b79878de67d2
processId String ✔️ N/A cbfcddd2-0006-43ae-996c-995fff7bed2e

Response

GetProcessInfoDeprecatedResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 408, 429 application/json
models/errors/ApiError 500 application/json
models/errors/SDKError 4XX, 5XX */*

getRunningProcesses

Retrieve 10 most recently started process objects for an application. Filter the array by optionally passing in a region.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetRunningProcessesResponse;
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();

        GetRunningProcessesResponse res = sdk.processesV1().getRunningProcesses()
                .call();

        if (res.classes().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
appId Optional<String> N/A app-af469a92-5b45-4565-b3c4-b79878de67d2
region Optional<Region> N/A

Response

GetRunningProcessesResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 408, 422, 429 application/json
models/errors/SDKError 4XX, 5XX */*

getStoppedProcesses

Retrieve 10 most recently stopped process objects for an application. Filter the array by optionally passing in a region.

⚠️ DEPRECATED: This will be removed in a future release, please migrate away from it as soon as possible.

Example Usage

package hello.world;

import dev.hathora.cloud_sdk.HathoraCloud;
import dev.hathora.cloud_sdk.models.errors.ApiError;
import dev.hathora.cloud_sdk.models.operations.GetStoppedProcessesResponse;
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();

        GetStoppedProcessesResponse res = sdk.processesV1().getStoppedProcesses()
                .call();

        if (res.classes().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description Example
appId Optional<String> N/A app-af469a92-5b45-4565-b3c4-b79878de67d2
region Optional<Region> N/A

Response

GetStoppedProcessesResponse

Errors

Error Type Status Code Content Type
models/errors/ApiError 401, 404, 408, 422, 429 application/json
models/errors/SDKError 4XX, 5XX */*