API Reference of GS2-Deploy SDK
Model
Stack
Stack
A stack is an entity that sets up resources on GS2 using GS2-Deploy.
The stack is designed to specify a template file, and the template file defines the resources needed on GS2. When GS2-Deploy creates a new or updated stack, it detects changes in the template file and sends the If a resource is added, it is created; if it is changed, it is updated; if it is deleted, it is removed.
This mechanism allows resources on GS2 to be described declaratively and managed in a reproducible manner. This reproducibility allows for error-free execution when migrating settings from the development environment to the production environment, for example.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackId | string | ✓ | ~ 1024 chars | Stack GRN | ||
name | string | ✓ | ~ 128 chars | Stack name | ||
description | string | ~ 1024 chars | Description | |||
template | string | ✓ | ~ 5242880 chars | Template data | ||
status | enum { “CREATE_PROCESSING”, “CREATE_COMPLETE”, “UPDATE_PROCESSING”, “UPDATE_COMPLETE”, “CLEAN_PROCESSING”, “CLEAN_COMPLETE”, “DELETE_PROCESSING”, “DELETE_COMPLETE”, “ROLLBACK_INITIALIZING”, “ROLLBACK_PROCESSING”, “ROLLBACK_COMPLETE” } | ✓ | “CREATE_PROCESSING” | ~ 128 chars | Execution state | |
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
updatedAt | long | ✓ | Now | Datetime of last update (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
Enumeration type definition to specify as status
Enumerator String Definition | Description |
---|---|
CREATE_PROCESSING | Create Processing |
CREATE_COMPLETE | Create Complete |
UPDATE_PROCESSING | Update Processing |
UPDATE_COMPLETE | Update Complete |
CLEAN_PROCESSING | Clean Processing |
CLEAN_COMPLETE | Clean Complete |
DELETE_PROCESSING | Delete Processing |
DELETE_COMPLETE | Delete Complete |
ROLLBACK_INITIALIZING | Rollback Initializing |
ROLLBACK_PROCESSING | Rollback Processing |
ROLLBACK_COMPLETE | Rollback complete |
Resource
Resource
Sources are areas within the microservice namespace that hold unique data.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
resourceId | string | ✓ | ~ 1024 chars | Resource GRN | ||
type | string | ✓ | ~ 1024 chars | Resource Type | ||
name | string | ✓ | ~ 128 chars | Resource Name | ||
request | string | ✓ | ~ 1048576 chars | Request parameter | ||
response | string | ✓ | ~ 1048576 chars | Response to resource creation/update | ||
rollbackContext | enum { “create”, “update”, “delete” } | ~ 128 chars | Types of rollback operations | |||
rollbackRequest | string | ~ 1048576 chars | Request parameters for rollback | |||
rollbackAfter | List<string> | [] | ~ 1000 items | Name of the resource on which you are relying at the time of rollback | ||
outputFields | List<OutputField> | [] | ~ 1000 items | Fields to be recorded in Output when the resource is created | ||
workId | string | ✓ | ~ 1024 chars | Execution ID at the time this resource was created | ||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) |
Enumeration type definition to specify as rollbackContext
Enumerator String Definition | Description |
---|---|
create | Create |
update | Update |
delete | Delete |
Event
Event
Events are generated to provide information when operations such as creating, updating, or deleting resources in the stack are performed. Developers can monitor how the stack deployment process and resource changes are progressing and take necessary actions.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
eventId | string | ✓ | ~ 1024 chars | Event GRN | ||
name | string | ✓ | UUID | ~ 36 chars | Event name | |
resourceName | string | ✓ | ~ 128 chars | Resource Name | ||
type | enum { “CREATE_IN_PROGRESS”, “CREATE_COMPLETE”, “CREATE_FAILED”, “UPDATE_IN_PROGRESS”, “UPDATE_COMPLETE”, “UPDATE_FAILED”, “CLEAN_IN_PROGRESS”, “CLEAN_COMPLETE”, “CLEAN_FAILED”, “DELETE_IN_PROGRESS”, “DELETE_COMPLETE”, “DELETE_FAILED”, “ROLLBACK_IN_PROGRESS”, “ROLLBACK_COMPLETE”, “ROLLBACK_FAILED” } | ✓ | ~ 128 chars | Status | ||
message | string | ~ 5242880 chars | Message | |||
eventAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
Enumeration type definition to specify as type
Enumerator String Definition | Description |
---|---|
CREATE_IN_PROGRESS | CREATE_IN_PROGRESS |
CREATE_COMPLETE | CREATE_COMPLETE |
CREATE_FAILED | CREATE_FAILED |
UPDATE_IN_PROGRESS | UPDATE_IN_PROGRESS |
UPDATE_COMPLETE | UPDATE_COMPLETE |
UPDATE_FAILED | UPDATE_FAILED |
CLEAN_IN_PROGRESS | CLEAN_IN_PROGRESS |
CLEAN_COMPLETE | CLEAN_COMPLETE |
CLEAN_FAILED | CLEAN_FAILED |
DELETE_IN_PROGRESS | DELETE_IN_PROGRESS |
DELETE_COMPLETE | DELETE_COMPLETE |
DELETE_FAILED | DELETE_FAILED |
ROLLBACK_IN_PROGRESS | ROLLBACK_IN_PROGRESS |
ROLLBACK_COMPLETE | ROLLBACK_COMPLETE |
ROLLBACK_FAILED | ROLLBACK_FAILED |
Output
Output
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
outputId | string | ✓ | ~ 1024 chars | Output GRN | ||
name | string | ✓ | ~ 1024 chars | Output Name | ||
value | string | ~ 1048576 chars | Value | |||
createdAt | long | ✓ | Now | Datetime of creation (Unix time unit:milliseconds) |
OutputField
Output field
Fields to be recorded in Output when the resource is created
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 1024 chars | Name | ||
fieldName | string | ✓ | ~ 1024 chars | Field name |
ChangeSet
Change
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
resourceName | string | ✓ | ~ 128 chars | Resource name | ||
resourceType | string | ✓ | ~ 128 chars | Resource type | ||
operation | enum { “create”, “update”, “delete” } | ✓ | ~ 128 chars | Change type |
Enumeration type definition to specify as operation
Enumerator String Definition | Description |
---|---|
create | Create |
update | Update |
delete | Delete |
GitHubCheckoutSetting
Setup to check out master data from GitHub
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
apiKeyId | string | ✓ | ~ 1024 chars | GitHub API key GRN | ||
repositoryName | string | ✓ | ~ 1024 chars | Repository Name | ||
sourcePath | string | ✓ | ~ 1024 chars | Source code file path | ||
referenceType | enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128 chars | Source of code | ||
commitHash | string | {referenceType} == “commit_hash” | ✓ | ~ 1024 chars | Commit hash | |
branchName | string | {referenceType} == “branch” | ✓ | ~ 1024 chars | Branch Name | |
tagName | string | {referenceType} == “tag” | ✓ | ~ 1024 chars | Tag Name |
Enumeration type definition to specify as referenceType
Enumerator String Definition | Description |
---|---|
commit_hash | Commit hash |
branch | Branch |
tag | Tag |
Methods
describeStacks
Get list of stacks
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Stack> | List of Stack |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.DescribeStacks(
&deploy.DescribeStacksRequest {
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\DescribeStacksRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeStacks(
(new DescribeStacksRequest())
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.DescribeStacksRequest;
import io.gs2.deploy.result.DescribeStacksResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
DescribeStacksResult result = client.describeStacks(
new DescribeStacksRequest()
.withPageToken(null)
.withLimit(null)
);
List<Stack> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.DescribeStacksRequest;
using Gs2.Gs2Deploy.Result.DescribeStacksResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.DescribeStacksResult> asyncResult = null;
yield return client.DescribeStacks(
new Gs2.Gs2Deploy.Request.DescribeStacksRequest()
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.describeStacks(
new Gs2Deploy.DescribeStacksRequest()
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.describe_stacks(
deploy.DescribeStacksRequest()
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.describe_stacks({
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('deploy')
api_result_handler = client.describe_stacks_async({
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
createStack
Create new stack
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Stack name | ||
description | string | ~ 1024 chars | Description | |||
template | string | ✓ | ~ 5242880 chars | Template data |
Result
Type | Description | |
---|---|---|
item | Stack | Stack created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.CreateStack(
&deploy.CreateStackRequest {
Name: pointy.String("stack-0001"),
Description: nil,
Template: pointy.String("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\CreateStackRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createStack(
(new CreateStackRequest())
->withName("stack-0001")
->withDescription(null)
->withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.CreateStackRequest;
import io.gs2.deploy.result.CreateStackResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
CreateStackResult result = client.createStack(
new CreateStackRequest()
.withName("stack-0001")
.withDescription(null)
.withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
Stack item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.CreateStackRequest;
using Gs2.Gs2Deploy.Result.CreateStackResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.CreateStackResult> asyncResult = null;
yield return client.CreateStack(
new Gs2.Gs2Deploy.Request.CreateStackRequest()
.WithName("stack-0001")
.WithDescription(null)
.WithTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.createStack(
new Gs2Deploy.CreateStackRequest()
.withName("stack-0001")
.withDescription(null)
.withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.create_stack(
deploy.CreateStackRequest()
.with_name('stack-0001')
.with_description(None)
.with_template('\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.create_stack({
name="stack-0001",
description=nil,
template="\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.create_stack_async({
name="stack-0001",
description=nil,
template="\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
createStackFromGitHub
Create new stack
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Stack name | ||
description | string | ~ 1024 chars | Description | |||
checkoutSetting | GitHubCheckoutSetting | ✓ | Setup to check out template file from GitHub |
Result
Type | Description | |
---|---|---|
item | Stack | Stack created |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.CreateStackFromGitHub(
&deploy.CreateStackFromGitHubRequest {
Name: pointy.String("stack-0001"),
Description: nil,
CheckoutSetting: &deploy.GitHubCheckoutSetting{
ApiKeyId: pointy.String("$gitHubApiKey1.apiKeyId"),
RepositoryName: pointy.String("gs2io/master-data"),
SourcePath: pointy.String("path/to/file.json"),
ReferenceType: pointy.String("branch"),
BranchName: pointy.String("develop"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\CreateStackFromGitHubRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->createStackFromGitHub(
(new CreateStackFromGitHubRequest())
->withName("stack-0001")
->withDescription(null)
->withCheckoutSetting((new GitHubCheckoutSetting())
->withApiKeyId(self::$gitHubApiKey1.apiKeyId)
->withRepositoryName("gs2io/master-data")
->withSourcePath("path/to/file.json")
->withReferenceType("branch")
->withBranchName("develop")
)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.CreateStackFromGitHubRequest;
import io.gs2.deploy.result.CreateStackFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
CreateStackFromGitHubResult result = client.createStackFromGitHub(
new CreateStackFromGitHubRequest()
.withName("stack-0001")
.withDescription(null)
.withCheckoutSetting(new GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
Stack item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.CreateStackFromGitHubRequest;
using Gs2.Gs2Deploy.Result.CreateStackFromGitHubResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.CreateStackFromGitHubResult> asyncResult = null;
yield return client.CreateStackFromGitHub(
new Gs2.Gs2Deploy.Request.CreateStackFromGitHubRequest()
.WithName("stack-0001")
.WithDescription(null)
.WithCheckoutSetting(new Gs2.Gs2Deploy.Model.GitHubCheckoutSetting()
.WithApiKeyId("$gitHubApiKey1.apiKeyId")
.WithRepositoryName("gs2io/master-data")
.WithSourcePath("path/to/file.json")
.WithReferenceType("branch")
.WithBranchName("develop")
),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.createStackFromGitHub(
new Gs2Deploy.CreateStackFromGitHubRequest()
.withName("stack-0001")
.withDescription(null)
.withCheckoutSetting(new Gs2Deploy.model.GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.create_stack_from_git_hub(
deploy.CreateStackFromGitHubRequest()
.with_name('stack-0001')
.with_description(None)
.with_checkout_setting(deploy.GitHubCheckoutSetting()
.with_api_key_id(self.git_hub_api_key1.api_key_id)
.with_repository_name('gs2io/master-data')
.with_source_path('path/to/file.json')
.with_reference_type('branch')
.with_branch_name('develop')
)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.create_stack_from_git_hub({
name="stack-0001",
description=nil,
checkoutSetting={
api_key_id="$gitHubApiKey1.apiKeyId",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.create_stack_from_git_hub_async({
name="stack-0001",
description=nil,
checkoutSetting={
api_key_id="$gitHubApiKey1.apiKeyId",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
validate
Validate Template
The validation content of this API only performs a simple validation. Even if the validation passes with this API, an error may still occur when you run it.
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
template | string | ✓ | ~ 5242880 chars | Template data |
Result
Type | Description |
---|
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.Validate(
&deploy.ValidateRequest {
Template: pointy.String("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n"),
}
)
if err != nil {
panic("error occurred")
}
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\ValidateRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->validate(
(new ValidateRequest())
->withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.ValidateRequest;
import io.gs2.deploy.result.ValidateResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
ValidateResult result = client.validate(
new ValidateRequest()
.withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.ValidateRequest;
using Gs2.Gs2Deploy.Result.ValidateResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.ValidateResult> asyncResult = null;
yield return client.Validate(
new Gs2.Gs2Deploy.Request.ValidateRequest()
.WithTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.validate(
new Gs2Deploy.ValidateRequest()
.withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.validate(
deploy.ValidateRequest()
.with_template('\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n')
)
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.validate({
template="\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
client = gs2('deploy')
api_result_handler = client.validate_async({
template="\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
getStackStatus
Get Stack
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name |
Result
Type | Description | |
---|---|---|
status | string |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.GetStackStatus(
&deploy.GetStackStatusRequest {
StackName: pointy.String("stack-0001"),
}
)
if err != nil {
panic("error occurred")
}
status := result.Status
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\GetStackStatusRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getStackStatus(
(new GetStackStatusRequest())
->withStackName("stack-0001")
);
$status = $result->getStatus();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.GetStackStatusRequest;
import io.gs2.deploy.result.GetStackStatusResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
GetStackStatusResult result = client.getStackStatus(
new GetStackStatusRequest()
.withStackName("stack-0001")
);
String status = result.getStatus();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.GetStackStatusRequest;
using Gs2.Gs2Deploy.Result.GetStackStatusResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.GetStackStatusResult> asyncResult = null;
yield return client.GetStackStatus(
new Gs2.Gs2Deploy.Request.GetStackStatusRequest()
.WithStackName("stack-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var status = result.Status;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.getStackStatus(
new Gs2Deploy.GetStackStatusRequest()
.withStackName("stack-0001")
);
const status = result.getStatus();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.get_stack_status(
deploy.GetStackStatusRequest()
.with_stack_name('stack-0001')
)
status = result.status
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.get_stack_status({
stackName="stack-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
client = gs2('deploy')
api_result_handler = client.get_stack_status_async({
stackName="stack-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
status = result.status;
getStack
Get Stack
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name |
Result
Type | Description | |
---|---|---|
item | Stack | Stack |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.GetStack(
&deploy.GetStackRequest {
StackName: pointy.String("stack-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\GetStackRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getStack(
(new GetStackRequest())
->withStackName("stack-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.GetStackRequest;
import io.gs2.deploy.result.GetStackResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
GetStackResult result = client.getStack(
new GetStackRequest()
.withStackName("stack-0001")
);
Stack item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.GetStackRequest;
using Gs2.Gs2Deploy.Result.GetStackResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.GetStackResult> asyncResult = null;
yield return client.GetStack(
new Gs2.Gs2Deploy.Request.GetStackRequest()
.WithStackName("stack-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.getStack(
new Gs2Deploy.GetStackRequest()
.withStackName("stack-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.get_stack(
deploy.GetStackRequest()
.with_stack_name('stack-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.get_stack({
stackName="stack-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.get_stack_async({
stackName="stack-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
updateStack
Update Stack
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name | ||
description | string | ~ 1024 chars | Description | |||
template | string | ✓ | ~ 5242880 chars | Template data |
Result
Type | Description | |
---|---|---|
item | Stack | Updated Stack |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.UpdateStack(
&deploy.UpdateStackRequest {
StackName: pointy.String("stack-0001"),
Description: nil,
Template: pointy.String("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\UpdateStackRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateStack(
(new UpdateStackRequest())
->withStackName("stack-0001")
->withDescription(null)
->withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.UpdateStackRequest;
import io.gs2.deploy.result.UpdateStackResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
UpdateStackResult result = client.updateStack(
new UpdateStackRequest()
.withStackName("stack-0001")
.withDescription(null)
.withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
Stack item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.UpdateStackRequest;
using Gs2.Gs2Deploy.Result.UpdateStackResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.UpdateStackResult> asyncResult = null;
yield return client.UpdateStack(
new Gs2.Gs2Deploy.Request.UpdateStackRequest()
.WithStackName("stack-0001")
.WithDescription(null)
.WithTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.updateStack(
new Gs2Deploy.UpdateStackRequest()
.withStackName("stack-0001")
.withDescription(null)
.withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.update_stack(
deploy.UpdateStackRequest()
.with_stack_name('stack-0001')
.with_description(None)
.with_template('\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.update_stack({
stackName="stack-0001",
description=nil,
template="\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.update_stack_async({
stackName="stack-0001",
description=nil,
template="\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
changeSet
Get Change Set
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name | ||
template | string | ✓ | ~ 5242880 chars | Template data |
Result
Type | Description | |
---|---|---|
items | List<ChangeSet> | List of Stack |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.ChangeSet(
&deploy.ChangeSetRequest {
StackName: pointy.String("stack-0001"),
Template: pointy.String("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n"),
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\ChangeSetRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->changeSet(
(new ChangeSetRequest())
->withStackName("stack-0001")
->withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
$items = $result->getItems();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.ChangeSetRequest;
import io.gs2.deploy.result.ChangeSetResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
ChangeSetResult result = client.changeSet(
new ChangeSetRequest()
.withStackName("stack-0001")
.withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
List<ChangeSet> items = result.getItems();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.ChangeSetRequest;
using Gs2.Gs2Deploy.Result.ChangeSetResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.ChangeSetResult> asyncResult = null;
yield return client.ChangeSet(
new Gs2.Gs2Deploy.Request.ChangeSetRequest()
.WithStackName("stack-0001")
.WithTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.changeSet(
new Gs2Deploy.ChangeSetRequest()
.withStackName("stack-0001")
.withTemplate("\nGS2TemplateFormatVersion: \"2019-05-01\"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n")
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.change_set(
deploy.ChangeSetRequest()
.with_stack_name('stack-0001')
.with_template('\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n')
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.change_set({
stackName="stack-0001",
template="\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
client = gs2('deploy')
api_result_handler = client.change_set_async({
stackName="stack-0001",
template="\nGS2TemplateFormatVersion: "2019-05-01"\nDescription: Template Sample\n\nResources:\n IdentifierAuthUser:\n Type: GS2::Identifier::User\n Properties:\n Name: auth\n\nOutputs:\n SecretKey: !GetAttr IdentifierAuthUser.Name\n",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
updateStackFromGitHub
Update Stack
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name | ||
description | string | ~ 1024 chars | Description | |||
checkoutSetting | GitHubCheckoutSetting | ✓ | Setup to check out template file from GitHub |
Result
Type | Description | |
---|---|---|
item | Stack | Updated Stack |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.UpdateStackFromGitHub(
&deploy.UpdateStackFromGitHubRequest {
StackName: pointy.String("stack-0001"),
Description: nil,
CheckoutSetting: &deploy.GitHubCheckoutSetting{
ApiKeyId: pointy.String("$gitHubApiKey1.apiKeyId"),
RepositoryName: pointy.String("gs2io/master-data"),
SourcePath: pointy.String("path/to/file.json"),
ReferenceType: pointy.String("branch"),
BranchName: pointy.String("develop"),
},
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\UpdateStackFromGitHubRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->updateStackFromGitHub(
(new UpdateStackFromGitHubRequest())
->withStackName("stack-0001")
->withDescription(null)
->withCheckoutSetting((new GitHubCheckoutSetting())
->withApiKeyId(self::$gitHubApiKey1.apiKeyId)
->withRepositoryName("gs2io/master-data")
->withSourcePath("path/to/file.json")
->withReferenceType("branch")
->withBranchName("develop")
)
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.UpdateStackFromGitHubRequest;
import io.gs2.deploy.result.UpdateStackFromGitHubResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
UpdateStackFromGitHubResult result = client.updateStackFromGitHub(
new UpdateStackFromGitHubRequest()
.withStackName("stack-0001")
.withDescription(null)
.withCheckoutSetting(new GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
Stack item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.UpdateStackFromGitHubRequest;
using Gs2.Gs2Deploy.Result.UpdateStackFromGitHubResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.UpdateStackFromGitHubResult> asyncResult = null;
yield return client.UpdateStackFromGitHub(
new Gs2.Gs2Deploy.Request.UpdateStackFromGitHubRequest()
.WithStackName("stack-0001")
.WithDescription(null)
.WithCheckoutSetting(new Gs2.Gs2Deploy.Model.GitHubCheckoutSetting()
.WithApiKeyId("$gitHubApiKey1.apiKeyId")
.WithRepositoryName("gs2io/master-data")
.WithSourcePath("path/to/file.json")
.WithReferenceType("branch")
.WithBranchName("develop")
),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.updateStackFromGitHub(
new Gs2Deploy.UpdateStackFromGitHubRequest()
.withStackName("stack-0001")
.withDescription(null)
.withCheckoutSetting(new Gs2Deploy.model.GitHubCheckoutSetting()
.withApiKeyId("$gitHubApiKey1.apiKeyId")
.withRepositoryName("gs2io/master-data")
.withSourcePath("path/to/file.json")
.withReferenceType("branch")
.withBranchName("develop")
)
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.update_stack_from_git_hub(
deploy.UpdateStackFromGitHubRequest()
.with_stack_name('stack-0001')
.with_description(None)
.with_checkout_setting(deploy.GitHubCheckoutSetting()
.with_api_key_id(self.git_hub_api_key1.api_key_id)
.with_repository_name('gs2io/master-data')
.with_source_path('path/to/file.json')
.with_reference_type('branch')
.with_branch_name('develop')
)
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.update_stack_from_git_hub({
stackName="stack-0001",
description=nil,
checkoutSetting={
api_key_id="$gitHubApiKey1.apiKeyId",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.update_stack_from_git_hub_async({
stackName="stack-0001",
description=nil,
checkoutSetting={
api_key_id="$gitHubApiKey1.apiKeyId",
repository_name="gs2io/master-data",
source_path="path/to/file.json",
reference_type="branch",
branch_name="develop",
},
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteStack
Delete Stack
Deletes the resources created by the stack and, if successful, deletes the entity. If for some reason the resource deletion fails, the entity remains.
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name |
Result
Type | Description | |
---|---|---|
item | Stack | Deleted stacks |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.DeleteStack(
&deploy.DeleteStackRequest {
StackName: pointy.String("stack-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\DeleteStackRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteStack(
(new DeleteStackRequest())
->withStackName("stack-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.DeleteStackRequest;
import io.gs2.deploy.result.DeleteStackResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
DeleteStackResult result = client.deleteStack(
new DeleteStackRequest()
.withStackName("stack-0001")
);
Stack item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.DeleteStackRequest;
using Gs2.Gs2Deploy.Result.DeleteStackResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.DeleteStackResult> asyncResult = null;
yield return client.DeleteStack(
new Gs2.Gs2Deploy.Request.DeleteStackRequest()
.WithStackName("stack-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.deleteStack(
new Gs2Deploy.DeleteStackRequest()
.withStackName("stack-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.delete_stack(
deploy.DeleteStackRequest()
.with_stack_name('stack-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.delete_stack({
stackName="stack-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.delete_stack_async({
stackName="stack-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
forceDeleteStack
Forced final deletion of stack
Forcibly deletes entities in the stack. If any resources created by the stack remain, they are not deleted.
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name |
Result
Type | Description | |
---|---|---|
item | Stack | Deleted stacks |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.ForceDeleteStack(
&deploy.ForceDeleteStackRequest {
StackName: pointy.String("stack-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\ForceDeleteStackRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->forceDeleteStack(
(new ForceDeleteStackRequest())
->withStackName("stack-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.ForceDeleteStackRequest;
import io.gs2.deploy.result.ForceDeleteStackResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
ForceDeleteStackResult result = client.forceDeleteStack(
new ForceDeleteStackRequest()
.withStackName("stack-0001")
);
Stack item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.ForceDeleteStackRequest;
using Gs2.Gs2Deploy.Result.ForceDeleteStackResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.ForceDeleteStackResult> asyncResult = null;
yield return client.ForceDeleteStack(
new Gs2.Gs2Deploy.Request.ForceDeleteStackRequest()
.WithStackName("stack-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.forceDeleteStack(
new Gs2Deploy.ForceDeleteStackRequest()
.withStackName("stack-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.force_delete_stack(
deploy.ForceDeleteStackRequest()
.with_stack_name('stack-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.force_delete_stack({
stackName="stack-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.force_delete_stack_async({
stackName="stack-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteStackResources
Delete Stack Resources
Deletes resources created by the stack. It behaves much like updating the stack with an empty template, but since the template that was applied to the stack remains, the resource can be restored from the remaining template in the event of a mishandling.
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name |
Result
Type | Description | |
---|---|---|
item | Stack | Stack of deleted resources |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.DeleteStackResources(
&deploy.DeleteStackResourcesRequest {
StackName: pointy.String("stack-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\DeleteStackResourcesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteStackResources(
(new DeleteStackResourcesRequest())
->withStackName("stack-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.DeleteStackResourcesRequest;
import io.gs2.deploy.result.DeleteStackResourcesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
DeleteStackResourcesResult result = client.deleteStackResources(
new DeleteStackResourcesRequest()
.withStackName("stack-0001")
);
Stack item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.DeleteStackResourcesRequest;
using Gs2.Gs2Deploy.Result.DeleteStackResourcesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.DeleteStackResourcesResult> asyncResult = null;
yield return client.DeleteStackResources(
new Gs2.Gs2Deploy.Request.DeleteStackResourcesRequest()
.WithStackName("stack-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.deleteStackResources(
new Gs2Deploy.DeleteStackResourcesRequest()
.withStackName("stack-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.delete_stack_resources(
deploy.DeleteStackResourcesRequest()
.with_stack_name('stack-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.delete_stack_resources({
stackName="stack-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.delete_stack_resources_async({
stackName="stack-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
deleteStackEntity
Final Stack Deletion
Deletes entities in the stack. Attempting to delete a stack with remaining resources will result in an error.
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name |
Result
Type | Description | |
---|---|---|
item | Stack | Deleted stacks |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.DeleteStackEntity(
&deploy.DeleteStackEntityRequest {
StackName: pointy.String("stack-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\DeleteStackEntityRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->deleteStackEntity(
(new DeleteStackEntityRequest())
->withStackName("stack-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.DeleteStackEntityRequest;
import io.gs2.deploy.result.DeleteStackEntityResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
DeleteStackEntityResult result = client.deleteStackEntity(
new DeleteStackEntityRequest()
.withStackName("stack-0001")
);
Stack item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.DeleteStackEntityRequest;
using Gs2.Gs2Deploy.Result.DeleteStackEntityResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.DeleteStackEntityResult> asyncResult = null;
yield return client.DeleteStackEntity(
new Gs2.Gs2Deploy.Request.DeleteStackEntityRequest()
.WithStackName("stack-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.deleteStackEntity(
new Gs2Deploy.DeleteStackEntityRequest()
.withStackName("stack-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.delete_stack_entity(
deploy.DeleteStackEntityRequest()
.with_stack_name('stack-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.delete_stack_entity({
stackName="stack-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.delete_stack_entity_async({
stackName="stack-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeResources
Get list of resources
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Resource> | List of Resource |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.DescribeResources(
&deploy.DescribeResourcesRequest {
StackName: pointy.String("stack-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\DescribeResourcesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeResources(
(new DescribeResourcesRequest())
->withStackName("stack-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.DescribeResourcesRequest;
import io.gs2.deploy.result.DescribeResourcesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
DescribeResourcesResult result = client.describeResources(
new DescribeResourcesRequest()
.withStackName("stack-0001")
.withPageToken(null)
.withLimit(null)
);
List<Resource> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.DescribeResourcesRequest;
using Gs2.Gs2Deploy.Result.DescribeResourcesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.DescribeResourcesResult> asyncResult = null;
yield return client.DescribeResources(
new Gs2.Gs2Deploy.Request.DescribeResourcesRequest()
.WithStackName("stack-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.describeResources(
new Gs2Deploy.DescribeResourcesRequest()
.withStackName("stack-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.describe_resources(
deploy.DescribeResourcesRequest()
.with_stack_name('stack-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.describe_resources({
stackName="stack-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('deploy')
api_result_handler = client.describe_resources_async({
stackName="stack-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
getResource
Get Resources
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name | ||
resourceName | string | ✓ | ~ 128 chars | Resource Name |
Result
Type | Description | |
---|---|---|
item | Resource | Resource |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.GetResource(
&deploy.GetResourceRequest {
StackName: pointy.String("stack-0001"),
ResourceName: pointy.String("resource-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\GetResourceRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getResource(
(new GetResourceRequest())
->withStackName("stack-0001")
->withResourceName("resource-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.GetResourceRequest;
import io.gs2.deploy.result.GetResourceResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
GetResourceResult result = client.getResource(
new GetResourceRequest()
.withStackName("stack-0001")
.withResourceName("resource-0001")
);
Resource item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.GetResourceRequest;
using Gs2.Gs2Deploy.Result.GetResourceResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.GetResourceResult> asyncResult = null;
yield return client.GetResource(
new Gs2.Gs2Deploy.Request.GetResourceRequest()
.WithStackName("stack-0001")
.WithResourceName("resource-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.getResource(
new Gs2Deploy.GetResourceRequest()
.withStackName("stack-0001")
.withResourceName("resource-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.get_resource(
deploy.GetResourceRequest()
.with_stack_name('stack-0001')
.with_resource_name('resource-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.get_resource({
stackName="stack-0001",
resourceName="resource-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.get_resource_async({
stackName="stack-0001",
resourceName="resource-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeEvents
Get list of events
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Event> | List of Event |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.DescribeEvents(
&deploy.DescribeEventsRequest {
StackName: pointy.String("stack-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\DescribeEventsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeEvents(
(new DescribeEventsRequest())
->withStackName("stack-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.DescribeEventsRequest;
import io.gs2.deploy.result.DescribeEventsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
DescribeEventsResult result = client.describeEvents(
new DescribeEventsRequest()
.withStackName("stack-0001")
.withPageToken(null)
.withLimit(null)
);
List<Event> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.DescribeEventsRequest;
using Gs2.Gs2Deploy.Result.DescribeEventsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.DescribeEventsResult> asyncResult = null;
yield return client.DescribeEvents(
new Gs2.Gs2Deploy.Request.DescribeEventsRequest()
.WithStackName("stack-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.describeEvents(
new Gs2Deploy.DescribeEventsRequest()
.withStackName("stack-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.describe_events(
deploy.DescribeEventsRequest()
.with_stack_name('stack-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.describe_events({
stackName="stack-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('deploy')
api_result_handler = client.describe_events_async({
stackName="stack-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
getEvent
Get Event
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name | ||
eventName | string | ✓ | UUID | ~ 36 chars | Event name |
Result
Type | Description | |
---|---|---|
item | Event | Event |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.GetEvent(
&deploy.GetEventRequest {
StackName: pointy.String("stack-0001"),
EventName: pointy.String("event-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\GetEventRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getEvent(
(new GetEventRequest())
->withStackName("stack-0001")
->withEventName("event-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.GetEventRequest;
import io.gs2.deploy.result.GetEventResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
GetEventResult result = client.getEvent(
new GetEventRequest()
.withStackName("stack-0001")
.withEventName("event-0001")
);
Event item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.GetEventRequest;
using Gs2.Gs2Deploy.Result.GetEventResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.GetEventResult> asyncResult = null;
yield return client.GetEvent(
new Gs2.Gs2Deploy.Request.GetEventRequest()
.WithStackName("stack-0001")
.WithEventName("event-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.getEvent(
new Gs2Deploy.GetEventRequest()
.withStackName("stack-0001")
.withEventName("event-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.get_event(
deploy.GetEventRequest()
.with_stack_name('stack-0001')
.with_event_name('event-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.get_event({
stackName="stack-0001",
eventName="event-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.get_event_async({
stackName="stack-0001",
eventName="event-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
describeOutputs
Get list of outputs
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name | ||
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<Output> | List of Output |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.DescribeOutputs(
&deploy.DescribeOutputsRequest {
StackName: pointy.String("stack-0001"),
PageToken: nil,
Limit: nil,
}
)
if err != nil {
panic("error occurred")
}
items := result.Items
nextPageToken := result.NextPageToken
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\DescribeOutputsRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeOutputs(
(new DescribeOutputsRequest())
->withStackName("stack-0001")
->withPageToken(null)
->withLimit(null)
);
$items = $result->getItems();
$nextPageToken = $result->getNextPageToken();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.DescribeOutputsRequest;
import io.gs2.deploy.result.DescribeOutputsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
DescribeOutputsResult result = client.describeOutputs(
new DescribeOutputsRequest()
.withStackName("stack-0001")
.withPageToken(null)
.withLimit(null)
);
List<Output> items = result.getItems();
String nextPageToken = result.getNextPageToken();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.DescribeOutputsRequest;
using Gs2.Gs2Deploy.Result.DescribeOutputsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.DescribeOutputsResult> asyncResult = null;
yield return client.DescribeOutputs(
new Gs2.Gs2Deploy.Request.DescribeOutputsRequest()
.WithStackName("stack-0001")
.WithPageToken(null)
.WithLimit(null),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var items = result.Items;
var nextPageToken = result.NextPageToken;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.describeOutputs(
new Gs2Deploy.DescribeOutputsRequest()
.withStackName("stack-0001")
.withPageToken(null)
.withLimit(null)
);
const items = result.getItems();
const nextPageToken = result.getNextPageToken();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.describe_outputs(
deploy.DescribeOutputsRequest()
.with_stack_name('stack-0001')
.with_page_token(None)
.with_limit(None)
)
items = result.items
next_page_token = result.next_page_token
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.describe_outputs({
stackName="stack-0001",
pageToken=nil,
limit=nil,
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
client = gs2('deploy')
api_result_handler = client.describe_outputs_async({
stackName="stack-0001",
pageToken=nil,
limit=nil,
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
items = result.items;
nextPageToken = result.nextPageToken;
getOutput
Get Output
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stackName | string | ✓ | ~ 128 chars | Stack name | ||
outputName | string | ✓ | ~ 1024 chars | Output Name |
Result
Type | Description | |
---|---|---|
item | Output | Output |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/deploy"
import "github.com/openlyinc/pointy"
session := core.Gs2RestSession{
Credential: &core.BasicGs2Credential{
ClientId: "your client id",
ClientSecret: "your client secret",
},
Region: core.ApNortheast1,
}
if err := session.Connect(); err != nil {
panic("error occurred")
}
client := deploy.Gs2DeployRestClient{
Session: &session,
}
result, err := client.GetOutput(
&deploy.GetOutputRequest {
StackName: pointy.String("stack-0001"),
OutputName: pointy.String("output-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Deploy\Gs2DeployRestClient;
use Gs2\Deploy\Request\GetOutputRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getOutput(
(new GetOutputRequest())
->withStackName("stack-0001")
->withOutputName("output-0001")
);
$item = $result->getItem();
} catch (Gs2Exception $e) {
exit("error occurred")
}
import io.gs2.core.model.Region;
import io.gs2.core.model.BasicGs2Credential;
import io.gs2.core.rest.Gs2RestSession;
import io.gs2.core.exception.Gs2Exception;
import io.gs2.deploy.rest.Gs2DeployRestClient;
import io.gs2.deploy.request.GetOutputRequest;
import io.gs2.deploy.result.GetOutputResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2DeployRestClient client = new Gs2DeployRestClient(session);
try {
GetOutputResult result = client.getOutput(
new GetOutputRequest()
.withStackName("stack-0001")
.withOutputName("output-0001")
);
Output item = result.getItem();
} catch (Gs2Exception e) {
System.exit(1);
}
using Gs2.Core.Model.Region;
using Gs2.Core.Model.BasicGs2Credential;
using Gs2.Core.Net.Gs2RestSession;
using Gs2.Core.Exception.Gs2Exception;
using Gs2.Core.AsyncResult;
using Gs2.Gs2Deploy.Gs2DeployRestClient;
using Gs2.Gs2Deploy.Request.GetOutputRequest;
using Gs2.Gs2Deploy.Result.GetOutputResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2DeployRestClient(session);
AsyncResult<Gs2.Gs2Deploy.Result.GetOutputResult> asyncResult = null;
yield return client.GetOutput(
new Gs2.Gs2Deploy.Request.GetOutputRequest()
.WithStackName("stack-0001")
.WithOutputName("output-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
import Gs2Core from '@/gs2/core';
import * as Gs2Deploy from '@/gs2/deploy';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Deploy.Gs2DeployRestClient(session);
try {
const result = await client.getOutput(
new Gs2Deploy.GetOutputRequest()
.withStackName("stack-0001")
.withOutputName("output-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import deploy
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = deploy.Gs2DeployRestClient(session)
try:
result = client.get_output(
deploy.GetOutputRequest()
.with_stack_name('stack-0001')
.with_output_name('output-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('deploy')
api_result = client.get_output({
stackName="stack-0001",
outputName="output-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
client = gs2('deploy')
api_result_handler = client.get_output_async({
stackName="stack-0001",
outputName="output-0001",
})
api_result = api_result_handler() -- Call the handler to get the result
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;