GS2-Deploy/CDK Reference of GS2-Schedule
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.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Namespace name | |
description | string | ~ 1024 chars | Description | ||
logSetting | LogSetting | Log output settings |
GetAttr
Type | Description | |
---|---|---|
Item | Namespace | Namespace created |
Implementation Example
Type: GS2::Schedule::Namespace
Properties:
Name: namespace1
Description: null
LogSetting:
LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001
from gs2_cdk import Stack, core, schedule
class SampleStack(Stack):
def __init__(self):
super().__init__()
schedule.Namespace(
stack=self,
name="namespace-0001",
options=schedule.NamespaceOptions(
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\Schedule\Model\Namespace_(
stack: $this,
name: "namespace-0001",
options: new \Gs2Cdk\Schedule\Model\Options\NamespaceOptions(
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.schedule.model.Namespace(
this,
"namespace-0001",
new io.gs2.cdk.schedule.model.options.NamespaceOptions() {
{
logSetting = new io.gs2.cdk.core.model.LogSetting(
loggingNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
);
}
}
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Template
import core from "@/gs2cdk/core";
import schedule from "@/gs2cdk/schedule";
class SampleStack extends core.Stack
{
public constructor() {
super();
new schedule.model.Namespace(
this,
"namespace-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.Gs2Schedule.Model.Namespace(
this,
"namespace-0001",
new Gs2Cdk.Gs2Schedule.Model.Options.NamespaceOptions {
logSetting = new Gs2Cdk.Core.Model.LogSetting(
LoggingNamespaceId = "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
)
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Template
CurrentEventMaster
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 you can also create JSON files using the The service can also be used by creating a tool more appropriate for game management and exporting a JSON file in the appropriate format.
Note
Please refer to Master Data Reference of GS2-Schedule for the JSON file format.Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
settings | string | ✓ | ~ 5242880 chars | Master data |
GetAttr
Type | Description | |
---|---|---|
Item | CurrentEventMaster | Updated and currently available event schedule master |
Implementation Example
Type: GS2::Schedule::CurrentEventMaster
Properties:
NamespaceName: namespace1
Settings: {
"version": "2019-03-31",
"events": [
{
"name": "event-0001",
"scheduleType": "absolute",
"metadata": "EVENT_0001",
"absoluteBegin": 10000,
"absoluteEnd": 20000
},
{
"name": "event-0002",
"scheduleType": "relative",
"metadata": "EVENT_0002",
"relativeTriggerName": "trigger-0001"
},
{
"name": "daily-0001",
"scheduleType": "absolute",
"metadata": "EVENT_0003",
"absoluteBegin": 1569369600000,
"absoluteEnd": 1569456000000
},
{
"name": "daily-0002",
"scheduleType": "absolute",
"metadata": "EVENT_0004",
"absoluteBegin": 1569369600000,
"absoluteEnd": 1569456000000
},
{
"name": "weekly-0001",
"scheduleType": "absolute",
"metadata": "EVENT_0005",
"absoluteBegin": 1569888000000,
"absoluteEnd": 1570406400000
},
{
"name": "weekly-0002",
"scheduleType": "absolute",
"metadata": "EVENT_0006",
"absoluteBegin": 1569888000000,
"absoluteEnd": 1570406400000
},
{
"name": "monthly-0001",
"scheduleType": "absolute",
"metadata": "EVENT_0007",
"absoluteBegin": 1570406400000,
"absoluteEnd": 1575158400000
},
{
"name": "monthly-0002",
"scheduleType": "absolute",
"metadata": "EVENT_0008",
"absoluteBegin": 1570406400000,
"absoluteEnd": 1575158400000
}
]
}
from gs2_cdk import Stack, core, schedule
class SampleStack(Stack):
def __init__(self):
super().__init__()
schedule.Namespace(
stack=self,
# omission
).master_data(
events=[
schedule.Event(
name='event-0001',
schedule_type='absolute',
options=schedule.EventOptions(
metadata='EVENT_0001',
absolute_begin=10000,
absolute_end=20000,
),
),
schedule.Event(
name='event-0002',
schedule_type='relative',
options=schedule.EventOptions(
metadata='EVENT_0002',
relative_trigger_name='trigger-0001',
),
),
schedule.Event(
name='daily-0001',
schedule_type='absolute',
options=schedule.EventOptions(
metadata='EVENT_0003',
absolute_begin=1569369600000,
absolute_end=1569456000000,
),
),
schedule.Event(
name='daily-0002',
schedule_type='absolute',
options=schedule.EventOptions(
metadata='EVENT_0004',
absolute_begin=1569369600000,
absolute_end=1569456000000,
),
),
schedule.Event(
name='weekly-0001',
schedule_type='absolute',
options=schedule.EventOptions(
metadata='EVENT_0005',
absolute_begin=1569888000000,
absolute_end=1570406400000,
),
),
schedule.Event(
name='weekly-0002',
schedule_type='absolute',
options=schedule.EventOptions(
metadata='EVENT_0006',
absolute_begin=1569888000000,
absolute_end=1570406400000,
),
),
schedule.Event(
name='monthly-0001',
schedule_type='absolute',
options=schedule.EventOptions(
metadata='EVENT_0007',
absolute_begin=1570406400000,
absolute_end=1575158400000,
),
),
schedule.Event(
name='monthly-0002',
schedule_type='absolute',
options=schedule.EventOptions(
metadata='EVENT_0008',
absolute_begin=1570406400000,
absolute_end=1575158400000,
),
),
],
)
print(SampleStack().yaml()) # Generate Template
class SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
(new \Gs2Cdk\Schedule\Model\Namespace_(
stack: $this,
// omission
))->masterData(
[
new \Gs2Cdk\Schedule\Model\Event(
name:"event-0001",
scheduleType: \Gs2Cdk\Schedule\Model\Enums\EventScheduleType::ABSOLUTE,
options: new \Gs2Cdk\Schedule\Model\Options\EventOptions(
metadata:"EVENT_0001",
absoluteBegin:10000,
absoluteEnd:20000
)
),
new \Gs2Cdk\Schedule\Model\Event(
name:"event-0002",
scheduleType: \Gs2Cdk\Schedule\Model\Enums\EventScheduleType::RELATIVE,
options: new \Gs2Cdk\Schedule\Model\Options\EventOptions(
metadata:"EVENT_0002",
relativeTriggerName:"trigger-0001"
)
),
new \Gs2Cdk\Schedule\Model\Event(
name:"daily-0001",
scheduleType: \Gs2Cdk\Schedule\Model\Enums\EventScheduleType::ABSOLUTE,
options: new \Gs2Cdk\Schedule\Model\Options\EventOptions(
metadata:"EVENT_0003",
absoluteBegin:1569369600000,
absoluteEnd:1569456000000
)
),
new \Gs2Cdk\Schedule\Model\Event(
name:"daily-0002",
scheduleType: \Gs2Cdk\Schedule\Model\Enums\EventScheduleType::ABSOLUTE,
options: new \Gs2Cdk\Schedule\Model\Options\EventOptions(
metadata:"EVENT_0004",
absoluteBegin:1569369600000,
absoluteEnd:1569456000000
)
),
new \Gs2Cdk\Schedule\Model\Event(
name:"weekly-0001",
scheduleType: \Gs2Cdk\Schedule\Model\Enums\EventScheduleType::ABSOLUTE,
options: new \Gs2Cdk\Schedule\Model\Options\EventOptions(
metadata:"EVENT_0005",
absoluteBegin:1569888000000,
absoluteEnd:1570406400000
)
),
new \Gs2Cdk\Schedule\Model\Event(
name:"weekly-0002",
scheduleType: \Gs2Cdk\Schedule\Model\Enums\EventScheduleType::ABSOLUTE,
options: new \Gs2Cdk\Schedule\Model\Options\EventOptions(
metadata:"EVENT_0006",
absoluteBegin:1569888000000,
absoluteEnd:1570406400000
)
),
new \Gs2Cdk\Schedule\Model\Event(
name:"monthly-0001",
scheduleType: \Gs2Cdk\Schedule\Model\Enums\EventScheduleType::ABSOLUTE,
options: new \Gs2Cdk\Schedule\Model\Options\EventOptions(
metadata:"EVENT_0007",
absoluteBegin:1570406400000,
absoluteEnd:1575158400000
)
),
new \Gs2Cdk\Schedule\Model\Event(
name:"monthly-0002",
scheduleType: \Gs2Cdk\Schedule\Model\Enums\EventScheduleType::ABSOLUTE,
options: new \Gs2Cdk\Schedule\Model\Options\EventOptions(
metadata:"EVENT_0008",
absoluteBegin:1570406400000,
absoluteEnd:1575158400000
)
)
]
);
}
}
print((new SampleStack())->yaml()); // Generate Template
class SampleStack extends io.gs2.cdk.core.model.Stack
{
public SampleStack() {
super();
new io.gs2.cdk.schedule.model.Namespace(
this,
// omission
).masterData(
Arrays.asList(
new io.gs2.cdk.schedule.model.Event(
"event-0001",
Absolute,
new io.gs2.cdk.schedule.model.options.EventOptions() {
{
metadata: "EVENT_0001";
absoluteBegin: 10000L;
absoluteEnd: 20000L;
}
}
),
new io.gs2.cdk.schedule.model.Event(
"event-0002",
Relative,
new io.gs2.cdk.schedule.model.options.EventOptions() {
{
metadata: "EVENT_0002";
relativeTriggerName: "trigger-0001";
}
}
),
new io.gs2.cdk.schedule.model.Event(
"daily-0001",
Absolute,
new io.gs2.cdk.schedule.model.options.EventOptions() {
{
metadata: "EVENT_0003";
absoluteBegin: 1569369600000L;
absoluteEnd: 1569456000000L;
}
}
),
new io.gs2.cdk.schedule.model.Event(
"daily-0002",
Absolute,
new io.gs2.cdk.schedule.model.options.EventOptions() {
{
metadata: "EVENT_0004";
absoluteBegin: 1569369600000L;
absoluteEnd: 1569456000000L;
}
}
),
new io.gs2.cdk.schedule.model.Event(
"weekly-0001",
Absolute,
new io.gs2.cdk.schedule.model.options.EventOptions() {
{
metadata: "EVENT_0005";
absoluteBegin: 1569888000000L;
absoluteEnd: 1570406400000L;
}
}
),
new io.gs2.cdk.schedule.model.Event(
"weekly-0002",
Absolute,
new io.gs2.cdk.schedule.model.options.EventOptions() {
{
metadata: "EVENT_0006";
absoluteBegin: 1569888000000L;
absoluteEnd: 1570406400000L;
}
}
),
new io.gs2.cdk.schedule.model.Event(
"monthly-0001",
Absolute,
new io.gs2.cdk.schedule.model.options.EventOptions() {
{
metadata: "EVENT_0007";
absoluteBegin: 1570406400000L;
absoluteEnd: 1575158400000L;
}
}
),
new io.gs2.cdk.schedule.model.Event(
"monthly-0002",
Absolute,
new io.gs2.cdk.schedule.model.options.EventOptions() {
{
metadata: "EVENT_0008";
absoluteBegin: 1570406400000L;
absoluteEnd: 1575158400000L;
}
}
)
)
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Template
import core from "@/gs2cdk/core";
import schedule from "@/gs2cdk/schedule";
class SampleStack extends core.Stack
{
public constructor() {
super();
new schedule.model.Namespace(
this,
// omission
).masterData(
[
new schedule.model.Event(
"event-0001",
schedule.model.EventScheduleType.ABSOLUTE,
{
metadata: "EVENT_0001",
absoluteBegin: 10000,
absoluteEnd: 20000
}
),
new schedule.model.Event(
"event-0002",
schedule.model.EventScheduleType.RELATIVE,
{
metadata: "EVENT_0002",
relativeTriggerName: "trigger-0001"
}
),
new schedule.model.Event(
"daily-0001",
schedule.model.EventScheduleType.ABSOLUTE,
{
metadata: "EVENT_0003",
absoluteBegin: 1569369600000,
absoluteEnd: 1569456000000
}
),
new schedule.model.Event(
"daily-0002",
schedule.model.EventScheduleType.ABSOLUTE,
{
metadata: "EVENT_0004",
absoluteBegin: 1569369600000,
absoluteEnd: 1569456000000
}
),
new schedule.model.Event(
"weekly-0001",
schedule.model.EventScheduleType.ABSOLUTE,
{
metadata: "EVENT_0005",
absoluteBegin: 1569888000000,
absoluteEnd: 1570406400000
}
),
new schedule.model.Event(
"weekly-0002",
schedule.model.EventScheduleType.ABSOLUTE,
{
metadata: "EVENT_0006",
absoluteBegin: 1569888000000,
absoluteEnd: 1570406400000
}
),
new schedule.model.Event(
"monthly-0001",
schedule.model.EventScheduleType.ABSOLUTE,
{
metadata: "EVENT_0007",
absoluteBegin: 1570406400000,
absoluteEnd: 1575158400000
}
),
new schedule.model.Event(
"monthly-0002",
schedule.model.EventScheduleType.ABSOLUTE,
{
metadata: "EVENT_0008",
absoluteBegin: 1570406400000,
absoluteEnd: 1575158400000
}
)
]
);
}
}
console.log(new SampleStack().yaml()); // Generate Template
public class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Schedule.Model.Namespace(
this,
// omission
).MasterData(
new [] {
new Gs2Cdk.Gs2Schedule.Model.Event(
"event-0001",
Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions {
metadata = "EVENT_0001",
absoluteBegin = 10000L,
absoluteEnd = 20000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
"event-0002",
Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Relative,
new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions {
metadata = "EVENT_0002",
relativeTriggerName = "trigger-0001"
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
"daily-0001",
Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions {
metadata = "EVENT_0003",
absoluteBegin = 1569369600000L,
absoluteEnd = 1569456000000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
"daily-0002",
Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions {
metadata = "EVENT_0004",
absoluteBegin = 1569369600000L,
absoluteEnd = 1569456000000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
"weekly-0001",
Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions {
metadata = "EVENT_0005",
absoluteBegin = 1569888000000L,
absoluteEnd = 1570406400000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
"weekly-0002",
Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions {
metadata = "EVENT_0006",
absoluteBegin = 1569888000000L,
absoluteEnd = 1570406400000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
"monthly-0001",
Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions {
metadata = "EVENT_0007",
absoluteBegin = 1570406400000L,
absoluteEnd = 1575158400000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
"monthly-0002",
Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions {
metadata = "EVENT_0008",
absoluteBegin = 1570406400000L,
absoluteEnd = 1575158400000L
}
)
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Template
RepeatSetting
Repeat Setting
There are two types of event durations: absolute and relative.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
repeatType | enum { “always”, “daily”, “weekly”, “monthly”, “custom” } | ✓ | “always” | ~ 128 chars | Type of repetition |
beginDayOfMonth | int | {repeatType} == “monthly” | 1 ~ 31 | Event repeat start date (If the value exceeds the days of the month, it is treated as the last day.) | |
endDayOfMonth | int | {repeatType} == “monthly” | 1 ~ 31 | Event repeat end date (If the value exceeds the days of the month, it is treated as the last day.) | |
beginDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ~ 128 chars | Repeat start day of event | |
endDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ~ 128 chars | Repeat event end day of the week | |
beginHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ~ 23 | Event repetition start time (in hours) | |
endHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ~ 24 | Event repetition end time (in hours) | |
anchorTimestamp | long | {repeatType} == “custom” | Anchor date to start the cycle (Unix time unit:milliseconds) | ||
activeDays | int | {repeatType} == “custom” | 1 ~ 2147483646.0 | Number of active days in the cycle | |
inactiveDays | int | {repeatType} == “custom” | 1 ~ 2147483646.0 | Number of inactive days in the cycle |
Enumeration type definition to specify as repeatType
Enumerator String Definition | Description |
---|---|
always | Event period Always |
daily | Every day during the event period from X:00 to X:00 |
weekly | Every X days of the week from X:00 to X:00 during the event period |
monthly | Xth day of each month during the event period from X:00 to X:00 |
custom | Starting from the reference date, active for X days and inactive for Y days during the event period |
Enumeration type definition to specify as beginDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thuesday |
friday | Friday |
saturday | Saturday |
Enumeration type definition to specify as endDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thuesday |
friday | Friday |
saturday | Saturday |
RepeatSchedule
State of repeating schedule
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
repeatCount | int | ✓ | ~ 2147483646 | Number of times to repeat | |
currentRepeatStartAt | long | Start date and time of repeating event (Unix time unit:milliseconds) | |||
currentRepeatEndAt | long | End date and time of repeating event (Unix time unit:milliseconds) | |||
lastRepeatEndAt | long | End date and time of last event (Unix time unit:milliseconds) | |||
nextRepeatStartAt | long | Start date and time of next event (Unix time unit:milliseconds) |
GitHubCheckoutSetting
Setup to check out master data from GitHub
Type | 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 |
LogSetting
Log setting
This type manages log output settings. This type holds the identifier of the log namespace used to output log data. The log namespace ID specifies the GS2-Log namespace to aggregate and store the log data. Through this setting, API request and response log data under this namespace will be output to the target GS2-Log. GS2-Log provides logs in real time, which can be used for system monitoring, analysis, debugging, etc.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
loggingNamespaceId | string | ✓ | ~ 1024 chars | Namespace GRN |