Skip to main content

schedules

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

Overview

Nameschedules
TypeResource
Idgoogle.aiplatform.schedules

Fields

The following fields are returned by SELECT queries:

Successful response

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 for NotebookService.CreateNotebookExecutionJob. (id: GoogleCloudAiplatformV1CreateNotebookExecutionJobRequest)
createPipelineJobRequestobjectRequest for PipelineService.CreatePipelineJob. CreatePipelineJobRequest.parent field is required (format: projects/{project}/locations/{location}). (id: GoogleCloudAiplatformV1CreatePipelineJobRequest)
createTimestring (google-datetime)Output 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.
endTimestring (google-datetime)Optional. 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.
lastPauseTimestring (google-datetime)Output only. Timestamp when this Schedule was last paused. Unset if never paused.
lastResumeTimestring (google-datetime)Output only. Timestamp when this Schedule was last resumed. Unset if never resumed from pause.
lastScheduledRunResponseobjectOutput only. Response of the last scheduled run. This is the response for starting the scheduled requests and not the execution of the operations/jobs created by the requests (if applicable). Unset if no run has been scheduled yet. (id: GoogleCloudAiplatformV1ScheduleRunResponse)
maxConcurrentRunCountstring (int64)Required. 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).
maxRunCountstring (int64)Optional. 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.
nextRunTimestring (google-datetime)Output 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.
startTimestring (google-datetime)Optional. Timestamp after which the first run can be scheduled. Default to Schedule create time if not specified.
startedRunCountstring (int64)Output only. The number of runs started by this schedule.
statestringOutput only. The state of this Schedule.
updateTimestring (google-datetime)Output only. Timestamp when this Schedule was updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, schedulesIdGets a Schedule.
listselectprojectsId, locationsIdfilter, pageSize, pageToken, orderByLists Schedules in a Location.
createinsertprojectsId, locationsIdCreates a Schedule.
patchupdateprojectsId, locationsId, schedulesIdupdateMaskUpdates 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.
deletedeleteprojectsId, locationsId, schedulesIdDeletes a Schedule.
pauseexecprojectsId, locationsId, 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.
resumeexecprojectsId, locationsId, 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.catch_up is set up true, all missed runs will be scheduled for backfill first.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
schedulesIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets a Schedule.

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 projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND schedulesId = '{{ schedulesId }}' -- required;

INSERT examples

Creates a Schedule.

INSERT INTO google.aiplatform.schedules (
data__cron,
data__createPipelineJobRequest,
data__createNotebookExecutionJobRequest,
data__name,
data__displayName,
data__startTime,
data__endTime,
data__maxRunCount,
data__maxConcurrentRunCount,
data__allowQueueing,
projectsId,
locationsId
)
SELECT
'{{ cron }}',
'{{ createPipelineJobRequest }}',
'{{ createNotebookExecutionJobRequest }}',
'{{ name }}',
'{{ displayName }}',
'{{ startTime }}',
'{{ endTime }}',
'{{ maxRunCount }}',
'{{ maxConcurrentRunCount }}',
{{ allowQueueing }},
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
allowQueueing,
catchUp,
createNotebookExecutionJobRequest,
createPipelineJobRequest,
createTime,
cron,
displayName,
endTime,
lastPauseTime,
lastResumeTime,
lastScheduledRunResponse,
maxConcurrentRunCount,
maxRunCount,
nextRunTime,
startTime,
startedRunCount,
state,
updateTime
;

UPDATE examples

Updates 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.

UPDATE google.aiplatform.schedules
SET
data__cron = '{{ cron }}',
data__createPipelineJobRequest = '{{ createPipelineJobRequest }}',
data__createNotebookExecutionJobRequest = '{{ createNotebookExecutionJobRequest }}',
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__startTime = '{{ startTime }}',
data__endTime = '{{ endTime }}',
data__maxRunCount = '{{ maxRunCount }}',
data__maxConcurrentRunCount = '{{ maxConcurrentRunCount }}',
data__allowQueueing = {{ allowQueueing }}
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND schedulesId = '{{ schedulesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
allowQueueing,
catchUp,
createNotebookExecutionJobRequest,
createPipelineJobRequest,
createTime,
cron,
displayName,
endTime,
lastPauseTime,
lastResumeTime,
lastScheduledRunResponse,
maxConcurrentRunCount,
maxRunCount,
nextRunTime,
startTime,
startedRunCount,
state,
updateTime;

DELETE examples

Deletes a Schedule.

DELETE FROM google.aiplatform.schedules
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND schedulesId = '{{ schedulesId }}' --required;

Lifecycle Methods

Pauses 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.

EXEC google.aiplatform.schedules.pause 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@schedulesId='{{ schedulesId }}' --required;