Skip to main content

schedules

Creates, updates, deletes, gets or lists a schedules resource.

Overview

Nameschedules
TypeResource
Idgoogle.aiplatform.schedules

Fields

NameDatatypeDescription
namestringImmutable. The resource name of the Schedule.
allowQueueingbooleanOptional. Whether new scheduled runs can be queued when max_concurrent_runs limit is reached. If set to true, new runs will be queued instead of skipped. Default to false.
catchUpbooleanOutput only. Whether to backfill missed runs when the schedule is resumed from PAUSED state. If set to true, all missed runs will be scheduled. New runs will be scheduled after the backfill is complete. Default to false.
createNotebookExecutionJobRequestobjectRequest message for [NotebookService.CreateNotebookExecutionJob]
createPipelineJobRequestobjectRequest message for PipelineService.CreatePipelineJob.
createTimestringOutput only. Timestamp when this Schedule was created.
cronstringCron schedule (https://en.wikipedia.org/wiki/Cron) to launch scheduled runs. To explicitly set a timezone to the cron tab, apply a prefix in the cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or "TZ=${IANA_TIME_ZONE}". The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone database. For example, "CRON_TZ=America/New_York 1 * * * ", or "TZ=America/New_York 1 * * *".
displayNamestringRequired. User provided name of the Schedule. The name can be up to 128 characters long and can consist of any UTF-8 characters.
endTimestringOptional. Timestamp after which no new runs can be scheduled. If specified, The schedule will be completed when either end_time is reached or when scheduled_run_count >= max_run_count. If not specified, new runs will keep getting scheduled until this Schedule is paused or deleted. Already scheduled runs will be allowed to complete. Unset if not specified.
lastPauseTimestringOutput only. Timestamp when this Schedule was last paused. Unset if never paused.
lastResumeTimestringOutput only. Timestamp when this Schedule was last resumed. Unset if never resumed from pause.
lastScheduledRunResponseobjectStatus of a scheduled run.
maxConcurrentRunCountstringRequired. Maximum number of runs that can be started concurrently for this Schedule. This is the limit for starting the scheduled requests and not the execution of the operations/jobs created by the requests (if applicable).
maxRunCountstringOptional. Maximum run count of the schedule. If specified, The schedule will be completed when either started_run_count >= max_run_count or when end_time is reached. If not specified, new runs will keep getting scheduled until this Schedule is paused or deleted. Already scheduled runs will be allowed to complete. Unset if not specified.
nextRunTimestringOutput only. Timestamp when this Schedule should schedule the next run. Having a next_run_time in the past means the runs are being started behind schedule.
startTimestringOptional. Timestamp after which the first run can be scheduled. Default to Schedule create time if not specified.
startedRunCountstringOutput only. The number of runs started by this schedule.
statestringOutput only. The state of this Schedule.
updateTimestringOutput only. Timestamp when this Schedule was updated.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, schedulesIdGets a Schedule.
listSELECTlocationsId, projectsIdLists Schedules in a Location.
createINSERTlocationsId, projectsIdCreates a Schedule.
deleteDELETElocationsId, projectsId, schedulesIdDeletes a Schedule.
patchUPDATElocationsId, projectsId, schedulesIdUpdates an active or paused Schedule. When the Schedule is updated, new runs will be scheduled starting from the updated next execution time after the update time based on the time_specification in the updated Schedule. All unstarted runs before the update time will be skipped while already created runs will NOT be paused or canceled.
pauseEXEClocationsId, projectsId, schedulesIdPauses a Schedule. Will mark Schedule.state to 'PAUSED'. If the schedule is paused, no new runs will be created. Already created runs will NOT be paused or canceled.
resumeEXEClocationsId, projectsId, schedulesIdResumes a paused Schedule to start scheduling new runs. Will mark Schedule.state to 'ACTIVE'. Only paused Schedule can be resumed. When the Schedule is resumed, new runs will be scheduled starting from the next execution time after the current time based on the time_specification in the Schedule. If Schedule.catchUp is set up true, all missed runs will be scheduled for backfill first.

SELECT examples

Lists Schedules in a Location.

SELECT
name,
allowQueueing,
catchUp,
createNotebookExecutionJobRequest,
createPipelineJobRequest,
createTime,
cron,
displayName,
endTime,
lastPauseTime,
lastResumeTime,
lastScheduledRunResponse,
maxConcurrentRunCount,
maxRunCount,
nextRunTime,
startTime,
startedRunCount,
state,
updateTime
FROM google.aiplatform.schedules
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';

INSERT example

Use the following StackQL query and manifest file to create a new schedules resource.

/*+ create */
INSERT INTO google.aiplatform.schedules (
locationsId,
projectsId,
displayName,
allowQueueing,
cron,
endTime,
createNotebookExecutionJobRequest,
maxConcurrentRunCount,
maxRunCount,
startTime,
name,
createPipelineJobRequest
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ displayName }}',
{{ allowQueueing }},
'{{ cron }}',
'{{ endTime }}',
'{{ createNotebookExecutionJobRequest }}',
'{{ maxConcurrentRunCount }}',
'{{ maxRunCount }}',
'{{ startTime }}',
'{{ name }}',
'{{ createPipelineJobRequest }}'
;

UPDATE example

Updates a schedules resource.

/*+ update */
UPDATE google.aiplatform.schedules
SET
displayName = '{{ displayName }}',
allowQueueing = true|false,
cron = '{{ cron }}',
endTime = '{{ endTime }}',
createNotebookExecutionJobRequest = '{{ createNotebookExecutionJobRequest }}',
maxConcurrentRunCount = '{{ maxConcurrentRunCount }}',
maxRunCount = '{{ maxRunCount }}',
startTime = '{{ startTime }}',
name = '{{ name }}',
createPipelineJobRequest = '{{ createPipelineJobRequest }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND schedulesId = '{{ schedulesId }}';

DELETE example

Deletes the specified schedules resource.

/*+ delete */
DELETE FROM google.aiplatform.schedules
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND schedulesId = '{{ schedulesId }}';