(DeploymentsV1)
GetDeploymentsV1Deprecated- GetDeploymentsV1Deprecated⚠️ DeprecatedGetLatestDeploymentV1Deprecated- GetLatestDeploymentV1Deprecated⚠️ DeprecatedGetDeploymentInfoV1Deprecated- GetDeploymentInfoV1Deprecated⚠️ DeprecatedCreateDeploymentV1Deprecated- CreateDeploymentV1Deprecated⚠️ Deprecated
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 main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
res, err := s.DeploymentsV1.GetDeploymentsV1Deprecated(ctx, hathoracloud.String("app-af469a92-5b45-4565-b3c4-b79878de67d2"))
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
appID |
*string | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
opts |
[]operations.Option | ➖ | The options for this request. |
[]components.DeploymentV1, error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 404, 429 | application/json |
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 main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
res, err := s.DeploymentsV1.GetLatestDeploymentV1Deprecated(ctx, hathoracloud.String("app-af469a92-5b45-4565-b3c4-b79878de67d2"))
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
appID |
*string | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.DeploymentV1, error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 404, 422, 429 | application/json |
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 main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
res, err := s.DeploymentsV1.GetDeploymentInfoV1Deprecated(ctx, 1, hathoracloud.String("app-af469a92-5b45-4565-b3c4-b79878de67d2"))
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
deploymentID |
int | ✔️ | N/A | 1 |
appID |
*string | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.DeploymentV1, error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 401, 404, 429 | application/json |
errors.SDKError | 4XX, 5XX | */* |
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 main
import(
"context"
hathoracloud "github.com/hathora/cloud-sdk-go"
"github.com/hathora/cloud-sdk-go/models/components"
"log"
)
func main() {
ctx := context.Background()
s := hathoracloud.New(
hathoracloud.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
hathoracloud.WithOrgID("org-6f706e83-0ec1-437a-9a46-7d4281eb2f39"),
hathoracloud.WithAppID("app-af469a92-5b45-4565-b3c4-b79878de67d2"),
)
res, err := s.DeploymentsV1.CreateDeploymentV1Deprecated(ctx, 1, components.DeploymentConfig{
Env: []components.DeploymentConfigEnv{
components.DeploymentConfigEnv{
Value: "TRUE",
Name: "EULA",
},
},
RoomsPerProcess: 3,
PlanName: components.PlanNameTiny,
AdditionalContainerPorts: []components.ContainerPort{
components.ContainerPort{
TransportType: components.TransportTypeTCP,
Port: 8000,
Name: "default",
},
},
TransportType: components.TransportTypeTLS,
ContainerPort: 4000,
}, hathoracloud.String("app-af469a92-5b45-4565-b3c4-b79878de67d2"))
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
ctx |
context.Context | ✔️ | The context to use for the request. | |
buildID |
int | ✔️ | N/A | 1 |
deploymentConfig |
components.DeploymentConfig | ✔️ | N/A | |
appID |
*string | ➖ | N/A | app-af469a92-5b45-4565-b3c4-b79878de67d2 |
opts |
[]operations.Option | ➖ | The options for this request. |
*components.DeploymentV1, error
Error Type | Status Code | Content Type |
---|---|---|
errors.APIError | 400, 401, 404, 422, 429, 500 | application/json |
errors.SDKError | 4XX, 5XX | */* |