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.v1; 18 19import "google/api/annotations.proto"; 20import "google/api/client.proto"; 21import "google/api/field_behavior.proto"; 22import "google/api/resource.proto"; 23import "google/cloud/aiplatform/v1/operation.proto"; 24import "google/cloud/aiplatform/v1/schedule.proto"; 25import "google/longrunning/operations.proto"; 26import "google/protobuf/empty.proto"; 27import "google/protobuf/field_mask.proto"; 28 29option csharp_namespace = "Google.Cloud.AIPlatform.V1"; 30option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; 31option java_multiple_files = true; 32option java_outer_classname = "ScheduleServiceProto"; 33option java_package = "com.google.cloud.aiplatform.v1"; 34option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; 35option ruby_package = "Google::Cloud::AIPlatform::V1"; 36 37// A service for creating and managing Vertex AI's Schedule resources to 38// periodically launch shceudled runs to make API calls. 39service ScheduleService { 40 option (google.api.default_host) = "aiplatform.googleapis.com"; 41 option (google.api.oauth_scopes) = 42 "https://www.googleapis.com/auth/cloud-platform"; 43 44 // Creates a Schedule. 45 rpc CreateSchedule(CreateScheduleRequest) returns (Schedule) { 46 option (google.api.http) = { 47 post: "/v1/{parent=projects/*/locations/*}/schedules" 48 body: "schedule" 49 }; 50 option (google.api.method_signature) = "parent,schedule"; 51 } 52 53 // Deletes a Schedule. 54 rpc DeleteSchedule(DeleteScheduleRequest) 55 returns (google.longrunning.Operation) { 56 option (google.api.http) = { 57 delete: "/v1/{name=projects/*/locations/*/schedules/*}" 58 }; 59 option (google.api.method_signature) = "name"; 60 option (google.longrunning.operation_info) = { 61 response_type: "google.protobuf.Empty" 62 metadata_type: "DeleteOperationMetadata" 63 }; 64 } 65 66 // Gets a Schedule. 67 rpc GetSchedule(GetScheduleRequest) returns (Schedule) { 68 option (google.api.http) = { 69 get: "/v1/{name=projects/*/locations/*/schedules/*}" 70 }; 71 option (google.api.method_signature) = "name"; 72 } 73 74 // Lists Schedules in a Location. 75 rpc ListSchedules(ListSchedulesRequest) returns (ListSchedulesResponse) { 76 option (google.api.http) = { 77 get: "/v1/{parent=projects/*/locations/*}/schedules" 78 }; 79 option (google.api.method_signature) = "parent"; 80 } 81 82 // Pauses a Schedule. Will mark 83 // [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'PAUSED'. If 84 // the schedule is paused, no new runs will be created. Already created runs 85 // will NOT be paused or canceled. 86 rpc PauseSchedule(PauseScheduleRequest) returns (google.protobuf.Empty) { 87 option (google.api.http) = { 88 post: "/v1/{name=projects/*/locations/*/schedules/*}:pause" 89 body: "*" 90 }; 91 option (google.api.method_signature) = "name"; 92 } 93 94 // Resumes a paused Schedule to start scheduling new runs. Will mark 95 // [Schedule.state][google.cloud.aiplatform.v1.Schedule.state] to 'ACTIVE'. 96 // Only paused Schedule can be resumed. 97 // 98 // When the Schedule is resumed, new runs will be scheduled starting from the 99 // next execution time after the current time based on the time_specification 100 // in the Schedule. If [Schedule.catchUp][] is set up true, all 101 // missed runs will be scheduled for backfill first. 102 rpc ResumeSchedule(ResumeScheduleRequest) returns (google.protobuf.Empty) { 103 option (google.api.http) = { 104 post: "/v1/{name=projects/*/locations/*/schedules/*}:resume" 105 body: "*" 106 }; 107 option (google.api.method_signature) = "name"; 108 option (google.api.method_signature) = "name,catch_up"; 109 } 110 111 // Updates an active or paused Schedule. 112 // 113 // When the Schedule is updated, new runs will be scheduled starting from the 114 // updated next execution time after the update time based on the 115 // time_specification in the updated Schedule. All unstarted runs before the 116 // update time will be skipped while already created runs will NOT be paused 117 // or canceled. 118 rpc UpdateSchedule(UpdateScheduleRequest) returns (Schedule) { 119 option (google.api.http) = { 120 patch: "/v1/{schedule.name=projects/*/locations/*/schedules/*}" 121 body: "schedule" 122 }; 123 option (google.api.method_signature) = "schedule,update_mask"; 124 } 125} 126 127// Request message for 128// [ScheduleService.CreateSchedule][google.cloud.aiplatform.v1.ScheduleService.CreateSchedule]. 129message CreateScheduleRequest { 130 // Required. The resource name of the Location to create the Schedule in. 131 // Format: `projects/{project}/locations/{location}` 132 string parent = 1 [ 133 (google.api.field_behavior) = REQUIRED, 134 (google.api.resource_reference) = { 135 type: "locations.googleapis.com/Location" 136 } 137 ]; 138 139 // Required. The Schedule to create. 140 Schedule schedule = 2 [(google.api.field_behavior) = REQUIRED]; 141} 142 143// Request message for 144// [ScheduleService.GetSchedule][google.cloud.aiplatform.v1.ScheduleService.GetSchedule]. 145message GetScheduleRequest { 146 // Required. The name of the Schedule resource. 147 // Format: 148 // `projects/{project}/locations/{location}/schedules/{schedule}` 149 string name = 1 [ 150 (google.api.field_behavior) = REQUIRED, 151 (google.api.resource_reference) = { 152 type: "aiplatform.googleapis.com/Schedule" 153 } 154 ]; 155} 156 157// Request message for 158// [ScheduleService.ListSchedules][google.cloud.aiplatform.v1.ScheduleService.ListSchedules]. 159message ListSchedulesRequest { 160 // Required. The resource name of the Location to list the Schedules from. 161 // Format: `projects/{project}/locations/{location}` 162 string parent = 1 [ 163 (google.api.field_behavior) = REQUIRED, 164 (google.api.resource_reference) = { 165 type: "locations.googleapis.com/Location" 166 } 167 ]; 168 169 // Lists the Schedules that match the filter expression. The following 170 // fields are supported: 171 // 172 // * `display_name`: Supports `=`, `!=` comparisons, and `:` wildcard. 173 // * `state`: Supports `=` and `!=` comparisons. 174 // * `request`: Supports existence of the <request_type> check. 175 // (e.g. `create_pipeline_job_request:*` --> Schedule has 176 // create_pipeline_job_request). 177 // * `create_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. 178 // Values must be in RFC 3339 format. 179 // * `start_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` comparisons. 180 // Values must be in RFC 3339 format. 181 // * `end_time`: Supports `=`, `!=`, `<`, `>`, `<=`, `>=` comparisons and `:*` 182 // existence check. Values must be in RFC 3339 format. 183 // * `next_run_time`: Supports `=`, `!=`, `<`, `>`, `<=`, and `>=` 184 // comparisons. Values must be in RFC 3339 format. 185 // 186 // 187 // Filter expressions can be combined together using logical operators 188 // (`NOT`, `AND` & `OR`). 189 // The syntax to define filter expression is based on 190 // https://google.aip.dev/160. 191 // 192 // Examples: 193 // 194 // * `state="ACTIVE" AND display_name:"my_schedule_*"` 195 // * `NOT display_name="my_schedule"` 196 // * `create_time>"2021-05-18T00:00:00Z"` 197 // * `end_time>"2021-05-18T00:00:00Z" OR NOT end_time:*` 198 // * `create_pipeline_job_request:*` 199 string filter = 2; 200 201 // The standard list page size. 202 // Default to 100 if not specified. 203 int32 page_size = 3; 204 205 // The standard list page token. 206 // Typically obtained via 207 // [ListSchedulesResponse.next_page_token][google.cloud.aiplatform.v1.ListSchedulesResponse.next_page_token] 208 // of the previous 209 // [ScheduleService.ListSchedules][google.cloud.aiplatform.v1.ScheduleService.ListSchedules] 210 // call. 211 string page_token = 4; 212 213 // A comma-separated list of fields to order by. The default sort order is in 214 // ascending order. Use "desc" after a field name for descending. You can have 215 // multiple order_by fields provided. 216 // 217 // For example, using "create_time desc, end_time" will order results by 218 // create time in descending order, and if there are multiple schedules having 219 // the same create time, order them by the end time in ascending order. 220 // 221 // If order_by is not specified, it will order by default with create_time in 222 // descending order. 223 // 224 // Supported fields: 225 // 226 // * `create_time` 227 // * `start_time` 228 // * `end_time` 229 // * `next_run_time` 230 string order_by = 5; 231} 232 233// Response message for 234// [ScheduleService.ListSchedules][google.cloud.aiplatform.v1.ScheduleService.ListSchedules] 235message ListSchedulesResponse { 236 // List of Schedules in the requested page. 237 repeated Schedule schedules = 1; 238 239 // A token to retrieve the next page of results. 240 // Pass to 241 // [ListSchedulesRequest.page_token][google.cloud.aiplatform.v1.ListSchedulesRequest.page_token] 242 // to obtain that page. 243 string next_page_token = 2; 244} 245 246// Request message for 247// [ScheduleService.DeleteSchedule][google.cloud.aiplatform.v1.ScheduleService.DeleteSchedule]. 248message DeleteScheduleRequest { 249 // Required. The name of the Schedule resource to be deleted. 250 // Format: 251 // `projects/{project}/locations/{location}/schedules/{schedule}` 252 string name = 1 [ 253 (google.api.field_behavior) = REQUIRED, 254 (google.api.resource_reference) = { 255 type: "aiplatform.googleapis.com/Schedule" 256 } 257 ]; 258} 259 260// Request message for 261// [ScheduleService.PauseSchedule][google.cloud.aiplatform.v1.ScheduleService.PauseSchedule]. 262message PauseScheduleRequest { 263 // Required. The name of the Schedule resource to be paused. 264 // Format: 265 // `projects/{project}/locations/{location}/schedules/{schedule}` 266 string name = 1 [ 267 (google.api.field_behavior) = REQUIRED, 268 (google.api.resource_reference) = { 269 type: "aiplatform.googleapis.com/Schedule" 270 } 271 ]; 272} 273 274// Request message for 275// [ScheduleService.ResumeSchedule][google.cloud.aiplatform.v1.ScheduleService.ResumeSchedule]. 276message ResumeScheduleRequest { 277 // Required. The name of the Schedule resource to be resumed. 278 // Format: 279 // `projects/{project}/locations/{location}/schedules/{schedule}` 280 string name = 1 [ 281 (google.api.field_behavior) = REQUIRED, 282 (google.api.resource_reference) = { 283 type: "aiplatform.googleapis.com/Schedule" 284 } 285 ]; 286 287 // Optional. Whether to backfill missed runs when the schedule is resumed from 288 // PAUSED state. If set to true, all missed runs will be scheduled. New runs 289 // will be scheduled after the backfill is complete. This will also update 290 // [Schedule.catch_up][google.cloud.aiplatform.v1.Schedule.catch_up] field. 291 // Default to false. 292 bool catch_up = 2 [(google.api.field_behavior) = OPTIONAL]; 293} 294 295// Request message for 296// [ScheduleService.UpdateSchedule][google.cloud.aiplatform.v1.ScheduleService.UpdateSchedule]. 297message UpdateScheduleRequest { 298 // Required. The Schedule which replaces the resource on the server. 299 // The following restrictions will be applied: 300 // 301 // * The scheduled request type cannot be changed. 302 // * The non-empty fields cannot be unset. 303 // * The output_only fields will be ignored if specified. 304 Schedule schedule = 1 [(google.api.field_behavior) = REQUIRED]; 305 306 // Required. The update mask applies to the resource. See 307 // [google.protobuf.FieldMask][google.protobuf.FieldMask]. 308 google.protobuf.FieldMask update_mask = 2 309 [(google.api.field_behavior) = REQUIRED]; 310} 311