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