(processesV3() )
Operations to get data on active and stopped processes .
Creates a process without a room. Use this to pre-allocate processes ahead of time so that subsequent room assignment via CreateRoom() can be instant.
package hello .world ;
import dev .hathora .cloud_sdk .HathoraCloud ;
import dev .hathora .cloud_sdk .models .errors .ApiError ;
import dev .hathora .cloud_sdk .models .operations .CreateProcessResponse ;
import dev .hathora .cloud_sdk .models .shared .Region ;
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 ();
CreateProcessResponse res = sdk .processesV3 ().createProcess ()
.appId ("app-af469a92-5b45-4565-b3c4-b79878de67d2" )
.region (Region .TOKYO )
.call ();
if (res .processV3 ().isPresent ()) {
// handle response
}
}
}
Parameter
Type
Required
Description
Example
appId
Optional<String>
➖
N/A
app-af469a92-5b45-4565-b3c4-b79878de67d2
region
Region
✔️
N/A
CreateProcessResponse
Error Type
Status Code
Content Type
models/errors/ApiError
401, 402, 404, 422, 429, 500
application/json
models/errors/SDKError
4XX, 5XX
*/*
Retrieve the 10 most recent processes objects for an application . Filter the array by optionally passing in a status
or region
.
package hello .world ;
import dev .hathora .cloud_sdk .HathoraCloud ;
import dev .hathora .cloud_sdk .models .errors .ApiError ;
import dev .hathora .cloud_sdk .models .operations .GetLatestProcessesResponse ;
import dev .hathora .cloud_sdk .models .shared .ProcessStatus ;
import dev .hathora .cloud_sdk .models .shared .Region ;
import dev .hathora .cloud_sdk .models .shared .Security ;
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 ();
GetLatestProcessesResponse res = sdk .processesV3 ().getLatestProcesses ()
.appId ("app-af469a92-5b45-4565-b3c4-b79878de67d2" )
.region (List .of (
Region .SYDNEY ))
.status (List .of (
ProcessStatus .DRAINING ))
.call ();
if (res .classes ().isPresent ()) {
// handle response
}
}
}
Parameter
Type
Required
Description
Example
appId
Optional<String>
➖
N/A
app-af469a92-5b45-4565-b3c4-b79878de67d2
region
List<Region >
➖
N/A
status
List<ProcessStatus >
➖
N/A
GetLatestProcessesResponse
Error Type
Status Code
Content Type
models/errors/ApiError
401, 404, 422, 429
application/json
models/errors/SDKError
4XX, 5XX
*/*
Get details for a process .
package hello .world ;
import dev .hathora .cloud_sdk .HathoraCloud ;
import dev .hathora .cloud_sdk .models .errors .ApiError ;
import dev .hathora .cloud_sdk .models .operations .GetProcessResponse ;
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 ();
GetProcessResponse res = sdk .processesV3 ().getProcess ()
.appId ("app-af469a92-5b45-4565-b3c4-b79878de67d2" )
.processId ("cbfcddd2-0006-43ae-996c-995fff7bed2e" )
.call ();
if (res .processV3 ().isPresent ()) {
// handle response
}
}
}
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
GetProcessResponse
Error Type
Status Code
Content Type
models/errors/ApiError
401, 404, 429
application/json
models/errors/SDKError
4XX, 5XX
*/*
GetProcessMetrics
package hello .world ;
import dev .hathora .cloud_sdk .HathoraCloud ;
import dev .hathora .cloud_sdk .models .errors .ApiError ;
import dev .hathora .cloud_sdk .models .operations .GetProcessMetricsRequest ;
import dev .hathora .cloud_sdk .models .operations .GetProcessMetricsResponse ;
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 ();
GetProcessMetricsRequest req = GetProcessMetricsRequest .builder ()
.processId ("cbfcddd2-0006-43ae-996c-995fff7bed2e" )
.appId ("app-af469a92-5b45-4565-b3c4-b79878de67d2" )
.build ();
GetProcessMetricsResponse res = sdk .processesV3 ().getProcessMetrics ()
.request (req )
.call ();
if (res .processMetricsData ().isPresent ()) {
// handle response
}
}
}
GetProcessMetricsResponse
Error Type
Status Code
Content Type
models/errors/ApiError
401, 404, 422, 429, 500
application/json
models/errors/SDKError
4XX, 5XX
*/*
getProcessesCountExperimental
Count the number of processes objects for an application . Filter by optionally passing in a status
or region
.
package hello .world ;
import dev .hathora .cloud_sdk .HathoraCloud ;
import dev .hathora .cloud_sdk .models .errors .ApiError ;
import dev .hathora .cloud_sdk .models .operations .GetProcessesCountExperimentalResponse ;
import dev .hathora .cloud_sdk .models .shared .ProcessStatus ;
import dev .hathora .cloud_sdk .models .shared .Region ;
import dev .hathora .cloud_sdk .models .shared .Security ;
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 ();
GetProcessesCountExperimentalResponse res = sdk .processesV3 ().getProcessesCountExperimental ()
.appId ("app-af469a92-5b45-4565-b3c4-b79878de67d2" )
.region (List .of (
Region .MUMBAI ))
.status (List .of (
ProcessStatus .STOPPING ))
.call ();
if (res .object ().isPresent ()) {
// handle response
}
}
}
Parameter
Type
Required
Description
Example
appId
Optional<String>
➖
N/A
app-af469a92-5b45-4565-b3c4-b79878de67d2
region
List<Region >
➖
N/A
status
List<ProcessStatus >
➖
N/A
GetProcessesCountExperimentalResponse
Error Type
Status Code
Content Type
models/errors/ApiError
401, 404, 422, 429
application/json
models/errors/SDKError
4XX, 5XX
*/*
Stops a process immediately.
package hello .world ;
import dev .hathora .cloud_sdk .HathoraCloud ;
import dev .hathora .cloud_sdk .models .errors .ApiError ;
import dev .hathora .cloud_sdk .models .operations .StopProcessResponse ;
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 ();
StopProcessResponse res = sdk .processesV3 ().stopProcess ()
.appId ("app-af469a92-5b45-4565-b3c4-b79878de67d2" )
.processId ("cbfcddd2-0006-43ae-996c-995fff7bed2e" )
.call ();
// handle response
}
}
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
StopProcessResponse
Error Type
Status Code
Content Type
models/errors/ApiError
401, 404, 429, 500
application/json
models/errors/SDKError
4XX, 5XX
*/*