GS2-Schedule Deploy/CDK Reference
Entities
Resources managed by the Deploy operation
Namespace
Namespace
A Namespace allows multiple independent instances of the same service within a single project by separating data spaces and usage contexts. Each GS2 service is managed on a per-namespace basis. Even when using the same service, if the Namespace differs, the data is treated as a completely independent data space.
Therefore, you must create a Namespace before you can start using each service.
Request
Resource creation and update requests
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Namespace name Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| description | string | ~ 1024 chars | Description | |||
| transactionSettingV2 | TransactionSettingV2 | Transaction Setting (V2) Decides how the transactions this Namespace issues are executed. There are only two things to set: the GS2-Distributor Namespace that executes them, and whether the actions in a transaction run one at a time – so that a later action can build on what an earlier one wrote – or all at once for a shorter response time. Set this on a new Namespace. transactionSetting, the obsolete setting it replaces, is used only while this is unset. | ||||
| logSetting | LogSetting | Log Setting Configuration for outputting schedule-related operation logs to GS2-Log. When configured, actions such as event queries, trigger activation, and trigger deletion are recorded for analysis and auditing. |
GetAttr
Resource creation results that can be retrieved using the !GetAttr tag
| Type | Description | |
|---|---|---|
| Item | Namespace | Namespace created |
Implementation Example
Type: GS2::Schedule::Namespace
Properties:
Name: namespace-0001
Description: null
TransactionSettingV2: null
LogSetting:
LoggingNamespaceId: grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001import (
"github.com/gs2io/gs2-golang-cdk/core"
"github.com/gs2io/gs2-golang-cdk/schedule"
)
SampleStack := core.NewStack()
schedule.NewNamespace(
&SampleStack,
"namespace-0001",
schedule.NamespaceOptions{
LogSetting: &core.LogSetting{
LoggingNamespaceId: "grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001",
},
},
)
println(SampleStack.Yaml()) // Generate Templateclass 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()
.withLogSetting(new io.gs2.cdk.core.model.LogSetting(
"grn:gs2:ap-northeast-1:YourOwnerId:log:namespace-0001"
))
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Templatepublic class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Schedule.Model.Namespace(
stack: this,
name: "namespace-0001",
options: 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 Templateimport 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
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 TemplateTransactionSettingV2
Transaction Setting (V2)
Transaction Setting (V2) decides how the transactions issued by a Namespace are executed.
There are only two things to set:
distributorNamespaceId: the GS2-Distributor Namespace used to execute the transactionenableParallelExecution: whether the actions in a transaction run one at a time or all at once
Whichever you choose, the transaction is executed by the server the moment it is issued, and it succeeds or fails as a whole: when an action fails, the actions that already ran are undone with it and nothing is left applied. Everything else about how a transaction runs is fixed to the recommended configuration, so there is nothing else to set.
Running the actions one at a time (the default, enableParallelExecution is false) lets each action work on top of what the actions before it wrote. The actions run in verify, consume, acquire order, and this is what lets you:
- update the same row from more than one action in a single transaction, which fails when they run all at once
- read what an earlier action wrote, including from List and Query and from inside a nested transaction
- use
%{Gs2Xxx:ActionName.path[0].field}to feed the result of an earlier verify or consume action into the parameters of a later verify, consume or acquire action
In exchange, the response time is the sum of the time taken by each action, and a transaction may contain at most 20 actions. The order within each phase is decided by the action name and then by the target resource, so you cannot choose the execution order by rearranging the actions in the request, and execution stops at the first action that fails.
Running the actions all at once (enableParallelExecution is true) executes them in parallel against a single snapshot of the data, so the response time is that of the slowest single action and there is no limit on the number of actions.
In exchange, an action cannot see what the other actions wrote, and two actions that write the same row fail the transaction with database:transaction:same.resource (400), so choose this only when you can guarantee that no two actions in the same transaction write the same data. %{...} may reference only the results of an earlier phase (verify, then consume, then acquire); a reference to an action in the same phase is left unresolved, and a phase that contains %{...} waits for the earlier phases to complete, which lengthens the response time by that amount.
Transaction Setting is the obsolete setting that Transaction Setting (V2) replaces, kept for Namespaces created before Transaction Setting (V2) existed. It applies only while Transaction Setting (V2) is unset, and setting Transaction Setting (V2) supersedes it. Three behaviours it allowed are deliberately not offered here: executing a transaction as a client-run stamp sheet, running AutoRun asynchronously via GS2-Distributor, and folding acquire actions into GS2-JobQueue.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| distributorNamespaceId | string | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024 chars | GS2-Distributor Namespace GRN used to execute transactions | ||
| enableParallelExecution | bool | false | Whether to execute the actions in parallel instead of sequentially |
LogSetting
Log Output Setting
Log Output Setting defines how log data is exported. This type holds the GS2-Log Namespace identifier (Namespace ID), which is used to export log data. Specify the GS2-Log Namespace where log data is collected and stored in the GRN format for the Log Namespace ID (loggingNamespaceId). Configuring this setting ensures that log data for API requests and responses occurring within the specified Namespace is output to the target GS2-Log Namespace. GS2-Log provides real-time logs that can be used for system monitoring, analysis, debugging, and other operational purposes.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| loggingNamespaceId | string | ✓ | ~ 1024 chars | GS2-Log Namespace GRN
to output logs Must be specified in GRN format starting with “grn:gs2:”. |
TransactionSetting
Transaction Setting
Transaction Setting is obsolete: Transaction Setting (V2) replaces it. It is kept for Namespaces created before Transaction Setting (V2) existed, applies only while Transaction Setting (V2) is unset, and should not be chosen for a new Namespace.
It exposes each part of transaction execution as a separate field – AutoRun, AtomicCommit, asynchronous execution using GS2-Distributor, batch application of script results, asynchronous processing of acquire actions via GS2-JobQueue, and sequential execution – so combinations other than the recommended one can be built. Transaction Setting (V2) is that recommended combination expressed as a single setting. Keep using Transaction Setting only on a Namespace that already depends on a behaviour Transaction Setting (V2) does not offer: executing a transaction as a client-run stamp sheet, running AutoRun asynchronously via GS2-Distributor, or folding acquire actions into GS2-JobQueue.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| enableAutoRun | bool | false | Whether to automatically execute issued transactions on the server side | |||
| enableAtomicCommit | bool | {enableAutoRun} == true | false | Whether to commit transactions atomically * Enabled only if enableAutoRun is true | ||
| transactionUseDistributor | bool | {enableAtomicCommit} == true | false | Whether to execute transactions asynchronously * Enabled only if enableAtomicCommit is true | ||
| commitScriptResultInUseDistributor | bool | {transactionUseDistributor} == true | false | Whether to execute the commit processing of the script result asynchronously * Enabled only if transactionUseDistributor is true | ||
| acquireActionUseJobQueue | bool | {enableAtomicCommit} == true | false | Whether to use GS2-JobQueue to execute the acquire action * Enabled only if enableAtomicCommit is true | ||
| enableSequentialExecution | bool | {enableAtomicCommit} == true | false | Whether to execute the actions of an atomic commit sequentially so that multiple actions may update the same row * Enabled only if enableAtomicCommit is true | ||
| distributorNamespaceId | string | “grn:gs2:{region}:{ownerId}:distributor:default” | ~ 1024 chars | GS2-Distributor Namespace GRN used to execute transactions | ||
| queueNamespaceId | string | “grn:gs2:{region}:{ownerId}:queue:default” | ~ 1024 chars | GS2-JobQueue Namespace GRN used to execute transactions |
CurrentEventMaster
Currently active Event master data
This master data defines the Events currently active within the Namespace. GS2 uses JSON format files for managing master data. By uploading these files, you can apply the master data to the server.
To create JSON files, GS2 provides a master data editor within the management console. Additionally, you can create tools better suited for game operations and export JSON files in the appropriate format.
Please refer to GS2-Schedule Master Data Reference for the JSON file format.
Request
Resource creation and update requests
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Unique Namespace name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| mode | string (enum) enum { “direct”, “preUpload” } | “direct” | Update mode
| |||||||||
| settings | string | {mode} == “direct” | ✓* | ~ 5242880 bytes (5MB) | Master Data * Required if mode is “direct” | |||||||
| uploadToken | string | {mode} == “preUpload” | ✓* | ~ 1024 chars | Token obtained by pre-upload Used to apply the uploaded master data. * Required if mode is “preUpload” |
GetAttr
Resource creation results that can be retrieved using the !GetAttr tag
| Type | Description | |
|---|---|---|
| Item | CurrentEventMaster | Updated master data of the currently active Event |
Implementation Example
Type: GS2::Schedule::CurrentEventMaster
Properties:
NamespaceName: namespace-0001
Mode: null
Settings: {
"version": "2019-03-31",
"events": [
{
"name": "event-0001",
"scheduleType": "absolute",
"repeatSetting":
{
"repeatType": "always",
"beginDayOfMonth": 1,
"endDayOfMonth": 1,
"beginHour": 0,
"endHour": 0,
"activeDays": 1,
"inactiveDays": 0
},
"metadata": "EVENT_0001",
"absoluteBegin": 10000,
"absoluteEnd": 20000
},
{
"name": "event-0002",
"scheduleType": "relative",
"repeatSetting":
{
"repeatType": "always",
"beginDayOfMonth": 1,
"endDayOfMonth": 1,
"beginHour": 0,
"endHour": 0,
"activeDays": 1,
"inactiveDays": 0
},
"metadata": "EVENT_0002",
"relativeTriggerName": "trigger-0001"
},
{
"name": "daily-0001",
"scheduleType": "absolute",
"repeatSetting":
{
"repeatType": "always",
"beginDayOfMonth": 1,
"endDayOfMonth": 1,
"beginHour": 0,
"endHour": 0,
"activeDays": 1,
"inactiveDays": 0
},
"metadata": "EVENT_0003",
"absoluteBegin": 1569369600000,
"absoluteEnd": 1569456000000
},
{
"name": "daily-0002",
"scheduleType": "absolute",
"repeatSetting":
{
"repeatType": "always",
"beginDayOfMonth": 1,
"endDayOfMonth": 1,
"beginHour": 0,
"endHour": 0,
"activeDays": 1,
"inactiveDays": 0
},
"metadata": "EVENT_0004",
"absoluteBegin": 1569369600000,
"absoluteEnd": 1569456000000
},
{
"name": "weekly-0001",
"scheduleType": "absolute",
"repeatSetting":
{
"repeatType": "always",
"beginDayOfMonth": 1,
"endDayOfMonth": 1,
"beginHour": 0,
"endHour": 0,
"activeDays": 1,
"inactiveDays": 0
},
"metadata": "EVENT_0005",
"absoluteBegin": 1569888000000,
"absoluteEnd": 1570406400000
},
{
"name": "weekly-0002",
"scheduleType": "absolute",
"repeatSetting":
{
"repeatType": "always",
"beginDayOfMonth": 1,
"endDayOfMonth": 1,
"beginHour": 0,
"endHour": 0,
"activeDays": 1,
"inactiveDays": 0
},
"metadata": "EVENT_0006",
"absoluteBegin": 1569888000000,
"absoluteEnd": 1570406400000
},
{
"name": "monthly-0001",
"scheduleType": "absolute",
"repeatSetting":
{
"repeatType": "always",
"beginDayOfMonth": 1,
"endDayOfMonth": 1,
"beginHour": 0,
"endHour": 0,
"activeDays": 1,
"inactiveDays": 0
},
"metadata": "EVENT_0007",
"absoluteBegin": 1570406400000,
"absoluteEnd": 1575158400000
},
{
"name": "monthly-0002",
"scheduleType": "absolute",
"repeatSetting":
{
"repeatType": "always",
"beginDayOfMonth": 1,
"endDayOfMonth": 1,
"beginHour": 0,
"endHour": 0,
"activeDays": 1,
"inactiveDays": 0
},
"metadata": "EVENT_0008",
"absoluteBegin": 1570406400000,
"absoluteEnd": 1575158400000
}
]
}
UploadToken: nullimport (
"github.com/gs2io/gs2-golang-cdk/core"
"github.com/gs2io/gs2-golang-cdk/schedule"
"github.com/openlyinc/pointy"
)
SampleStack := core.NewStack()
schedule.NewNamespace(
&SampleStack,
"namespace-0001",
schedule.NamespaceOptions{},
).MasterData(
[]schedule.Event{
schedule.NewEvent(
"event-0001",
schedule.EventScheduleTypeAbsolute,
schedule.NewRepeatSetting(
schedule.RepeatSettingRepeatTypeAlways,
schedule.RepeatSettingOptions{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(1),
BeginHour: pointy.Int32(0),
EndHour: pointy.Int32(0),
ActiveDays: pointy.Int32(1),
InactiveDays: pointy.Int32(0),
},
),
schedule.EventOptions{
Metadata: pointy.String("EVENT_0001"),
AbsoluteBegin: pointy.Int64(10000),
AbsoluteEnd: pointy.Int64(20000),
},
),
schedule.NewEvent(
"event-0002",
schedule.EventScheduleTypeRelative,
schedule.NewRepeatSetting(
schedule.RepeatSettingRepeatTypeAlways,
schedule.RepeatSettingOptions{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(1),
BeginHour: pointy.Int32(0),
EndHour: pointy.Int32(0),
ActiveDays: pointy.Int32(1),
InactiveDays: pointy.Int32(0),
},
),
schedule.EventOptions{
Metadata: pointy.String("EVENT_0002"),
RelativeTriggerName: pointy.String("trigger-0001"),
},
),
schedule.NewEvent(
"daily-0001",
schedule.EventScheduleTypeAbsolute,
schedule.NewRepeatSetting(
schedule.RepeatSettingRepeatTypeAlways,
schedule.RepeatSettingOptions{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(1),
BeginHour: pointy.Int32(0),
EndHour: pointy.Int32(0),
ActiveDays: pointy.Int32(1),
InactiveDays: pointy.Int32(0),
},
),
schedule.EventOptions{
Metadata: pointy.String("EVENT_0003"),
AbsoluteBegin: pointy.Int64(1569369600000),
AbsoluteEnd: pointy.Int64(1569456000000),
},
),
schedule.NewEvent(
"daily-0002",
schedule.EventScheduleTypeAbsolute,
schedule.NewRepeatSetting(
schedule.RepeatSettingRepeatTypeAlways,
schedule.RepeatSettingOptions{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(1),
BeginHour: pointy.Int32(0),
EndHour: pointy.Int32(0),
ActiveDays: pointy.Int32(1),
InactiveDays: pointy.Int32(0),
},
),
schedule.EventOptions{
Metadata: pointy.String("EVENT_0004"),
AbsoluteBegin: pointy.Int64(1569369600000),
AbsoluteEnd: pointy.Int64(1569456000000),
},
),
schedule.NewEvent(
"weekly-0001",
schedule.EventScheduleTypeAbsolute,
schedule.NewRepeatSetting(
schedule.RepeatSettingRepeatTypeAlways,
schedule.RepeatSettingOptions{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(1),
BeginHour: pointy.Int32(0),
EndHour: pointy.Int32(0),
ActiveDays: pointy.Int32(1),
InactiveDays: pointy.Int32(0),
},
),
schedule.EventOptions{
Metadata: pointy.String("EVENT_0005"),
AbsoluteBegin: pointy.Int64(1569888000000),
AbsoluteEnd: pointy.Int64(1570406400000),
},
),
schedule.NewEvent(
"weekly-0002",
schedule.EventScheduleTypeAbsolute,
schedule.NewRepeatSetting(
schedule.RepeatSettingRepeatTypeAlways,
schedule.RepeatSettingOptions{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(1),
BeginHour: pointy.Int32(0),
EndHour: pointy.Int32(0),
ActiveDays: pointy.Int32(1),
InactiveDays: pointy.Int32(0),
},
),
schedule.EventOptions{
Metadata: pointy.String("EVENT_0006"),
AbsoluteBegin: pointy.Int64(1569888000000),
AbsoluteEnd: pointy.Int64(1570406400000),
},
),
schedule.NewEvent(
"monthly-0001",
schedule.EventScheduleTypeAbsolute,
schedule.NewRepeatSetting(
schedule.RepeatSettingRepeatTypeAlways,
schedule.RepeatSettingOptions{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(1),
BeginHour: pointy.Int32(0),
EndHour: pointy.Int32(0),
ActiveDays: pointy.Int32(1),
InactiveDays: pointy.Int32(0),
},
),
schedule.EventOptions{
Metadata: pointy.String("EVENT_0007"),
AbsoluteBegin: pointy.Int64(1570406400000),
AbsoluteEnd: pointy.Int64(1575158400000),
},
),
schedule.NewEvent(
"monthly-0002",
schedule.EventScheduleTypeAbsolute,
schedule.NewRepeatSetting(
schedule.RepeatSettingRepeatTypeAlways,
schedule.RepeatSettingOptions{
BeginDayOfMonth: pointy.Int32(1),
EndDayOfMonth: pointy.Int32(1),
BeginHour: pointy.Int32(0),
EndHour: pointy.Int32(0),
ActiveDays: pointy.Int32(1),
InactiveDays: pointy.Int32(0),
},
),
schedule.EventOptions{
Metadata: pointy.String("EVENT_0008"),
AbsoluteBegin: pointy.Int64(1570406400000),
AbsoluteEnd: pointy.Int64(1575158400000),
},
),
},
)
println(SampleStack.Yaml()) // Generate Templateclass SampleStack extends \Gs2Cdk\Core\Model\Stack
{
function __construct() {
parent::__construct();
(new \Gs2Cdk\Schedule\Model\Namespace_(
stack: $this,
name: "namespace-0001"
))->masterData(
[
new \Gs2Cdk\Schedule\Model\Event(
name:"event-0001",
scheduleType: \Gs2Cdk\Schedule\Model\Enums\EventScheduleType::ABSOLUTE,
repeatSetting:new \Gs2Cdk\Schedule\Model\RepeatSetting(
repeatType: \Gs2Cdk\Schedule\Model\Enums\RepeatSettingRepeatType::ALWAYS,
options: new \Gs2Cdk\Schedule\Model\Options\RepeatSettingOptions(
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0,
),
),
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,
repeatSetting:new \Gs2Cdk\Schedule\Model\RepeatSetting(
repeatType: \Gs2Cdk\Schedule\Model\Enums\RepeatSettingRepeatType::ALWAYS,
options: new \Gs2Cdk\Schedule\Model\Options\RepeatSettingOptions(
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0,
),
),
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,
repeatSetting:new \Gs2Cdk\Schedule\Model\RepeatSetting(
repeatType: \Gs2Cdk\Schedule\Model\Enums\RepeatSettingRepeatType::ALWAYS,
options: new \Gs2Cdk\Schedule\Model\Options\RepeatSettingOptions(
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0,
),
),
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,
repeatSetting:new \Gs2Cdk\Schedule\Model\RepeatSetting(
repeatType: \Gs2Cdk\Schedule\Model\Enums\RepeatSettingRepeatType::ALWAYS,
options: new \Gs2Cdk\Schedule\Model\Options\RepeatSettingOptions(
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0,
),
),
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,
repeatSetting:new \Gs2Cdk\Schedule\Model\RepeatSetting(
repeatType: \Gs2Cdk\Schedule\Model\Enums\RepeatSettingRepeatType::ALWAYS,
options: new \Gs2Cdk\Schedule\Model\Options\RepeatSettingOptions(
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0,
),
),
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,
repeatSetting:new \Gs2Cdk\Schedule\Model\RepeatSetting(
repeatType: \Gs2Cdk\Schedule\Model\Enums\RepeatSettingRepeatType::ALWAYS,
options: new \Gs2Cdk\Schedule\Model\Options\RepeatSettingOptions(
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0,
),
),
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,
repeatSetting:new \Gs2Cdk\Schedule\Model\RepeatSetting(
repeatType: \Gs2Cdk\Schedule\Model\Enums\RepeatSettingRepeatType::ALWAYS,
options: new \Gs2Cdk\Schedule\Model\Options\RepeatSettingOptions(
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0,
),
),
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,
repeatSetting:new \Gs2Cdk\Schedule\Model\RepeatSetting(
repeatType: \Gs2Cdk\Schedule\Model\Enums\RepeatSettingRepeatType::ALWAYS,
options: new \Gs2Cdk\Schedule\Model\Options\RepeatSettingOptions(
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0,
),
),
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,
"namespace-0001"
).masterData(
Arrays.asList(
new io.gs2.cdk.schedule.model.Event(
"event-0001",
io.gs2.cdk.schedule.model.enums.EventScheduleType.ABSOLUTE,
new io.gs2.cdk.schedule.model.RepeatSetting(
io.gs2.cdk.schedule.model.enums.RepeatSettingRepeatType.ALWAYS,
new io.gs2.cdk.schedule.model.options.RepeatSettingOptions()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(1)
.withBeginHour(0)
.withEndHour(0)
.withActiveDays(1)
.withInactiveDays(0)
),
new io.gs2.cdk.schedule.model.options.EventOptions()
.withMetadata("EVENT_0001")
.withAbsoluteBegin(10000L)
.withAbsoluteEnd(20000L)
),
new io.gs2.cdk.schedule.model.Event(
"event-0002",
io.gs2.cdk.schedule.model.enums.EventScheduleType.RELATIVE,
new io.gs2.cdk.schedule.model.RepeatSetting(
io.gs2.cdk.schedule.model.enums.RepeatSettingRepeatType.ALWAYS,
new io.gs2.cdk.schedule.model.options.RepeatSettingOptions()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(1)
.withBeginHour(0)
.withEndHour(0)
.withActiveDays(1)
.withInactiveDays(0)
),
new io.gs2.cdk.schedule.model.options.EventOptions()
.withMetadata("EVENT_0002")
.withRelativeTriggerName("trigger-0001")
),
new io.gs2.cdk.schedule.model.Event(
"daily-0001",
io.gs2.cdk.schedule.model.enums.EventScheduleType.ABSOLUTE,
new io.gs2.cdk.schedule.model.RepeatSetting(
io.gs2.cdk.schedule.model.enums.RepeatSettingRepeatType.ALWAYS,
new io.gs2.cdk.schedule.model.options.RepeatSettingOptions()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(1)
.withBeginHour(0)
.withEndHour(0)
.withActiveDays(1)
.withInactiveDays(0)
),
new io.gs2.cdk.schedule.model.options.EventOptions()
.withMetadata("EVENT_0003")
.withAbsoluteBegin(1569369600000L)
.withAbsoluteEnd(1569456000000L)
),
new io.gs2.cdk.schedule.model.Event(
"daily-0002",
io.gs2.cdk.schedule.model.enums.EventScheduleType.ABSOLUTE,
new io.gs2.cdk.schedule.model.RepeatSetting(
io.gs2.cdk.schedule.model.enums.RepeatSettingRepeatType.ALWAYS,
new io.gs2.cdk.schedule.model.options.RepeatSettingOptions()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(1)
.withBeginHour(0)
.withEndHour(0)
.withActiveDays(1)
.withInactiveDays(0)
),
new io.gs2.cdk.schedule.model.options.EventOptions()
.withMetadata("EVENT_0004")
.withAbsoluteBegin(1569369600000L)
.withAbsoluteEnd(1569456000000L)
),
new io.gs2.cdk.schedule.model.Event(
"weekly-0001",
io.gs2.cdk.schedule.model.enums.EventScheduleType.ABSOLUTE,
new io.gs2.cdk.schedule.model.RepeatSetting(
io.gs2.cdk.schedule.model.enums.RepeatSettingRepeatType.ALWAYS,
new io.gs2.cdk.schedule.model.options.RepeatSettingOptions()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(1)
.withBeginHour(0)
.withEndHour(0)
.withActiveDays(1)
.withInactiveDays(0)
),
new io.gs2.cdk.schedule.model.options.EventOptions()
.withMetadata("EVENT_0005")
.withAbsoluteBegin(1569888000000L)
.withAbsoluteEnd(1570406400000L)
),
new io.gs2.cdk.schedule.model.Event(
"weekly-0002",
io.gs2.cdk.schedule.model.enums.EventScheduleType.ABSOLUTE,
new io.gs2.cdk.schedule.model.RepeatSetting(
io.gs2.cdk.schedule.model.enums.RepeatSettingRepeatType.ALWAYS,
new io.gs2.cdk.schedule.model.options.RepeatSettingOptions()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(1)
.withBeginHour(0)
.withEndHour(0)
.withActiveDays(1)
.withInactiveDays(0)
),
new io.gs2.cdk.schedule.model.options.EventOptions()
.withMetadata("EVENT_0006")
.withAbsoluteBegin(1569888000000L)
.withAbsoluteEnd(1570406400000L)
),
new io.gs2.cdk.schedule.model.Event(
"monthly-0001",
io.gs2.cdk.schedule.model.enums.EventScheduleType.ABSOLUTE,
new io.gs2.cdk.schedule.model.RepeatSetting(
io.gs2.cdk.schedule.model.enums.RepeatSettingRepeatType.ALWAYS,
new io.gs2.cdk.schedule.model.options.RepeatSettingOptions()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(1)
.withBeginHour(0)
.withEndHour(0)
.withActiveDays(1)
.withInactiveDays(0)
),
new io.gs2.cdk.schedule.model.options.EventOptions()
.withMetadata("EVENT_0007")
.withAbsoluteBegin(1570406400000L)
.withAbsoluteEnd(1575158400000L)
),
new io.gs2.cdk.schedule.model.Event(
"monthly-0002",
io.gs2.cdk.schedule.model.enums.EventScheduleType.ABSOLUTE,
new io.gs2.cdk.schedule.model.RepeatSetting(
io.gs2.cdk.schedule.model.enums.RepeatSettingRepeatType.ALWAYS,
new io.gs2.cdk.schedule.model.options.RepeatSettingOptions()
.withBeginDayOfMonth(1)
.withEndDayOfMonth(1)
.withBeginHour(0)
.withEndHour(0)
.withActiveDays(1)
.withInactiveDays(0)
),
new io.gs2.cdk.schedule.model.options.EventOptions()
.withMetadata("EVENT_0008")
.withAbsoluteBegin(1570406400000L)
.withAbsoluteEnd(1575158400000L)
)
)
);
}
}
System.out.println(new SampleStack().yaml()); // Generate Templatepublic class SampleStack : Gs2Cdk.Core.Model.Stack
{
public SampleStack() {
new Gs2Cdk.Gs2Schedule.Model.Namespace(
stack: this,
name: "namespace-0001"
).MasterData(
new Gs2Cdk.Gs2Schedule.Model.Event[] {
new Gs2Cdk.Gs2Schedule.Model.Event(
name: "event-0001",
scheduleType: Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
repeatSetting: new Gs2Cdk.Gs2Schedule.Model.RepeatSetting(
repeatType: Gs2Cdk.Gs2Schedule.Model.Enums.RepeatSettingRepeatType.Always,
options: new Gs2Cdk.Gs2Schedule.Model.Options.RepeatSettingOptions
{
beginDayOfMonth = 1,
endDayOfMonth = 1,
beginHour = 0,
endHour = 0,
activeDays = 1,
inactiveDays = 0
}
),
options: new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions
{
metadata = "EVENT_0001",
absoluteBegin = 10000L,
absoluteEnd = 20000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
name: "event-0002",
scheduleType: Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Relative,
repeatSetting: new Gs2Cdk.Gs2Schedule.Model.RepeatSetting(
repeatType: Gs2Cdk.Gs2Schedule.Model.Enums.RepeatSettingRepeatType.Always,
options: new Gs2Cdk.Gs2Schedule.Model.Options.RepeatSettingOptions
{
beginDayOfMonth = 1,
endDayOfMonth = 1,
beginHour = 0,
endHour = 0,
activeDays = 1,
inactiveDays = 0
}
),
options: new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions
{
metadata = "EVENT_0002",
relativeTriggerName = "trigger-0001"
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
name: "daily-0001",
scheduleType: Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
repeatSetting: new Gs2Cdk.Gs2Schedule.Model.RepeatSetting(
repeatType: Gs2Cdk.Gs2Schedule.Model.Enums.RepeatSettingRepeatType.Always,
options: new Gs2Cdk.Gs2Schedule.Model.Options.RepeatSettingOptions
{
beginDayOfMonth = 1,
endDayOfMonth = 1,
beginHour = 0,
endHour = 0,
activeDays = 1,
inactiveDays = 0
}
),
options: new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions
{
metadata = "EVENT_0003",
absoluteBegin = 1569369600000L,
absoluteEnd = 1569456000000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
name: "daily-0002",
scheduleType: Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
repeatSetting: new Gs2Cdk.Gs2Schedule.Model.RepeatSetting(
repeatType: Gs2Cdk.Gs2Schedule.Model.Enums.RepeatSettingRepeatType.Always,
options: new Gs2Cdk.Gs2Schedule.Model.Options.RepeatSettingOptions
{
beginDayOfMonth = 1,
endDayOfMonth = 1,
beginHour = 0,
endHour = 0,
activeDays = 1,
inactiveDays = 0
}
),
options: new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions
{
metadata = "EVENT_0004",
absoluteBegin = 1569369600000L,
absoluteEnd = 1569456000000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
name: "weekly-0001",
scheduleType: Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
repeatSetting: new Gs2Cdk.Gs2Schedule.Model.RepeatSetting(
repeatType: Gs2Cdk.Gs2Schedule.Model.Enums.RepeatSettingRepeatType.Always,
options: new Gs2Cdk.Gs2Schedule.Model.Options.RepeatSettingOptions
{
beginDayOfMonth = 1,
endDayOfMonth = 1,
beginHour = 0,
endHour = 0,
activeDays = 1,
inactiveDays = 0
}
),
options: new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions
{
metadata = "EVENT_0005",
absoluteBegin = 1569888000000L,
absoluteEnd = 1570406400000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
name: "weekly-0002",
scheduleType: Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
repeatSetting: new Gs2Cdk.Gs2Schedule.Model.RepeatSetting(
repeatType: Gs2Cdk.Gs2Schedule.Model.Enums.RepeatSettingRepeatType.Always,
options: new Gs2Cdk.Gs2Schedule.Model.Options.RepeatSettingOptions
{
beginDayOfMonth = 1,
endDayOfMonth = 1,
beginHour = 0,
endHour = 0,
activeDays = 1,
inactiveDays = 0
}
),
options: new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions
{
metadata = "EVENT_0006",
absoluteBegin = 1569888000000L,
absoluteEnd = 1570406400000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
name: "monthly-0001",
scheduleType: Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
repeatSetting: new Gs2Cdk.Gs2Schedule.Model.RepeatSetting(
repeatType: Gs2Cdk.Gs2Schedule.Model.Enums.RepeatSettingRepeatType.Always,
options: new Gs2Cdk.Gs2Schedule.Model.Options.RepeatSettingOptions
{
beginDayOfMonth = 1,
endDayOfMonth = 1,
beginHour = 0,
endHour = 0,
activeDays = 1,
inactiveDays = 0
}
),
options: new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions
{
metadata = "EVENT_0007",
absoluteBegin = 1570406400000L,
absoluteEnd = 1575158400000L
}
),
new Gs2Cdk.Gs2Schedule.Model.Event(
name: "monthly-0002",
scheduleType: Gs2Cdk.Gs2Schedule.Model.Enums.EventScheduleType.Absolute,
repeatSetting: new Gs2Cdk.Gs2Schedule.Model.RepeatSetting(
repeatType: Gs2Cdk.Gs2Schedule.Model.Enums.RepeatSettingRepeatType.Always,
options: new Gs2Cdk.Gs2Schedule.Model.Options.RepeatSettingOptions
{
beginDayOfMonth = 1,
endDayOfMonth = 1,
beginHour = 0,
endHour = 0,
activeDays = 1,
inactiveDays = 0
}
),
options: new Gs2Cdk.Gs2Schedule.Model.Options.EventOptions
{
metadata = "EVENT_0008",
absoluteBegin = 1570406400000L,
absoluteEnd = 1575158400000L
}
)
}
);
}
}
Debug.Log(new SampleStack().Yaml()); // Generate Templateimport core from "@/gs2cdk/core";
import schedule from "@/gs2cdk/schedule";
class SampleStack extends core.Stack
{
public constructor() {
super();
new schedule.model.Namespace(
this,
"namespace-0001",
).masterData(
[
new schedule.model.Event(
"event-0001",
schedule.model.EventScheduleType.ABSOLUTE,
new schedule.model.RepeatSetting(
schedule.model.RepeatSettingRepeatType.ALWAYS,
{
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0
}
),
{
metadata: "EVENT_0001",
absoluteBegin: 10000,
absoluteEnd: 20000
}
),
new schedule.model.Event(
"event-0002",
schedule.model.EventScheduleType.RELATIVE,
new schedule.model.RepeatSetting(
schedule.model.RepeatSettingRepeatType.ALWAYS,
{
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0
}
),
{
metadata: "EVENT_0002",
relativeTriggerName: "trigger-0001"
}
),
new schedule.model.Event(
"daily-0001",
schedule.model.EventScheduleType.ABSOLUTE,
new schedule.model.RepeatSetting(
schedule.model.RepeatSettingRepeatType.ALWAYS,
{
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0
}
),
{
metadata: "EVENT_0003",
absoluteBegin: 1569369600000,
absoluteEnd: 1569456000000
}
),
new schedule.model.Event(
"daily-0002",
schedule.model.EventScheduleType.ABSOLUTE,
new schedule.model.RepeatSetting(
schedule.model.RepeatSettingRepeatType.ALWAYS,
{
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0
}
),
{
metadata: "EVENT_0004",
absoluteBegin: 1569369600000,
absoluteEnd: 1569456000000
}
),
new schedule.model.Event(
"weekly-0001",
schedule.model.EventScheduleType.ABSOLUTE,
new schedule.model.RepeatSetting(
schedule.model.RepeatSettingRepeatType.ALWAYS,
{
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0
}
),
{
metadata: "EVENT_0005",
absoluteBegin: 1569888000000,
absoluteEnd: 1570406400000
}
),
new schedule.model.Event(
"weekly-0002",
schedule.model.EventScheduleType.ABSOLUTE,
new schedule.model.RepeatSetting(
schedule.model.RepeatSettingRepeatType.ALWAYS,
{
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0
}
),
{
metadata: "EVENT_0006",
absoluteBegin: 1569888000000,
absoluteEnd: 1570406400000
}
),
new schedule.model.Event(
"monthly-0001",
schedule.model.EventScheduleType.ABSOLUTE,
new schedule.model.RepeatSetting(
schedule.model.RepeatSettingRepeatType.ALWAYS,
{
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0
}
),
{
metadata: "EVENT_0007",
absoluteBegin: 1570406400000,
absoluteEnd: 1575158400000
}
),
new schedule.model.Event(
"monthly-0002",
schedule.model.EventScheduleType.ABSOLUTE,
new schedule.model.RepeatSetting(
schedule.model.RepeatSettingRepeatType.ALWAYS,
{
beginDayOfMonth: 1,
endDayOfMonth: 1,
beginHour: 0,
endHour: 0,
activeDays: 1,
inactiveDays: 0
}
),
{
metadata: "EVENT_0008",
absoluteBegin: 1570406400000,
absoluteEnd: 1575158400000
}
)
]
);
}
}
console.log(new SampleStack().yaml()); // Generate Template
from gs2_cdk import Stack, core, schedule
class SampleStack(Stack):
def __init__(self):
super().__init__()
schedule.Namespace(
stack=self,
name="namespace-0001",
).master_data(
events=[
schedule.Event(
name='event-0001',
schedule_type=schedule.EventScheduleType.ABSOLUTE,
repeat_setting=schedule.RepeatSetting(
repeat_type=schedule.RepeatSettingRepeatType.ALWAYS,
options=schedule.RepeatSettingOptions(
begin_day_of_month=1,
end_day_of_month=1,
begin_hour=0,
end_hour=0,
active_days=1,
inactive_days=0,
),
),
options=schedule.EventOptions(
metadata = 'EVENT_0001',
absolute_begin = 10000,
absolute_end = 20000
),
),
schedule.Event(
name='event-0002',
schedule_type=schedule.EventScheduleType.RELATIVE,
repeat_setting=schedule.RepeatSetting(
repeat_type=schedule.RepeatSettingRepeatType.ALWAYS,
options=schedule.RepeatSettingOptions(
begin_day_of_month=1,
end_day_of_month=1,
begin_hour=0,
end_hour=0,
active_days=1,
inactive_days=0,
),
),
options=schedule.EventOptions(
metadata = 'EVENT_0002',
relative_trigger_name = 'trigger-0001'
),
),
schedule.Event(
name='daily-0001',
schedule_type=schedule.EventScheduleType.ABSOLUTE,
repeat_setting=schedule.RepeatSetting(
repeat_type=schedule.RepeatSettingRepeatType.ALWAYS,
options=schedule.RepeatSettingOptions(
begin_day_of_month=1,
end_day_of_month=1,
begin_hour=0,
end_hour=0,
active_days=1,
inactive_days=0,
),
),
options=schedule.EventOptions(
metadata = 'EVENT_0003',
absolute_begin = 1569369600000,
absolute_end = 1569456000000
),
),
schedule.Event(
name='daily-0002',
schedule_type=schedule.EventScheduleType.ABSOLUTE,
repeat_setting=schedule.RepeatSetting(
repeat_type=schedule.RepeatSettingRepeatType.ALWAYS,
options=schedule.RepeatSettingOptions(
begin_day_of_month=1,
end_day_of_month=1,
begin_hour=0,
end_hour=0,
active_days=1,
inactive_days=0,
),
),
options=schedule.EventOptions(
metadata = 'EVENT_0004',
absolute_begin = 1569369600000,
absolute_end = 1569456000000
),
),
schedule.Event(
name='weekly-0001',
schedule_type=schedule.EventScheduleType.ABSOLUTE,
repeat_setting=schedule.RepeatSetting(
repeat_type=schedule.RepeatSettingRepeatType.ALWAYS,
options=schedule.RepeatSettingOptions(
begin_day_of_month=1,
end_day_of_month=1,
begin_hour=0,
end_hour=0,
active_days=1,
inactive_days=0,
),
),
options=schedule.EventOptions(
metadata = 'EVENT_0005',
absolute_begin = 1569888000000,
absolute_end = 1570406400000
),
),
schedule.Event(
name='weekly-0002',
schedule_type=schedule.EventScheduleType.ABSOLUTE,
repeat_setting=schedule.RepeatSetting(
repeat_type=schedule.RepeatSettingRepeatType.ALWAYS,
options=schedule.RepeatSettingOptions(
begin_day_of_month=1,
end_day_of_month=1,
begin_hour=0,
end_hour=0,
active_days=1,
inactive_days=0,
),
),
options=schedule.EventOptions(
metadata = 'EVENT_0006',
absolute_begin = 1569888000000,
absolute_end = 1570406400000
),
),
schedule.Event(
name='monthly-0001',
schedule_type=schedule.EventScheduleType.ABSOLUTE,
repeat_setting=schedule.RepeatSetting(
repeat_type=schedule.RepeatSettingRepeatType.ALWAYS,
options=schedule.RepeatSettingOptions(
begin_day_of_month=1,
end_day_of_month=1,
begin_hour=0,
end_hour=0,
active_days=1,
inactive_days=0,
),
),
options=schedule.EventOptions(
metadata = 'EVENT_0007',
absolute_begin = 1570406400000,
absolute_end = 1575158400000
),
),
schedule.Event(
name='monthly-0002',
schedule_type=schedule.EventScheduleType.ABSOLUTE,
repeat_setting=schedule.RepeatSetting(
repeat_type=schedule.RepeatSettingRepeatType.ALWAYS,
options=schedule.RepeatSettingOptions(
begin_day_of_month=1,
end_day_of_month=1,
begin_hour=0,
end_hour=0,
active_days=1,
inactive_days=0,
),
),
options=schedule.EventOptions(
metadata = 'EVENT_0008',
absolute_begin = 1570406400000,
absolute_end = 1575158400000
),
),
],
)
print(SampleStack().yaml()) # Generate TemplateEvent
Event
Two types of event durations exist: absolute and relative. Absolute periods are fixed periods, for example, from YYYY-MM-DD 00:00 (UTC) to YYYY-MM-DD 23:59 (UTC). A relative period is an event period that varies from one game player to another, such as 24 hours from the time the trigger is activated.
In addition to the event duration, a repeat pattern can also be configured. An event period can be set up so that only Monday from 10:00 to 11:00 is included in the event period.
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| eventId | string | * | ~ 1024 chars | GS2-Schedule Event GRN
* Set automatically by the server | ||||||||
| name | string | ✓ | ~ 128 chars | Event name Unique Event name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||||||||
| scheduleType | string (enum) enum { “absolute”, “relative” } | ✓ | Schedule Type Determines how the event period is defined. absolute uses fixed start/end timestamps that are the same for all players.relative uses a per-player trigger as the starting point, enabling personalized event periods (e.g., 24 hours from when each player first logs in).
| |||||||||
| absoluteBegin | long | Absolute Begin The fixed start time of the event period for absolute scheduling. All players share the same start time. If not set for an absolute event, the event is considered to have started from the beginning of time. Expressed as Unix time in milliseconds. | ||||||||||
| absoluteEnd | long | Absolute End The fixed end time of the event period for absolute scheduling. All players share the same end time. If not set for an absolute event, the event is considered to have no end. Expressed as Unix time in milliseconds. | ||||||||||
| relativeTriggerName | string | {scheduleType} == “relative” | ✓* | ~ 128 chars | Event start trigger name Specify the name of the trigger that serves as the starting point for the event when setting an event period relative to each game player ( relative).Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). * Required if scheduleType is “relative” | |||||||
| repeatSetting | RepeatSetting | ✓ | Repeat Setting Configuration for recurring time windows within the event period. Allows narrowing the active period to specific hours, days of the week, days of the month, or custom active/inactive day cycles. Set repeatType to always to keep the event active throughout the entire event period without any repeating pattern. |
RepeatSetting
Repeat Setting
Configures a recurring time window within the overall event period.
Supports five repeat types: always (entire event period), daily (specific hours each day), weekly (specific day-of-week range with hours),
monthly (specific day-of-month range with hours), and custom (alternating active/inactive day cycles from an anchor date).
When beginHour equals endHour for daily/weekly/monthly types, the end time is treated as the same hour on the following day (i.e., a full 24-hour window).
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| repeatType | string (enum) enum { “always”, “daily”, “weekly”, “monthly”, “custom” } | “always” | Repeat Type The type of repeat pattern to apply within the event period. Determines which additional fields are required: daily/weekly/monthly require hour settings, weekly requires day-of-week, monthly requires day-of-month, and custom requires anchor timestamp and day counts. Defaults to always if not specified.
| |||||||||||||||||||
| beginDayOfMonth | int | {repeatType} == “monthly” | ✓* | 1 ~ 31 | Begin Day of Month The day of the month when the repeat window starts (1-31). If the specified value exceeds the number of days in a given month, it is treated as the last day of that month. Only applicable when repeatType is monthly.* Required if repeatType is “monthly” | |||||||||||||||||
| endDayOfMonth | int | {repeatType} == “monthly” | ✓* | 1 ~ 31 | End Day of Month The day of the month when the repeat window ends (1-31). If the specified value exceeds the number of days in a given month, it is treated as the last day of that month. Only applicable when repeatType is monthly.* Required if repeatType is “monthly” | |||||||||||||||||
| beginDayOfWeek | string (enum) enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓* | Begin Day of Week The day of the week when the repeat window starts. The window can span across week boundaries (e.g., Friday to Monday). Only applicable when repeatType is weekly.
* Required if repeatType is “weekly” | ||||||||||||||||||
| endDayOfWeek | string (enum) enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {repeatType} == “weekly” | ✓* | End Day of Week The day of the week when the repeat window ends. Combined with beginDayOfWeek to define the weekly active period. Only applicable when repeatType is weekly.
* Required if repeatType is “weekly” | ||||||||||||||||||
| beginHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓* | 0 ~ 23 | Begin Hour The hour (UTC, 0-23) at which the repeat window starts each cycle. Required for daily, weekly, and monthly repeat types. If beginHour equals endHour, the window spans a full 24 hours (ending at the same hour the next day). * Required if repeatType is “daily”,“weekly”,“monthly” | |||||||||||||||||
| endHour | int | {repeatType} in [“daily”, “weekly”, “monthly”] | ✓* | 0 ~ 24 | End Hour The hour (UTC, 0-24) at which the repeat window ends each cycle. A value of 24 represents midnight of the following day. Required for daily, weekly, and monthly repeat types. * Required if repeatType is “daily”,“weekly”,“monthly” | |||||||||||||||||
| anchorTimestamp | long | {repeatType} == “custom” | ✓* | Anchor Timestamp The reference date from which the custom active/inactive cycle begins. The system calculates which phase (active or inactive) the current time falls into based on elapsed days from this anchor. Only applicable when repeatType is custom. Expressed as Unix time in milliseconds.* Required if repeatType is “custom” | ||||||||||||||||||
| activeDays | int | {repeatType} == “custom” | ✓* | 1 ~ 2147483646 | Active Days The number of consecutive days the event is active in each custom cycle. After these active days, the event becomes inactive for the number of days specified by inactiveDays, then the cycle repeats. Only applicable when repeatType is custom. Minimum 1 day.* Required if repeatType is “custom” | |||||||||||||||||
| inactiveDays | int | {repeatType} == “custom” | ✓* | 0 ~ 2147483646 | Inactive Days The number of consecutive days the event is inactive in each custom cycle. Follows the active days period. Set to 0 for a continuously active event with no gaps. Only applicable when repeatType is custom. Minimum 0 days.* Required if repeatType is “custom” |