xref: /aosp_15_r20/external/googleapis/google/cloud/aiplatform/v1beta1/schedule.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.aiplatform.v1beta1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/cloud/aiplatform/v1beta1/model_monitoring_service.proto";
22import "google/cloud/aiplatform/v1beta1/pipeline_service.proto";
23import "google/protobuf/timestamp.proto";
24
25option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1";
26option go_package = "cloud.google.com/go/aiplatform/apiv1beta1/aiplatformpb;aiplatformpb";
27option java_multiple_files = true;
28option java_outer_classname = "ScheduleProto";
29option java_package = "com.google.cloud.aiplatform.v1beta1";
30option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1";
31option ruby_package = "Google::Cloud::AIPlatform::V1beta1";
32
33// An instance of a Schedule periodically schedules runs to make API calls based
34// on user specified time specification and API request type.
35message Schedule {
36  option (google.api.resource) = {
37    type: "aiplatform.googleapis.com/Schedule"
38    pattern: "projects/{project}/locations/{location}/schedules/{schedule}"
39  };
40
41  // Status of a scheduled run.
42  message RunResponse {
43    // The scheduled run time based on the user-specified schedule.
44    google.protobuf.Timestamp scheduled_run_time = 1;
45
46    // The response of the scheduled run.
47    string run_response = 2;
48  }
49
50  // Possible state of the schedule.
51  enum State {
52    // Unspecified.
53    STATE_UNSPECIFIED = 0;
54
55    // The Schedule is active. Runs are being scheduled on the user-specified
56    // timespec.
57    ACTIVE = 1;
58
59    // The schedule is paused. No new runs will be created until the schedule
60    // is resumed. Already started runs will be allowed to complete.
61    PAUSED = 2;
62
63    // The Schedule is completed. No new runs will be scheduled. Already started
64    // runs will be allowed to complete. Schedules in completed state cannot be
65    // paused or resumed.
66    COMPLETED = 3;
67  }
68
69  // Required.
70  // The time specification to launch scheduled runs.
71  oneof time_specification {
72    // Cron schedule (https://en.wikipedia.org/wiki/Cron) to launch scheduled
73    // runs. To explicitly set a timezone to the cron tab, apply a prefix in the
74    // cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or "TZ=${IANA_TIME_ZONE}".
75    // The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone
76    // database. For example, "CRON_TZ=America/New_York 1 * * * *", or
77    // "TZ=America/New_York 1 * * * *".
78    string cron = 10;
79  }
80
81  // Required.
82  // The API request template to launch the scheduled runs.
83  // User-specified ID is not supported in the request template.
84  oneof request {
85    // Request for
86    // [PipelineService.CreatePipelineJob][google.cloud.aiplatform.v1beta1.PipelineService.CreatePipelineJob].
87    // CreatePipelineJobRequest.parent field is required (format:
88    // projects/{project}/locations/{location}).
89    CreatePipelineJobRequest create_pipeline_job_request = 14;
90
91    // Request for
92    // [ModelMonitoringService.CreateModelMonitoringJob][google.cloud.aiplatform.v1beta1.ModelMonitoringService.CreateModelMonitoringJob].
93    CreateModelMonitoringJobRequest create_model_monitoring_job_request = 15;
94  }
95
96  // Immutable. The resource name of the Schedule.
97  string name = 1 [(google.api.field_behavior) = IMMUTABLE];
98
99  // Required. User provided name of the Schedule.
100  // The name can be up to 128 characters long and can consist of any UTF-8
101  // characters.
102  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
103
104  // Optional. Timestamp after which the first run can be scheduled.
105  // Default to Schedule create time if not specified.
106  google.protobuf.Timestamp start_time = 3
107      [(google.api.field_behavior) = OPTIONAL];
108
109  // Optional. Timestamp after which no new runs can be scheduled.
110  // If specified, The schedule will be completed when either
111  // end_time is reached or when scheduled_run_count >= max_run_count.
112  // If not specified, new runs will keep getting scheduled until this Schedule
113  // is paused or deleted. Already scheduled runs will be allowed to complete.
114  // Unset if not specified.
115  google.protobuf.Timestamp end_time = 4
116      [(google.api.field_behavior) = OPTIONAL];
117
118  // Optional. Maximum run count of the schedule.
119  // If specified, The schedule will be completed when either
120  // started_run_count >= max_run_count or when end_time is reached.
121  // If not specified, new runs will keep getting scheduled until this Schedule
122  // is paused or deleted. Already scheduled runs will be allowed to complete.
123  // Unset if not specified.
124  int64 max_run_count = 16 [(google.api.field_behavior) = OPTIONAL];
125
126  // Output only. The number of runs started by this schedule.
127  int64 started_run_count = 17 [(google.api.field_behavior) = OUTPUT_ONLY];
128
129  // Output only. The state of this Schedule.
130  State state = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
131
132  // Output only. Timestamp when this Schedule was created.
133  google.protobuf.Timestamp create_time = 6
134      [(google.api.field_behavior) = OUTPUT_ONLY];
135
136  // Output only. Timestamp when this Schedule was updated.
137  google.protobuf.Timestamp update_time = 19
138      [(google.api.field_behavior) = OUTPUT_ONLY];
139
140  // Output only. Timestamp when this Schedule should schedule the next run.
141  // Having a next_run_time in the past means the runs are being started
142  // behind schedule.
143  google.protobuf.Timestamp next_run_time = 7
144      [(google.api.field_behavior) = OUTPUT_ONLY];
145
146  // Output only. Timestamp when this Schedule was last paused.
147  // Unset if never paused.
148  google.protobuf.Timestamp last_pause_time = 8
149      [(google.api.field_behavior) = OUTPUT_ONLY];
150
151  // Output only. Timestamp when this Schedule was last resumed.
152  // Unset if never resumed from pause.
153  google.protobuf.Timestamp last_resume_time = 9
154      [(google.api.field_behavior) = OUTPUT_ONLY];
155
156  // Required. Maximum number of runs that can be started concurrently for this
157  // Schedule. This is the limit for starting the scheduled requests and not the
158  // execution of the operations/jobs created by the requests (if applicable).
159  int64 max_concurrent_run_count = 11 [(google.api.field_behavior) = REQUIRED];
160
161  // Optional. Whether new scheduled runs can be queued when max_concurrent_runs
162  // limit is reached. If set to true, new runs will be queued instead of
163  // skipped. Default to false.
164  bool allow_queueing = 12 [(google.api.field_behavior) = OPTIONAL];
165
166  // Output only. Whether to backfill missed runs when the schedule is resumed
167  // from PAUSED state. If set to true, all missed runs will be scheduled. New
168  // runs will be scheduled after the backfill is complete. Default to false.
169  bool catch_up = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
170
171  // Output only. Response of the last scheduled run.
172  // This is the response for starting the scheduled requests and not the
173  // execution of the operations/jobs created by the requests (if applicable).
174  // Unset if no run has been scheduled yet.
175  RunResponse last_scheduled_run_response = 18
176      [(google.api.field_behavior) = OUTPUT_ONLY];
177}
178