기술 자료

Scheduler Admin API


Scheduler Admin API


Scheduler Admin API

Introduction

This is the admin client API specification for the Unity Scheduler service. The Scheduler service is responsible for scheduling events to be sent to the Triggers service.

Rate Limits

The API has rate limiting in place. Request are limited on a per-user basis to 600 requests per minute which would allow for a sustained 10 requests per second. The List endpoint is limited to 120 requests per minute, which allows for sustained 2 requests per second. The API responds with a
429
HTTP status code if the rate limit is exceeded. It will also respond with a
Retry-After
header to be used in conjunction with a client's retry logic. The value is the number of seconds until a request for the given player will be accepted.
Download OpenAPI specification:

List Scheduler Configs


Get list of schedules for the given project and environment
Authorizations
ServiceAccount (scheduler.configs.list)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: scheduler.configs.list

Path parameters for "{title}"

projectId

string
필수
The project's Project ID

environmentId

string
필수
The Environment ID of a project

Query parameters for "{title}"

limit

integer
기본: 1000
The number of schedules to display per page

after

string
기본: null
A token to get the next page

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/scheduler/v1/projects/{projectId}/environments/{environmentId}/configs"

Response example

{ "after": "eyJTZWFyY2hBZnRlciI6WzAsMSwyMl0sIlNjcm9sbElEIjoiIiwiUG9pbnRJblRpbWVJRCI6IjAwMCJ9=", "configs": [ { "id": "00000000-0000-0000-0000-000000000001", "name": "Example Recurring", "eventName": "example-event", "type": "recurring", "schedule": "0 * * * *", "payloadVersion": 1, "payload": "{}" }, { "id": "00000000-0000-0000-0000-000000000002", "name": "Example One Time", "eventName": "example-event", "type": "one-time", "schedule": "2023-10-02T15:00:00Z", "payloadVersion": 1, "payload": "{}" } ]}

Create Schedule Config


Add schedule to project environment
Authorizations
ServiceAccount (scheduler.configs.create)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: scheduler.configs.create

Path parameters for "{title}"

projectId

string
필수
The project's Project ID

environmentId

string
필수
The Environment ID of a project

Request body for "{title}"

Media Type:
application/json

name

string
필수
The display name used to identify a schedule. This must be unique for currently scheduled events.

eventName

string
필수
The schedule event name is passed through to the triggers service as part of the event type so that the trigger event is defined as
com.unity.services.scheduler.{scheduleEventName}.v1
The triggers service uses this to identify incoming events and execute the configured action. For a trigger configuration to action an incoming event with type
com.unity.services.scheduler.example-event.v1
, it would require a value of
example-event
to be passed in here.

type

필수
Defines the type of schedule config. Supported schedule types:
  • recurring
  • one-time
Any of

schedule

string
필수
Defines when the planned event should occur.
If the schedule config has a type of
one-time
this field must have a valid RFC3339 timestamp. If the schedule config has a type of
recurring
this field must have a valid cron expression as per below:

Field name

Allowed values

Allowed special characters

Minutes0-59* / , -
Hours0-23* / , -
Day of month1-31* / , -
Month1-12 or JAN-DEC* / , -
Day of week0-6 or SUN-SAT* / , -
Recurring schedules have a minimum scheduled frequency of once per hour.

payloadVersion

integer
필수
No description

payload

string
Defines JSON event payload. Maximum size of 1kb.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ -H "Content-Type: application/json" \ -d '{ "name": "string", "eventName": "string", "type": "string", "schedule": "string", "payloadVersion": 0, "payload": "string"}' \ "https://services.api.unity.com/scheduler/v1/projects/{projectId}/environments/{environmentId}/configs"

Response example

{ "id": "string"}

Delete Schedule Configs


Deletes multiple schedule configurations
Authorizations
ServiceAccount (scheduler.configs.delete)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: scheduler.configs.delete

Path parameters for "{title}"

projectId

string
필수
The project's Project ID

environmentId

string
필수
The Environment ID of a project

Request body for "{title}"

Media Type:
application/json
Array Type:
[ "string"]

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X POST \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ -H "Content-Type: application/json" \ -d '[ "string"]' \ "https://services.api.unity.com/scheduler/v1/projects/{projectId}/environments/{environmentId}/configs:batch-delete"

Response example

{ "errors": { "00000000-0000-0000-0000-000000000001": { "type": "problems/basic", "title": "Error", "status": 400, "detail": "Bad request", "instance": null, "code": 55 }, "00000000-0000-0000-0000-000000000002": { "type": "problems/basic", "title": "Error", "status": 503, "detail": "Temporary Service Error", "instance": null, "code": 3 } }}

Get Schedule Config


Retrieves the configuration for a specific schedule
Authorizations
ServiceAccount (scheduler.configs.get)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: scheduler.configs.get

Path parameters for "{title}"

projectId

string
필수
The project's Project ID

environmentId

string
필수
The Environment ID of a project

configId

string
필수
example: 00000000-0000-0000-0000-000000000000
ID of the scheduler config. List the scheduler configurations to retrieve IDs.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X GET \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/scheduler/v1/projects/{projectId}/environments/{environmentId}/configs/{configId}"

Response example

{ "id": "00000000-0000-0000-0000-000000000001", "name": "Example Recurring Event", "eventName": "example-event", "type": "recurring", "schedule": "0 * * * *", "payloadVersion": 1, "payload": "{}"}

Delete Schedule Config


Deletes the configuration for a specific schedule
Authorizations
ServiceAccount (scheduler.configs.delete)
HTTP: ServiceAccount
To get started with authentication, visit the Service Account Authentication section.
HTTP Authorization Scheme: basic
Required scopes: scheduler.configs.delete

Path parameters for "{title}"

projectId

string
필수
The project's Project ID

environmentId

string
필수
The Environment ID of a project

configId

string
필수
example: 00000000-0000-0000-0000-000000000000
ID of the scheduler config. List the scheduler configurations to retrieve IDs.

HTTP response status codes for "{title}":

Code samples for "{title}":

Request example

curl -X DELETE \ -H "Authorization: Basic <YOUR_CREDENTIALS>" \ "https://services.api.unity.com/scheduler/v1/projects/{projectId}/environments/{environmentId}/configs/{configId}"

Response example

{ "type": "problems/basic", "title": "Unauthorized", "status": 401, "code": 53, "detail": "Unauthorized"}