GS2-Deploy/CDK Reference of GS2-Distributor

Entities

Namespace

Namespace

Namespace is a mechanism that allows multiple uses of the same service for different purposes within a single project. Basically, GS2 services have a layer called namespace, and different namespaces are treated as completely different data spaces, even for the same service.

Therefore, it is necessary to create a namespace before starting to use each service.

TypeRequireDefaultLimitationDescription
namestring~ 32 charsNamespace name
descriptionstring~ 1024 charsdescription of Namespace
assumeUserIdstring~ 1024 charsUser GRN
autoRunStampSheetNotificationNotificationSettingPush notification when stamp sheet auto-execution is complete
logSettingLogSettingLog output settings

GetAttr

TypeDescription
ItemNamespaceNamespace created

Implementation Example

Type: GS2::Distributor::Namespace
Properties:
  Name: namespace1
  Description: null
  AssumeUserId: grn:gs2::YourOwnerId:identifier:user:user-0001
  AutoRunStampSheetNotification: null
  LogSetting: 
    LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace1
from gs2_cdk import Stack, core, distributor

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        distributor.Namespace(
            stack=self,
            name="namespace-0001",
            options=distributor.NamespaceOptions(
                assume_user_id='grn:gs2::YourOwnerId:identifier:user:user-0001',
                log_setting=core.LogSetting(
                    logging_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001',
                ),
            ),
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        new \Gs2Cdk\Distributor\Model\Namespace_(
            stack: $this,
            name: "namespace-0001",
            options: new \Gs2Cdk\Distributor\Model\Options\NamespaceOptions(
                assumeUserId: "grn:gs2::YourOwnerId:identifier:user:user-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.distributor.model.Namespace(
            this,
            "namespace-0001",
            new io.gs2.cdk.distributor.model.options.NamespaceOptions() {
                {
                    assumeUserId = "grn:gs2::YourOwnerId:identifier:user:user-0001";
                    logSetting = new io.gs2.cdk.core.model.LogSetting(
                        "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
                    );
                }
            }
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
import core from "@/gs2cdk/core";
import distributor from "@/gs2cdk/distributor";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new distributor.model.Namespace(
            this,
            "namespace-0001",
            {
                assumeUserId: "grn:gs2::YourOwnerId:identifier:user:user-0001",
                logSetting: new core.LogSetting(
                    "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
                )
            }
        );
    }
}

console.log(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Distributor.Model.Namespace(
            this,
            "namespace-0001",
            new Gs2Cdk.Gs2Distributor.Model.Options.NamespaceOptions {
                assumeUserId = "grn:gs2::YourOwnerId:identifier:user:user-0001",
                logSetting = new Gs2Cdk.Core.Model.LogSetting(
                    "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
                ),
            }
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template

CurrentDistributorMaster

Currently available master data

GS2 uses JSON format files for master data management. By uploading the file, you can actually reflect the settings on the server.

We provide a master data editor on the management console as a way to create JSON files, but we also provide a master data editor on the management console as a way to create JSON files. The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.

Please refer to the documentation for the format of the JSON file.

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 32 charsNamespace name
settingsstring~ 5242880 charsMaster data

GetAttr

TypeDescription
ItemCurrentDistributorMasterUpdated and currently available delivery settings

Implementation Example

Type: GS2::Distributor::CurrentDistributorMaster
Properties:
  NamespaceName: namespace1
  Settings: {
    "version": "2019-03-01",
    "distributorModels": [
      {
        "name": "basic",
        "metadata": "BASIC",
        "inboxNamespaceId": "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001"
      },
      {
        "name": "special",
        "metadata": "SPECIAL",
        "inboxNamespaceId": "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001",
        "whiteListTargetIds": [
          "test"
        ]
      }
    ]
  }
from gs2_cdk import Stack, core, distributor

class SampleStack(Stack):

    def __init__(self):
        super().__init__()
        distributor.Namespace(
            stack=self,
            # omission
        ).master_data(
            [
                distributor.DistributorModel(
                    name='basic',
                    options=distributor.DistributorModelOptions(
                        metadata='BASIC',
                        inbox_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001',
                    ),
                ),
                distributor.DistributorModel(
                    name='special',
                    options=distributor.DistributorModelOptions(
                        metadata='SPECIAL',
                        inbox_namespace_id='grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001',
                        white_list_target_ids=[    'test',
                            ],
                    ),
                ),
            ],
        )

print(SampleStack().yaml())  # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
    function __construct() {
        parent::__construct();
        (new \Gs2Cdk\Distributor\Model\Namespace_(
            stack: $this,
            // omission
        ))->masterData(
            [
                new \Gs2Cdk\Distributor\Model\DistributorModel(
                    name:"basic",
                    options: new \Gs2Cdk\Distributor\Model\Options\DistributorModelOptions(
                        metadata:"BASIC",
                        inboxNamespaceId:"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001",
                    ),
                ),
                new \Gs2Cdk\Distributor\Model\DistributorModel(
                    name:"special",
                    options: new \Gs2Cdk\Distributor\Model\Options\DistributorModelOptions(
                        metadata:"SPECIAL",
                        inboxNamespaceId:"grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001",
                        whiteListTargetIds:[    "test",
                        ],
                    ),
                ),
            ],
        );
    }
}

print((new SampleStack())->yaml());  // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
    public SampleStack() {
        super();
        new io.gs2.cdk.distributor.model.Namespace(
            this,
            // omission
        ).masterData(
            Arrays.asList(
                new io.gs2.cdk.distributor.model.DistributorModel(
                    "basic",
                    new io.gs2.cdk.distributor.model.options.DistributorModelOptions() {
                        {
                            metadata: "BASIC";
                            inboxNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001";
                        }
                    }
                ),
                new io.gs2.cdk.distributor.model.DistributorModel(
                    "special",
                    new io.gs2.cdk.distributor.model.options.DistributorModelOptions() {
                        {
                            metadata: "SPECIAL";
                            inboxNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001";
                            whiteListTargetIds: Arrays.asList(
                                "test"
                            );
                        }
                    }
                )
            )
        );
    }
}

System.out.println(new SampleStack().yaml());  // Generate Template
import core from "@/gs2cdk/core";
import distributor from "@/gs2cdk/distributor";

class SampleStack extends core.Stack
{
    public constructor() {
        super();
        new distributor.model.Namespace(
            this,
            // omission
        ).masterData(
            [
                new distributor.model.DistributorModel(
                    "basic",
                    {
                        metadata: "BASIC",
                        inboxNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001"
                    }
                ),
                new distributor.model.DistributorModel(
                    "special",
                    {
                        metadata: "SPECIAL",
                        inboxNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001",
                        whiteListTargetIds: [
                                "test"
                            ]
                    }
                )
            ]
        );
    }
}

console.log(new SampleStack().yaml());  // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
    public SampleStack() {
        new Gs2Cdk.Gs2Distributor.Model.Namespace(
            this,
            // omission
        ).MasterData(
            new [] {
                new Gs2Cdk.Gs2Distributor.Model.DistributorModel(
                    "basic",
                    new Gs2Cdk.Gs2Distributor.Model.Options.DistributorModelOptions {
                        metadata = "BASIC",
                        inboxNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001",
                    }
                ),
                new Gs2Cdk.Gs2Distributor.Model.DistributorModel(
                    "special",
                    new Gs2Cdk.Gs2Distributor.Model.Options.DistributorModelOptions {
                        metadata = "SPECIAL",
                        inboxNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:inbox:inbox-0001",
                        whiteListTargetIds = new string[] {
                            "test"
                        },
                    }
                )
            }
        );
    }
}

Debug.Log(new SampleStack().Yaml());  // Generate Template

AcquireAction

TypeRequireDefaultLimitationDescription
actionenum []~ 128 charsTypes of actions to be performed in the stamp sheet
requeststring~ 1048576 charsJSON of request

ConsumeAction

TypeRequireDefaultLimitationDescription
actionenum []~ 128 charsTypes of actions to be performed in the stamp task
requeststring~ 1048576 charsJSON of the obtain request

GitHubCheckoutSetting

TypeRequireDefaultLimitationDescription
apiKeyIdstring~ 1024 charsGitHub API key GRN
repositoryNamestring~ 1024 charsRepository Name
sourcePathstring~ 1024 charsSource code file path
referenceTypeenum [‘commit_hash’, ‘branch’, ’tag’]~ 128 charsSource of code
commitHashstring{referenceType} == “commit_hash”~ 1024 charsCommit hash
branchNamestring{referenceType} == “branch”~ 1024 charsBranch Name
tagNamestring{referenceType} == “tag”~ 1024 charsTag Name

DistributeResource

TypeRequireDefaultLimitationDescription
actionenum []~ 128 charsTypes of actions to be performed in the stamp sheet
requeststring~ 1048576 charsJSON of request

LogSetting

TypeRequireDefaultLimitationDescription
loggingNamespaceIdstring~ 1024 charsNamespace GRN

NotificationSetting

TypeRequireDefaultLimitationDescription
gatewayNamespaceIdstring~ 1024 charsNamespace GRN
enableTransferMobileNotificationbool?Forwarding to mobile push notification
soundstring~ 1024 charsSound file name to be used for mobile push notifications