GS2-Formation GS2-Deploy/CDK リファレンス
エンティティ
Namespace
ネームスペース
ネームスペースは一つのプロジェクトで同じサービスを異なる用途で複数利用できるようにするための仕組みです。
GS2 のサービスは基本的にネームスペースというレイヤーがあり、ネームスペースが異なれば同じサービスでもまったく別のデータ空間として取り扱われます。
そのため、各サービスの利用を開始するにあたってネームスペースを作成する必要があります。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | ネームスペース名 | |
description | string | ~ 1024文字 | 説明文 | ||
transactionSetting | TransactionSetting | トランザクション設定 | |||
updateMoldScript | ScriptSetting | キャパシティを更新するときに実行するスクリプト | |||
updateFormScript | ScriptSetting | フォームを更新するときに実行するスクリプト | |||
updatePropertyFormScript | ScriptSetting | プロパティフォームを更新するときに実行するスクリプト | |||
logSetting | LogSetting | ログの出力設定 |
GetAttr
型 | 説明 | |
---|---|---|
Item | Namespace | 作成したネームスペース |
実装例
Type: GS2::Formation::Namespace
Properties:
Name: namespace-0001
Description: null
TransactionSetting:
EnableAutoRun: true
QueueNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001
KeyId: grn:gs2:ap-northeast-1:YourOwnerId:key:namespace-0001:key:key-0001
UpdateMoldScript: null
UpdateFormScript: null
UpdatePropertyFormScript: null
LogSetting:
LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001
import "github.com/gs2io/gs2-golang-cdk/core"
import "github.com/gs2io/gs2-golang-cdk/formation"
import "github.com/openlyinc/pointy"
SampleStack := core.NewStack()
formation.NewNamespace(
&SampleStack,
"namespace-0001",
formation.NamespaceOptions{
TransactionSetting: &core.TransactionSetting{
EnableAutoRun: true,
QueueNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001",
},
LogSetting: &core.LogSetting{
LoggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
},
)
println(SampleStack.Yaml()) // Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
new \Gs2Cdk\Formation\Model\Namespace_(
stack: $this,
name: "namespace-0001",
options: new \Gs2Cdk\Formation\Model\Options\NamespaceOptions(
transactionSetting: new \Gs2Cdk\Core\Model\TransactionSetting(
enableAutoRun: True,
queueNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"
),
logSetting: new \Gs2Cdk\Core\Model\LogSetting(
loggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
)
);
}
}
print((new SampleStack())->yaml()); // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.formation.model.Namespace(
this,
"namespace-0001",
new io.gs2.cdk.formation.model.options.NamespaceOptions()
.withTransactionSetting(new io.gs2.cdk.core.model.TransactionSetting(
new io.gs2.cdk.core.model.options.TransactionSettingOptions()
.withQueueNamespaceId("grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001")
))
.withLogSetting(new io.gs2.cdk.core.model.LogSetting(
"grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
))
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Formation.Model.Namespace(
stack: this,
name: "namespace-0001",
options: new Gs2Cdk.Gs2Formation.Model.Options.NamespaceOptions
{
transactionSetting = new Gs2Cdk.Core.Model.TransactionSetting(
options: new Gs2Cdk.Core.Model.TransactionSettingOptions
{
queueNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"
}
),
logSetting = new Gs2Cdk.Core.Model.LogSetting(
loggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Template
import core from "@/gs2cdk/core";
import formation from "@/gs2cdk/formation";
class SampleStack extends core.Stack
{
public constructor() {
super();
new formation.model.Namespace(
this,
"namespace-0001",
{
transactionSetting: new core.TransactionSetting(
null,
"grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001"
),
logSetting: new core.LogSetting(
"grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
}
);
}
}
console.log(new SampleStack().yaml()); // Generate Template
from gs2_cdk import Stack, core, formation
class SampleStack(Stack):
def __init__(self):
super().__init__()
formation.Namespace(
stack=self,
name='namespace-0001',
options=formation.NamespaceOptions(
transaction_setting=core.TransactionSetting(
queue_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:queue:queue-0001',
),
log_setting=core.LogSetting(
logging_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
),
),
)
print(SampleStack().yaml()) # Generate Template
CurrentFormMaster
現在有効なマスターデータ
GS2ではマスターデータの管理にJSON形式のファイルを使用します。
ファイルをアップロードすることで、実際にサーバーに設定を反映することができます。
JSONファイルを作成する方法として、マネージメントコンソール上でのマスターデータエディタを提供していますが
よりゲームの運営に相応しいツールを作成し、適切なフォーマットのJSONファイルを書き出すことでもサービスを利用可能です。
Note
JSONファイルの形式については GS2-Formation マスターデータリファレンス をご参照ください。型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128文字 | ネームスペース名 | |
settings | string | ✓ | ~ 5242880文字 | マスターデータ |
GetAttr
型 | 説明 | |
---|---|---|
Item | CurrentFormMaster | 更新した現在有効なフォーム設定 |
実装例
Type: GS2::Formation::CurrentFormMaster
Properties:
NamespaceName: namespace-0001
Settings: {
"version": "2019-09-09",
"moldModels": [
{
"name": "party",
"initialMaxCapacity": 10,
"maxCapacity": 20,
"formModel":
{
"name": "party",
"metadata": "PARTY",
"slots": [
{
"name": "tank",
"metadata": "TANK",
"propertyRegex": "grn:.*"
},
{
"name": "healer",
"metadata": "HEALER",
"propertyRegex": "grn:.*"
},
{
"name": "dps_1",
"metadata": "DPS",
"propertyRegex": "grn:.*"
},
{
"name": "dps_2",
"metadata": "DPS",
"propertyRegex": "grn:.*"
}
]
},
"metadata": "PARTY"
},
{
"name": "equipment",
"initialMaxCapacity": 20,
"maxCapacity": 30,
"formModel":
{
"name": "equipment",
"metadata": "EQUIPMENT",
"slots": [
{
"name": "head",
"metadata": "HEAD",
"propertyRegex": "grn:.*"
},
{
"name": "body",
"metadata": "BODY",
"propertyRegex": "grn:.*"
},
{
"name": "leg",
"metadata": "LEG",
"propertyRegex": "grn:.*"
}
]
},
"metadata": "EQUIPMENT"
}
],
"propertyFormModels": []
}
import "github.com/gs2io/gs2-golang-cdk/core"
import "github.com/gs2io/gs2-golang-cdk/formation"
import "github.com/openlyinc/pointy"
SampleStack := core.NewStack()
formation.NewNamespace(
&SampleStack,
"namespace-0001",
formation.NamespaceOptions{},
).MasterData(
[]formation.MoldModel{
formation.NewMoldModel(
"party",
10,
20,
formation.NewFormModel(
"party",
[]formation.SlotModel{
formation.NewSlotModel(
"tank",
"grn:.*",
formation.SlotModelOptions{
Metadata: pointy.String("TANK"),
},
),
formation.NewSlotModel(
"healer",
"grn:.*",
formation.SlotModelOptions{
Metadata: pointy.String("HEALER"),
},
),
formation.NewSlotModel(
"dps_1",
"grn:.*",
formation.SlotModelOptions{
Metadata: pointy.String("DPS"),
},
),
formation.NewSlotModel(
"dps_2",
"grn:.*",
formation.SlotModelOptions{
Metadata: pointy.String("DPS"),
},
),
},
formation.FormModelOptions{
Metadata: pointy.String("PARTY"),
},
),
formation.MoldModelOptions{
Metadata: pointy.String("PARTY"),
},
),
formation.NewMoldModel(
"equipment",
20,
30,
formation.NewFormModel(
"equipment",
[]formation.SlotModel{
formation.NewSlotModel(
"head",
"grn:.*",
formation.SlotModelOptions{
Metadata: pointy.String("HEAD"),
},
),
formation.NewSlotModel(
"body",
"grn:.*",
formation.SlotModelOptions{
Metadata: pointy.String("BODY"),
},
),
formation.NewSlotModel(
"leg",
"grn:.*",
formation.SlotModelOptions{
Metadata: pointy.String("LEG"),
},
),
},
formation.FormModelOptions{
Metadata: pointy.String("EQUIPMENT"),
},
),
formation.MoldModelOptions{
Metadata: pointy.String("EQUIPMENT"),
},
),
},
[]formation.PropertyFormModel{
},
)
println(SampleStack.Yaml()) // Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
(new \Gs2Cdk\Formation\Model\Namespace_(
stack: $this,
name: "namespace-0001"
))->masterData(
[
new \Gs2Cdk\Formation\Model\MoldModel(
name:"party",
initialMaxCapacity:10,
maxCapacity:20,
formModel:new \Gs2Cdk\Formation\Model\FormModel(
name: "party",
slots: [
new \Gs2Cdk\Formation\Model\SlotModel(
name: "tank",
propertyRegex: "grn:.*",
options: new \Gs2Cdk\Formation\Model\Options\SlotModelOptions(
metadata: "TANK",
)
),
new \Gs2Cdk\Formation\Model\SlotModel(
name: "healer",
propertyRegex: "grn:.*",
options: new \Gs2Cdk\Formation\Model\Options\SlotModelOptions(
metadata: "HEALER",
)
),
new \Gs2Cdk\Formation\Model\SlotModel(
name: "dps_1",
propertyRegex: "grn:.*",
options: new \Gs2Cdk\Formation\Model\Options\SlotModelOptions(
metadata: "DPS",
)
),
new \Gs2Cdk\Formation\Model\SlotModel(
name: "dps_2",
propertyRegex: "grn:.*",
options: new \Gs2Cdk\Formation\Model\Options\SlotModelOptions(
metadata: "DPS",
)
),
],
options: new \Gs2Cdk\Formation\Model\Options\FormModelOptions(
metadata: "PARTY",
)
),
options: new \Gs2Cdk\Formation\Model\Options\MoldModelOptions(
metadata:"PARTY"
)
),
new \Gs2Cdk\Formation\Model\MoldModel(
name:"equipment",
initialMaxCapacity:20,
maxCapacity:30,
formModel:new \Gs2Cdk\Formation\Model\FormModel(
name: "equipment",
slots: [
new \Gs2Cdk\Formation\Model\SlotModel(
name: "head",
propertyRegex: "grn:.*",
options: new \Gs2Cdk\Formation\Model\Options\SlotModelOptions(
metadata: "HEAD",
)
),
new \Gs2Cdk\Formation\Model\SlotModel(
name: "body",
propertyRegex: "grn:.*",
options: new \Gs2Cdk\Formation\Model\Options\SlotModelOptions(
metadata: "BODY",
)
),
new \Gs2Cdk\Formation\Model\SlotModel(
name: "leg",
propertyRegex: "grn:.*",
options: new \Gs2Cdk\Formation\Model\Options\SlotModelOptions(
metadata: "LEG",
)
),
],
options: new \Gs2Cdk\Formation\Model\Options\FormModelOptions(
metadata: "EQUIPMENT",
)
),
options: new \Gs2Cdk\Formation\Model\Options\MoldModelOptions(
metadata:"EQUIPMENT"
)
)
],
[
]
);
}
}
print((new SampleStack())->yaml()); // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.formation.model.Namespace(
this,
"namespace-0001"
).masterData(
Arrays.asList(
new io.gs2.cdk.formation.model.MoldModel(
"party",
10,
20,
new io.gs2.cdk.formation.model.FormModel(
"party",
Arrays.asList(
new io.gs2.cdk.formation.model.SlotModel(
"tank",
"grn:.*",
new io.gs2.cdk.formation.model.options.SlotModelOptions()
.withMetadata("TANK")
),
new io.gs2.cdk.formation.model.SlotModel(
"healer",
"grn:.*",
new io.gs2.cdk.formation.model.options.SlotModelOptions()
.withMetadata("HEALER")
),
new io.gs2.cdk.formation.model.SlotModel(
"dps_1",
"grn:.*",
new io.gs2.cdk.formation.model.options.SlotModelOptions()
.withMetadata("DPS")
),
new io.gs2.cdk.formation.model.SlotModel(
"dps_2",
"grn:.*",
new io.gs2.cdk.formation.model.options.SlotModelOptions()
.withMetadata("DPS")
)
),
new io.gs2.cdk.formation.model.options.FormModelOptions()
.withMetadata("PARTY")
),
new io.gs2.cdk.formation.model.options.MoldModelOptions()
.withMetadata("PARTY")
),
new io.gs2.cdk.formation.model.MoldModel(
"equipment",
20,
30,
new io.gs2.cdk.formation.model.FormModel(
"equipment",
Arrays.asList(
new io.gs2.cdk.formation.model.SlotModel(
"head",
"grn:.*",
new io.gs2.cdk.formation.model.options.SlotModelOptions()
.withMetadata("HEAD")
),
new io.gs2.cdk.formation.model.SlotModel(
"body",
"grn:.*",
new io.gs2.cdk.formation.model.options.SlotModelOptions()
.withMetadata("BODY")
),
new io.gs2.cdk.formation.model.SlotModel(
"leg",
"grn:.*",
new io.gs2.cdk.formation.model.options.SlotModelOptions()
.withMetadata("LEG")
)
),
new io.gs2.cdk.formation.model.options.FormModelOptions()
.withMetadata("EQUIPMENT")
),
new io.gs2.cdk.formation.model.options.MoldModelOptions()
.withMetadata("EQUIPMENT")
)
),
Arrays.asList(
)
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Formation.Model.Namespace(
stack: this,
name: "namespace-0001"
).MasterData(
new Gs2Cdk.Gs2Formation.Model.MoldModel[] {
new Gs2Cdk.Gs2Formation.Model.MoldModel(
name: "party",
initialMaxCapacity: 10,
maxCapacity: 20,
formModel: new Gs2Cdk.Gs2Formation.Model.FormModel(
name: "party",
slots: new Gs2Cdk.Gs2Formation.Model.SlotModel[]
{
new Gs2Cdk.Gs2Formation.Model.SlotModel(
name: "tank",
propertyRegex: "grn:.*",
options: new Gs2Cdk.Gs2Formation.Model.Options.SlotModelOptions
{
metadata = "TANK"
}
),
new Gs2Cdk.Gs2Formation.Model.SlotModel(
name: "healer",
propertyRegex: "grn:.*",
options: new Gs2Cdk.Gs2Formation.Model.Options.SlotModelOptions
{
metadata = "HEALER"
}
),
new Gs2Cdk.Gs2Formation.Model.SlotModel(
name: "dps_1",
propertyRegex: "grn:.*",
options: new Gs2Cdk.Gs2Formation.Model.Options.SlotModelOptions
{
metadata = "DPS"
}
),
new Gs2Cdk.Gs2Formation.Model.SlotModel(
name: "dps_2",
propertyRegex: "grn:.*",
options: new Gs2Cdk.Gs2Formation.Model.Options.SlotModelOptions
{
metadata = "DPS"
}
)
},
options: new Gs2Cdk.Gs2Formation.Model.Options.FormModelOptions
{
metadata = "PARTY"
}
),
options: new Gs2Cdk.Gs2Formation.Model.Options.MoldModelOptions
{
metadata = "PARTY"
}
),
new Gs2Cdk.Gs2Formation.Model.MoldModel(
name: "equipment",
initialMaxCapacity: 20,
maxCapacity: 30,
formModel: new Gs2Cdk.Gs2Formation.Model.FormModel(
name: "equipment",
slots: new Gs2Cdk.Gs2Formation.Model.SlotModel[]
{
new Gs2Cdk.Gs2Formation.Model.SlotModel(
name: "head",
propertyRegex: "grn:.*",
options: new Gs2Cdk.Gs2Formation.Model.Options.SlotModelOptions
{
metadata = "HEAD"
}
),
new Gs2Cdk.Gs2Formation.Model.SlotModel(
name: "body",
propertyRegex: "grn:.*",
options: new Gs2Cdk.Gs2Formation.Model.Options.SlotModelOptions
{
metadata = "BODY"
}
),
new Gs2Cdk.Gs2Formation.Model.SlotModel(
name: "leg",
propertyRegex: "grn:.*",
options: new Gs2Cdk.Gs2Formation.Model.Options.SlotModelOptions
{
metadata = "LEG"
}
)
},
options: new Gs2Cdk.Gs2Formation.Model.Options.FormModelOptions
{
metadata = "EQUIPMENT"
}
),
options: new Gs2Cdk.Gs2Formation.Model.Options.MoldModelOptions
{
metadata = "EQUIPMENT"
}
)
},
new Gs2Cdk.Gs2Formation.Model.PropertyFormModel[] {
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Template
import core from "@/gs2cdk/core";
import formation from "@/gs2cdk/formation";
class SampleStack extends core.Stack
{
public constructor() {
super();
new formation.model.Namespace(
this,
"namespace-0001",
).masterData(
[
new formation.model.MoldModel(
"party",
10,
20,
new formation.model.FormModel(
"party",
[
new formation.model.SlotModel(
"tank",
"grn:.*",
{
metadata: "TANK"
}
),
new formation.model.SlotModel(
"healer",
"grn:.*",
{
metadata: "HEALER"
}
),
new formation.model.SlotModel(
"dps_1",
"grn:.*",
{
metadata: "DPS"
}
),
new formation.model.SlotModel(
"dps_2",
"grn:.*",
{
metadata: "DPS"
}
),
],
{
metadata: "PARTY"
}
),
{
metadata: "PARTY"
}
),
new formation.model.MoldModel(
"equipment",
20,
30,
new formation.model.FormModel(
"equipment",
[
new formation.model.SlotModel(
"head",
"grn:.*",
{
metadata: "HEAD"
}
),
new formation.model.SlotModel(
"body",
"grn:.*",
{
metadata: "BODY"
}
),
new formation.model.SlotModel(
"leg",
"grn:.*",
{
metadata: "LEG"
}
),
],
{
metadata: "EQUIPMENT"
}
),
{
metadata: "EQUIPMENT"
}
)
],
[
]
);
}
}
console.log(new SampleStack().yaml()); // Generate Template
from gs2_cdk import Stack, core, formation
class SampleStack(Stack):
def __init__(self):
super().__init__()
formation.Namespace(
stack=self,
name="namespace-0001",
).master_data(
mold_models=[
formation.MoldModel(
name='party',
initial_max_capacity=10,
max_capacity=20,
form_model=formation.FormModel(
name='party',
slots=[
formation.SlotModel(
name='tank',
property_regex='grn:.*',
options=formation.SlotModelOptions(
metadata='TANK',
),
),
formation.SlotModel(
name='healer',
property_regex='grn:.*',
options=formation.SlotModelOptions(
metadata='HEALER',
),
),
formation.SlotModel(
name='dps_1',
property_regex='grn:.*',
options=formation.SlotModelOptions(
metadata='DPS',
),
),
formation.SlotModel(
name='dps_2',
property_regex='grn:.*',
options=formation.SlotModelOptions(
metadata='DPS',
),
),
],
options=formation.FormModelOptions(
metadata='PARTY',
),
),
options=formation.MoldModelOptions(
metadata = 'PARTY'
),
),
formation.MoldModel(
name='equipment',
initial_max_capacity=20,
max_capacity=30,
form_model=formation.FormModel(
name='equipment',
slots=[
formation.SlotModel(
name='head',
property_regex='grn:.*',
options=formation.SlotModelOptions(
metadata='HEAD',
),
),
formation.SlotModel(
name='body',
property_regex='grn:.*',
options=formation.SlotModelOptions(
metadata='BODY',
),
),
formation.SlotModel(
name='leg',
property_regex='grn:.*',
options=formation.SlotModelOptions(
metadata='LEG',
),
),
],
options=formation.FormModelOptions(
metadata='EQUIPMENT',
),
),
options=formation.MoldModelOptions(
metadata = 'EQUIPMENT'
),
),
],
property_form_models=[
],
)
print(SampleStack().yaml()) # Generate Template
Slot
スロット
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | スロットモデル名 | |
propertyId | string | ~ 1024文字 | プロパティID | ||
metadata | string | ~ 1024文字 | メタデータ |
SlotModel
スロットモデル
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | スロットモデル名 | |
propertyRegex | string | ✓ | “.*” | ~ 512文字 | プロパティとして設定可能な値の正規表現 |
metadata | string | ~ 512文字 | メタデータ |
SlotWithSignature
署名付きスロット
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128文字 | スロットモデル名 | |
propertyType | enum { “gs2_inventory”, “gs2_simple_inventory”, “gs2_dictionary” } | ✓ | ~ 128文字 | プロパティの種類 | |
body | string | ~ 1048576文字 | ペイロード | ||
signature | string | ~ 1024文字 | プロパティIDのリソースを所有していることを証明する署名 | ||
metadata | string | ~ 1024文字 | メタデータ |
propertyType に指定する列挙型の定義
定義 | 説明 |
---|---|
gs2_inventory | GS2-Inventory::ItemSet |
gs2_simple_inventory | GS2-Inventory::SimpleItem |
gs2_dictionary | GS2-Dictionary::Entry |
AcquireAction
入手アクション
Config
コンフィグ設定
トランザクションの変数に適用する設定値
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
key | string | ✓ | ~ 64文字 | 名前 | |
value | string | ~ 51200文字 | 値 |
VerifyActionResult
検証アクションの実行結果
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128文字 | 検証アクションで実行するアクションの種類 | |
verifyRequest | string | ✓ | ~ 1048576文字 | リクエストのJSON | |
statusCode | int | ~ 999 | ステータスコード | ||
verifyResult | string | ~ 1048576文字 | 結果内容 |
action に指定する列挙型の定義
定義 | 説明 |
---|
ConsumeActionResult
消費アクションの実行結果
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128文字 | 消費アクションで実行するアクションの種類 | |
consumeRequest | string | ✓ | ~ 1048576文字 | リクエストのJSON | |
statusCode | int | ~ 999 | ステータスコード | ||
consumeResult | string | ~ 1048576文字 | 結果内容 |
action に指定する列挙型の定義
定義 | 説明 |
---|
AcquireActionResult
入手アクションの実行結果
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128文字 | 入手アクションで実行するアクションの種類 | |
acquireRequest | string | ✓ | ~ 1048576文字 | リクエストのJSON | |
statusCode | int | ~ 999 | ステータスコード | ||
acquireResult | string | ~ 1048576文字 | 結果内容 |
action に指定する列挙型の定義
定義 | 説明 |
---|
TransactionResult
トランザクション実行結果
サーバーサイドでのトランザクションの自動実行機能を利用して実行されたトランザクションの実行結果
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
transactionId | string | ✓ | 36 ~ 36文字 | トランザクションID | |
verifyResults | List<VerifyActionResult> | ~ 10 items | 検証アクションの実行結果リスト | ||
consumeResults | List<ConsumeActionResult> | [] | ~ 10 items | 消費アクションの実行結果リスト | |
acquireResults | List<AcquireActionResult> | [] | ~ 100 items | 入手アクションの実行結果リスト |
GitHubCheckoutSetting
GitHubからマスターデータをチェックアウトする設定
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
apiKeyId | string | ✓ | ~ 1024文字 | GitHub のAPIキーGRN | |
repositoryName | string | ✓ | ~ 1024文字 | リポジトリ名 | |
sourcePath | string | ✓ | ~ 1024文字 | ソースコードのファイルパス | |
referenceType | enum { “commit_hash”, “branch”, “tag” } | ✓ | ~ 128文字 | コードの取得元 | |
commitHash | string | {referenceType} == “commit_hash” | ~ 1024文字 | コミットハッシュ | |
branchName | string | {referenceType} == “branch” | ~ 1024文字 | ブランチ名 | |
tagName | string | {referenceType} == “tag” | ~ 1024文字 | タグ名 |
referenceType に指定する列挙型の定義
定義 | 説明 |
---|---|
commit_hash | コミットハッシュ |
branch | ブランチ |
tag | タグ |
ScriptSetting
スクリプト設定
GS2 ではマイクロサービスのイベントに関連づけて、カスタムスクリプトを実行することができます。
このモデルは、スクリプトの実行をトリガーするための設定を保持します。
スクリプトの実行方式は大きく2種類あり、それは「同期実行」と「非同期実行」です。
同期実行は、スクリプトの実行が完了するまで処理がブロックされます。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることができます。
一方、非同期実行は、スクリプトの実行が完了するまで処理がブロックされません。
かわりに、スクリプトの実行結果を使ってAPIの実行を止めたり、APIの結果を改ざんすることはできません。
しかし、非同期実行は、スクリプトの実行が完了するまで処理がブロックされないため、APIの応答に影響を与えないため、原則非同期実行を使用することをおすすめします。
非同期実行には実行方式が2種類あり、GS2-Script と Amazon EventBridge があります。
Amazon EventBridge を使用することで、Lua 以外の言語で処理を記述することができます。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
triggerScriptId | string | ~ 1024文字 | スクリプトGRN | ||
doneTriggerTargetType | enum { “none”, “gs2_script”, “aws” } | ✓ | “none” | ~ 128文字 | 完了通知の通知先 |
doneTriggerScriptId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | スクリプトGRN | |
doneTriggerQueueNamespaceId | string | {doneTriggerTargetType} == “gs2_script” | ~ 1024文字 | ネームスペースGRN |
doneTriggerTargetType に指定する列挙型の定義
定義 | 説明 |
---|---|
none | なし |
gs2_script | GS2-Script |
aws | Amazon EventBridge |
LogSetting
ログの書き出し設定
ログデータの書き出し設定を管理します。この型は、ログデータを書き出すために使用されるログ名前空間の識別子(Namespace ID)を保持します。
ログ名前空間IDは、ログデータを集約し、保存する対象の GS2-Log の名前空間を指定します。
この設定を通じて、この名前空間以下のAPIリクエスト・レスポンスログデータが対象の GS2-Log へ出力されるようになります。
GS2-Log にはリアルタイムでログが提供され、システムの監視や分析、デバッグなどに利用できます。
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024文字 | ネームスペースGRN |
TransactionSetting
トランザクション設定
型 | 必須 | デフォルト | 値の制限 | 説明 | |
---|---|---|---|---|---|
enableAutoRun | bool | ✓ | false | 発行したトランザクションをサーバーサイドで自動的に実行するか | |
enableAtomicCommit | bool | {enableAutoRun} == true | false | トランザクションの実行をアトミックにコミットするか | |
transactionUseDistributor | bool | {enableAtomicCommit} == true | false | トランザクションを非同期処理で実行する | |
acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | false | 入手アクションを実行する際に GS2-JobQueue を使用するか | |
distributorNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-Distributor ネームスペース |
queueNamespaceId | string | ✓ | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024文字 | トランザクションの実行に使用する GS2-JobQueue のネームスペース |