API Reference of GS2-Freeze SDK
Model
Stage
Stage
A stage is an environment information that fixes the program version. You can have multiple stages for one project. A stage has a source stage, and it is possible to switch to the version fixed by the source stage.
By using this mechanism, you can first incorporate the latest version into the dev stage and check the operation at the developer level. If there seems to be no problem, the dev stage can be reflected in the stg stage, which has the dev stage as the source stage. After QA, the stg stage can be reflected in the live stage, which has the stg stage as the source stage.
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stageId | string | ✓ | ~ 1024 chars | Stage GRN | ||
name | string | ✓ | ~ 128 chars | Stage name | ||
sourceStageName | string | ~ 128 chars | Source Stage name | |||
sortNumber | int | ✓ | ~ 100 | Sort number | ||
status | enum { “Active”, “Updating”, “UpdateFailed” } | ✓ | “Active” | ~ 128 chars | Status | |
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 |
Definition of enumeration type to be specified for status
Enumerator String Definition | Description |
---|---|
Active | Active |
Updating | Updating |
UpdateFailed | Update Failed |
Related methods
Output
Output of stage update progress
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
outputId | string | ✓ | ~ 1024 chars | Stage update progress output GRN | ||
name | string | ✓ | UUID | ~ 36 chars | Output Name | |
text | string | ✓ | ~ 1048576 chars | Text | ||
createdAt | long | ✓ | Now | Timestamp (Unix time unit:milliseconds) | ||
revision | long | 0 | ~ 9223372036854775805 | Revision |
Related methods
Microservice
Microservice
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Microservice name | ||
version | string | ✓ | ~ 32 chars | Microservice version |
Related methods
Methods
describeStages
Get list of stages
Request
Type | Condition | Require | Default | Limitation | Description |
---|
Result
Type | Description | |
---|---|---|
items | List<Stage> | List of Stage |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/freeze"
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 := freeze.Gs2FreezeRestClient{
Session: &session,
}
result, err := client.DescribeStages(
&freeze.DescribeStagesRequest {
}
)
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\Freeze\Gs2FreezeRestClient;
use Gs2\Freeze\Request\DescribeStagesRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->describeStages(
(new DescribeStagesRequest())
);
$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.freeze.rest.Gs2FreezeRestClient;
import io.gs2.freeze.request.DescribeStagesRequest;
import io.gs2.freeze.result.DescribeStagesResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2FreezeRestClient client = new Gs2FreezeRestClient(session);
try {
DescribeStagesResult result = client.describeStages(
new DescribeStagesRequest()
);
List<Stage> 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.Gs2Freeze.Gs2FreezeRestClient;
using Gs2.Gs2Freeze.Request.DescribeStagesRequest;
using Gs2.Gs2Freeze.Result.DescribeStagesResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2FreezeRestClient(session);
AsyncResult<Gs2.Gs2Freeze.Result.DescribeStagesResult> asyncResult = null;
yield return client.DescribeStages(
new Gs2.Gs2Freeze.Request.DescribeStagesRequest(),
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 Gs2Freeze from '@/gs2/freeze';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Freeze.Gs2FreezeRestClient(session);
try {
const result = await client.describeStages(
new Gs2Freeze.DescribeStagesRequest()
);
const items = result.getItems();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import freeze
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = freeze.Gs2FreezeRestClient(session)
try:
result = client.describe_stages(
freeze.DescribeStagesRequest()
)
items = result.items
except core.Gs2Exception as e:
exit(1)
client = gs2('freeze')
api_result = client.describe_stages({
})
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('freeze')
api_result_handler = client.describe_stages_async({
})
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;
getStage
Get stage
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stageName | string | ✓ | ~ 128 chars | Stage name |
Result
Type | Description | |
---|---|---|
item | Stage | Stage |
source | List<Microservice> | List of version of source microservices |
current | List<Microservice> | List of current version of microservices |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/freeze"
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 := freeze.Gs2FreezeRestClient{
Session: &session,
}
result, err := client.GetStage(
&freeze.GetStageRequest {
StageName: pointy.String("namespace-0001"),
}
)
if err != nil {
panic("error occurred")
}
item := result.Item
source := result.Source
current := result.Current
use Gs2\Core\Model\BasicGs2Credential;
use Gs2\Core\Model\Region;
use Gs2\Core\Net\Gs2RestSession;
use Gs2\Core\Exception\Gs2Exception;
use Gs2\Freeze\Gs2FreezeRestClient;
use Gs2\Freeze\Request\GetStageRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->getStage(
(new GetStageRequest())
->withStageName("namespace-0001")
);
$item = $result->getItem();
$source = $result->getSource();
$current = $result->getCurrent();
} 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.freeze.rest.Gs2FreezeRestClient;
import io.gs2.freeze.request.GetStageRequest;
import io.gs2.freeze.result.GetStageResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2FreezeRestClient client = new Gs2FreezeRestClient(session);
try {
GetStageResult result = client.getStage(
new GetStageRequest()
.withStageName("namespace-0001")
);
Stage item = result.getItem();
List<Microservice> source = result.getSource();
List<Microservice> current = result.getCurrent();
} 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.Gs2Freeze.Gs2FreezeRestClient;
using Gs2.Gs2Freeze.Request.GetStageRequest;
using Gs2.Gs2Freeze.Result.GetStageResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2FreezeRestClient(session);
AsyncResult<Gs2.Gs2Freeze.Result.GetStageResult> asyncResult = null;
yield return client.GetStage(
new Gs2.Gs2Freeze.Request.GetStageRequest()
.WithStageName("namespace-0001"),
r => asyncResult = r
);
if (asyncResult.Error != null) {
throw asyncResult.Error;
}
var result = asyncResult.Result;
var item = result.Item;
var source = result.Source;
var current = result.Current;
import Gs2Core from '@/gs2/core';
import * as Gs2Freeze from '@/gs2/freeze';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Freeze.Gs2FreezeRestClient(session);
try {
const result = await client.getStage(
new Gs2Freeze.GetStageRequest()
.withStageName("namespace-0001")
);
const item = result.getItem();
const source = result.getSource();
const current = result.getCurrent();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import freeze
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = freeze.Gs2FreezeRestClient(session)
try:
result = client.get_stage(
freeze.GetStageRequest()
.with_stage_name('namespace-0001')
)
item = result.item
source = result.source
current = result.current
except core.Gs2Exception as e:
exit(1)
client = gs2('freeze')
api_result = client.get_stage({
stageName="namespace-0001",
})
if(api_result.isError) then
-- When error occurs
fail(api_result['statusCode'], api_result['message'])
end
result = api_result.result
item = result.item;
source = result.source;
current = result.current;
client = gs2('freeze')
api_result_handler = client.get_stage_async({
stageName="namespace-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;
source = result.source;
current = result.current;
promoteStage
Update stage
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stageName | string | ✓ | ~ 128 chars | Stage name |
Result
Type | Description | |
---|---|---|
item | Stage | Updated stage |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/freeze"
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 := freeze.Gs2FreezeRestClient{
Session: &session,
}
result, err := client.PromoteStage(
&freeze.PromoteStageRequest {
StageName: pointy.String("namespace-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\Freeze\Gs2FreezeRestClient;
use Gs2\Freeze\Request\PromoteStageRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->promoteStage(
(new PromoteStageRequest())
->withStageName("namespace-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.freeze.rest.Gs2FreezeRestClient;
import io.gs2.freeze.request.PromoteStageRequest;
import io.gs2.freeze.result.PromoteStageResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2FreezeRestClient client = new Gs2FreezeRestClient(session);
try {
PromoteStageResult result = client.promoteStage(
new PromoteStageRequest()
.withStageName("namespace-0001")
);
Stage 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.Gs2Freeze.Gs2FreezeRestClient;
using Gs2.Gs2Freeze.Request.PromoteStageRequest;
using Gs2.Gs2Freeze.Result.PromoteStageResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2FreezeRestClient(session);
AsyncResult<Gs2.Gs2Freeze.Result.PromoteStageResult> asyncResult = null;
yield return client.PromoteStage(
new Gs2.Gs2Freeze.Request.PromoteStageRequest()
.WithStageName("namespace-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 Gs2Freeze from '@/gs2/freeze';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Freeze.Gs2FreezeRestClient(session);
try {
const result = await client.promoteStage(
new Gs2Freeze.PromoteStageRequest()
.withStageName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import freeze
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = freeze.Gs2FreezeRestClient(session)
try:
result = client.promote_stage(
freeze.PromoteStageRequest()
.with_stage_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('freeze')
api_result = client.promote_stage({
stageName="namespace-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('freeze')
api_result_handler = client.promote_stage_async({
stageName="namespace-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;
rollbackStage
Rollback stage
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stageName | string | ✓ | ~ 128 chars | Stage name |
Result
Type | Description | |
---|---|---|
item | Stage | Updated stage |
Implementation Example
import "github.com/gs2io/gs2-golang-sdk/core"
import "github.com/gs2io/gs2-golang-sdk/freeze"
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 := freeze.Gs2FreezeRestClient{
Session: &session,
}
result, err := client.RollbackStage(
&freeze.RollbackStageRequest {
StageName: pointy.String("namespace-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\Freeze\Gs2FreezeRestClient;
use Gs2\Freeze\Request\RollbackStageRequest;
$session = new Gs2RestSession(
new BasicGs2Credential(
"your client id",
"your client secret"
),
Region::AP_NORTHEAST_1
);
$session->open();
$client = new Gs2AccountRestClient(
$session
);
try {
$result = $client->rollbackStage(
(new RollbackStageRequest())
->withStageName("namespace-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.freeze.rest.Gs2FreezeRestClient;
import io.gs2.freeze.request.RollbackStageRequest;
import io.gs2.freeze.result.RollbackStageResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2FreezeRestClient client = new Gs2FreezeRestClient(session);
try {
RollbackStageResult result = client.rollbackStage(
new RollbackStageRequest()
.withStageName("namespace-0001")
);
Stage 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.Gs2Freeze.Gs2FreezeRestClient;
using Gs2.Gs2Freeze.Request.RollbackStageRequest;
using Gs2.Gs2Freeze.Result.RollbackStageResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2FreezeRestClient(session);
AsyncResult<Gs2.Gs2Freeze.Result.RollbackStageResult> asyncResult = null;
yield return client.RollbackStage(
new Gs2.Gs2Freeze.Request.RollbackStageRequest()
.WithStageName("namespace-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 Gs2Freeze from '@/gs2/freeze';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Freeze.Gs2FreezeRestClient(session);
try {
const result = await client.rollbackStage(
new Gs2Freeze.RollbackStageRequest()
.withStageName("namespace-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import freeze
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = freeze.Gs2FreezeRestClient(session)
try:
result = client.rollback_stage(
freeze.RollbackStageRequest()
.with_stage_name('namespace-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('freeze')
api_result = client.rollback_stage({
stageName="namespace-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('freeze')
api_result_handler = client.rollback_stage_async({
stageName="namespace-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 a list of output of stage update progress
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stageName | string | ✓ | ~ 128 chars | Stage 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 of stage update progress |
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/freeze"
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 := freeze.Gs2FreezeRestClient{
Session: &session,
}
result, err := client.DescribeOutputs(
&freeze.DescribeOutputsRequest {
StageName: pointy.String("namespace-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\Freeze\Gs2FreezeRestClient;
use Gs2\Freeze\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())
->withStageName("namespace-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.freeze.rest.Gs2FreezeRestClient;
import io.gs2.freeze.request.DescribeOutputsRequest;
import io.gs2.freeze.result.DescribeOutputsResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2FreezeRestClient client = new Gs2FreezeRestClient(session);
try {
DescribeOutputsResult result = client.describeOutputs(
new DescribeOutputsRequest()
.withStageName("namespace-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.Gs2Freeze.Gs2FreezeRestClient;
using Gs2.Gs2Freeze.Request.DescribeOutputsRequest;
using Gs2.Gs2Freeze.Result.DescribeOutputsResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2FreezeRestClient(session);
AsyncResult<Gs2.Gs2Freeze.Result.DescribeOutputsResult> asyncResult = null;
yield return client.DescribeOutputs(
new Gs2.Gs2Freeze.Request.DescribeOutputsRequest()
.WithStageName("namespace-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 Gs2Freeze from '@/gs2/freeze';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Freeze.Gs2FreezeRestClient(session);
try {
const result = await client.describeOutputs(
new Gs2Freeze.DescribeOutputsRequest()
.withStageName("namespace-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 freeze
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = freeze.Gs2FreezeRestClient(session)
try:
result = client.describe_outputs(
freeze.DescribeOutputsRequest()
.with_stage_name('namespace-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('freeze')
api_result = client.describe_outputs({
stageName="namespace-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('freeze')
api_result_handler = client.describe_outputs_async({
stageName="namespace-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
Obtain output of stage update progress
Request
Type | Condition | Require | Default | Limitation | Description | |
---|---|---|---|---|---|---|
stageName | string | ✓ | ~ 128 chars | Stage name | ||
outputName | string | ✓ | UUID | ~ 36 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/freeze"
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 := freeze.Gs2FreezeRestClient{
Session: &session,
}
result, err := client.GetOutput(
&freeze.GetOutputRequest {
StageName: pointy.String("namespace-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\Freeze\Gs2FreezeRestClient;
use Gs2\Freeze\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())
->withStageName("namespace-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.freeze.rest.Gs2FreezeRestClient;
import io.gs2.freeze.request.GetOutputRequest;
import io.gs2.freeze.result.GetOutputResult;
Gs2RestSession session = new Gs2RestSession(
Region.AP_NORTHEAST_1,
new BasicGs2Credential(
'your client id',
'your client secret'
)
);
session.connect();
Gs2FreezeRestClient client = new Gs2FreezeRestClient(session);
try {
GetOutputResult result = client.getOutput(
new GetOutputRequest()
.withStageName("namespace-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.Gs2Freeze.Gs2FreezeRestClient;
using Gs2.Gs2Freeze.Request.GetOutputRequest;
using Gs2.Gs2Freeze.Result.GetOutputResult;
var session = new Gs2RestSession(
new BasicGs2Credential(
'your client id',
'your client secret'
),
Region.ApNortheast1
);
yield return session.Open();
var client = new Gs2FreezeRestClient(session);
AsyncResult<Gs2.Gs2Freeze.Result.GetOutputResult> asyncResult = null;
yield return client.GetOutput(
new Gs2.Gs2Freeze.Request.GetOutputRequest()
.WithStageName("namespace-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 Gs2Freeze from '@/gs2/freeze';
const session = new Gs2Core.Gs2RestSession(
"ap-northeast-1",
new Gs2Core.BasicGs2Credential(
'your client id',
'your client secret'
)
);
await session.connect();
const client = new Gs2Freeze.Gs2FreezeRestClient(session);
try {
const result = await client.getOutput(
new Gs2Freeze.GetOutputRequest()
.withStageName("namespace-0001")
.withOutputName("output-0001")
);
const item = result.getItem();
} catch (e) {
process.exit(1);
}
from gs2 import core
from gs2 import freeze
session = core.Gs2RestSession(
core.BasicGs2Credential(
'your client id',
'your client secret'
),
"ap-northeast-1",
)
session.connect()
client = freeze.Gs2FreezeRestClient(session)
try:
result = client.get_output(
freeze.GetOutputRequest()
.with_stage_name('namespace-0001')
.with_output_name('output-0001')
)
item = result.item
except core.Gs2Exception as e:
exit(1)
client = gs2('freeze')
api_result = client.get_output({
stageName="namespace-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('freeze')
api_result_handler = client.get_output_async({
stageName="namespace-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;