Unity Gaming Services CLI
Create and manage schedule configurations from the command line using the Unity Gaming Services command-line interface.
Read time 2 minutesLast updated 18 hours ago
You can use the Unity Gaming Services CLI to interact with schedules. The CLI allows you to manage schedule configurations from the command line.
Prerequisites
For more comprehensive information on the CLI, follow the steps in the Unity Gaming Services CLI Get Started guide. To follow this guide, you first need to complete the following actions:- Install the UGS CLI.
-
Use the following to configure your Project ID and Environment:
ugs config set project-id <your-project-id>
ugs config set environment-name <your-environment-name> - Configure a service account with the required roles for Scheduler and environments management. For more information, refer to Get Authenticated.
Using the CLI
For a full reference of all commands and options, refer to the Schedules Command Line documentation.Deploy schedules
Run thenew-fileThe configuration file contents can look like the following:ugs scheduler new-file <file-name>
You can also separate the schedule configurations into multiple files if you need to.{ "$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": "{}" } }}
You can use the{ "$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!\"}" } }}
Deployugs deploy <path-to-schedules-file> <path-to-schedules-file>
ugs deploy <path-to-directory>
Retrieve schedules
To list all currently active schedules, run the following command:You can use theugs scheduler list
Fetchugs fetch <path>
Delete schedules
You can delete a schedule by running thedeploy--reconcileugs deploy --services scheduler <path-to-config-file> --reconcile