ドキュメント

サポート

Cloud Code

Unity Gaming Services CLI

Create and manage schedule configurations from the command line using the Unity Gaming Services command-line interface.
読み終わるまでの所要時間 1 分最終更新 23日前

Unity Gaming Services CLI を使用して、スケジュールを操作できます。CLI により、コマンドラインからスケジュール設定を管理できます。

前提条件

CLI の詳細情報については、Unity Gaming Services CLI の使用の準備ガイド のステップに従います。 このガイドに従うには、最初に以下のアクションを実行する必要があります。
  1. UGS CLI をインストール します。
  2. 以下を使用して、プロジェクト ID と環境を設定します。
    ugs config set project-id <your-project-id>

    ugs config set environment-name <your-environment-name>
  3. Scheduler環境管理 に必要なロールでサービスアカウントを設定します。詳細については、認証の取得 を参照してください。

CLI の使用

すべてのコマンドとオプションの完全なリファレンスについては、Schedules コマンドラインのドキュメント を参照してください。

スケジュールのデプロイ

new-file
コマンドを実行して、スケジュール設定をローカルに作成します。
ugs scheduler new-file <file-name>
設定ファイルのコンテンツは以下のようになります。
{ "$schema": "https://ugs-config-schemas.unity3d.com/v1/schedules.schema.json", "Configs": { "Schedule1": { "EventName": "EventType1", "Type": "recurring", "Schedule": "0 * * * *", "PayloadVersion": 1, "Payload": "{}" }, "Schedule2": { "EventName": "EventType2", "Type": "one-time", "Schedule": "2024-03-08T13:06:32.311+00:00", "PayloadVersion": 1, "Payload": "{ \"message\": \"Hello, world!\"}" } }}
必要に応じて、スケジュール設定を複数のファイルに分割することもできます。
{ "$schema": "https://ugs-config-schemas.unity3d.com/v1/schedules.schema.json", "Configs": { "Schedule1": { "EventName": "EventType1", "Type": "recurring", "Schedule": "0 * * * *", "PayloadVersion": 1, "Payload": "{}" } }}
{ "$schema": "https://ugs-config-schemas.unity3d.com/v1/schedules.schema.json", "Configs": { "Schedule2": { "EventName": "EventType2", "Type": "one-time", "Schedule": "2024-03-08T13:06:32.311+00:00", "PayloadVersion": 1, "Payload": "{ \"message\": \"Hello, world!\"}" } }}
Deploy
コマンドを使用して、ローカルスケジュール設定ファイルをリモート環境にプロモートできます。
アクティブなスケジュールになるように設定ファイルをデプロイする必要があります。
ugs deploy <path-to-schedules-file> <path-to-schedules-file>
ugs deploy <path-to-directory>

スケジュールの取得

現在アクティブなすべてのスケジュールを一覧表示するには、以下のコマンドを実行します。
ugs scheduler list
Fetch
コマンドを使用して、一度に複数のスケジュールをリモートから取得できます。
指定されたパスは、スケジュールが保存されるディレクトリです。
ugs fetch <path>

スケジュールの削除

スケジュールを削除するには、
--reconcile
フラグを指定して
deploy
コマンドを実行します。
ugs deploy --services scheduler <path-to-config-file> --reconcile