1
- // Copyright 2019 Google LLC.
1
+ // Copyright 2022 Google LLC
2
2
//
3
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
4
// you may not use this file except in compliance with the License.
11
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
- //
15
14
16
15
syntax = "proto3" ;
17
16
@@ -35,7 +34,8 @@ option objc_class_prefix = "SCHEDULER";
35
34
// schedule asynchronous jobs.
36
35
service CloudScheduler {
37
36
option (google.api.default_host ) = "cloudscheduler.googleapis.com" ;
38
- option (google.api.oauth_scopes ) = "https://www.googleapis.com/auth/cloud-platform" ;
37
+ option (google.api.oauth_scopes ) =
38
+ "https://www.googleapis.com/auth/cloud-platform" ;
39
39
40
40
// Lists jobs.
41
41
rpc ListJobs (ListJobsRequest ) returns (ListJobsResponse ) {
@@ -64,13 +64,14 @@ service CloudScheduler {
64
64
65
65
// Updates a job.
66
66
//
67
- // If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is returned. If the job does
68
- // not exist, `NOT_FOUND` is returned.
67
+ // If successful, the updated [Job][google.cloud.scheduler.v1beta1.Job] is
68
+ // returned. If the job does not exist, `NOT_FOUND` is returned.
69
69
//
70
70
// If UpdateJob does not successfully return, it is possible for the
71
- // job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED] state. A job in this state may
72
- // not be executed. If this happens, retry the UpdateJob request
73
- // until a successful response is received.
71
+ // job to be in an
72
+ // [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1beta1.Job.State.UPDATE_FAILED]
73
+ // state. A job in this state may not be executed. If this happens, retry the
74
+ // UpdateJob request until a successful response is received.
74
75
rpc UpdateJob (UpdateJobRequest ) returns (Job ) {
75
76
option (google.api.http ) = {
76
77
patch : "/v1beta1/{job.name=projects/*/locations/*/jobs/*}"
@@ -90,10 +91,14 @@ service CloudScheduler {
90
91
// Pauses a job.
91
92
//
92
93
// If a job is paused then the system will stop executing the job
93
- // until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The
94
- // state of the job is stored in [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it
95
- // will be set to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]
96
- // to be paused.
94
+ // until it is re-enabled via
95
+ // [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob]. The
96
+ // state of the job is stored in
97
+ // [state][google.cloud.scheduler.v1beta1.Job.state]; if paused it will be set
98
+ // to [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. A
99
+ // job must be in
100
+ // [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED] to be
101
+ // paused.
97
102
rpc PauseJob (PauseJobRequest ) returns (Job ) {
98
103
option (google.api.http ) = {
99
104
post : "/v1beta1/{name=projects/*/locations/*/jobs/*}:pause"
@@ -104,10 +109,15 @@ service CloudScheduler {
104
109
105
110
// Resume a job.
106
111
//
107
- // This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The
108
- // state of a job is stored in [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this method it
109
- // will be set to [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A job must be in
110
- // [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be resumed.
112
+ // This method reenables a job after it has been
113
+ // [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED]. The
114
+ // state of a job is stored in
115
+ // [Job.state][google.cloud.scheduler.v1beta1.Job.state]; after calling this
116
+ // method it will be set to
117
+ // [Job.State.ENABLED][google.cloud.scheduler.v1beta1.Job.State.ENABLED]. A
118
+ // job must be in
119
+ // [Job.State.PAUSED][google.cloud.scheduler.v1beta1.Job.State.PAUSED] to be
120
+ // resumed.
111
121
rpc ResumeJob (ResumeJobRequest ) returns (Job ) {
112
122
option (google.api.http ) = {
113
123
post : "/v1beta1/{name=projects/*/locations/*/jobs/*}:resume"
@@ -129,7 +139,8 @@ service CloudScheduler {
129
139
}
130
140
}
131
141
132
- // Request message for listing jobs using [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
142
+ // Request message for listing jobs using
143
+ // [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
133
144
message ListJobsRequest {
134
145
// Required. The location name. For example:
135
146
// `projects/PROJECT_ID/locations/LOCATION_ID`.
@@ -140,6 +151,16 @@ message ListJobsRequest {
140
151
}
141
152
];
142
153
154
+ // `filter` can be used to specify a subset of jobs.
155
+ //
156
+ // If `filter` equals `target_config="HttpConfig"`, then the http
157
+ // target jobs are retrieved. If `filter` equals
158
+ // `target_config="PubSubConfig"`, then the Pub/Sub target jobs are
159
+ // retrieved. If `filter` equals `labels.foo=value1
160
+ // labels.foo=value2` then only jobs which are labeled with
161
+ // foo=value1 AND foo=value2 will be returned.
162
+ string filter = 4 ;
163
+
143
164
// Requested page size.
144
165
//
145
166
// The maximum page size is 500. If unspecified, the page size will
@@ -151,29 +172,40 @@ message ListJobsRequest {
151
172
// A token identifying a page of results the server will return. To
152
173
// request the first page results, page_token must be empty. To
153
174
// request the next page of results, page_token must be the value of
154
- // [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token] returned from
155
- // the previous call to [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is an error to
156
- // switch the value of [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or
157
- // [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while iterating through pages.
175
+ // [next_page_token][google.cloud.scheduler.v1beta1.ListJobsResponse.next_page_token]
176
+ // returned from the previous call to
177
+ // [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs]. It is
178
+ // an error to switch the value of
179
+ // [filter][google.cloud.scheduler.v1beta1.ListJobsRequest.filter] or
180
+ // [order_by][google.cloud.scheduler.v1beta1.ListJobsRequest.order_by] while
181
+ // iterating through pages.
158
182
string page_token = 6 ;
183
+
184
+ // This field is used to manage the legacy App Engine Cron jobs using the
185
+ // Cloud Scheduler API. If the field is set to true, the jobs in the __cron
186
+ // queue will be listed instead.
187
+ bool legacy_app_engine_cron = 7 ;
159
188
}
160
189
161
- // Response message for listing jobs using [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
190
+ // Response message for listing jobs using
191
+ // [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs].
162
192
message ListJobsResponse {
163
193
// The list of jobs.
164
194
repeated Job jobs = 1 ;
165
195
166
196
// A token to retrieve next page of results. Pass this value in the
167
- // [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token] field in the subsequent call to
168
- // [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to retrieve the next page of results.
169
- // If this is empty it indicates that there are no more results
170
- // through which to paginate.
197
+ // [page_token][google.cloud.scheduler.v1beta1.ListJobsRequest.page_token]
198
+ // field in the subsequent call to
199
+ // [ListJobs][google.cloud.scheduler.v1beta1.CloudScheduler.ListJobs] to
200
+ // retrieve the next page of results. If this is empty it indicates that there
201
+ // are no more results through which to paginate.
171
202
//
172
203
// The page token is valid for only 2 hours.
173
204
string next_page_token = 2 ;
174
205
}
175
206
176
- // Request message for [GetJob][google.cloud.scheduler.v1beta1.CloudScheduler.GetJob].
207
+ // Request message for
208
+ // [GetJob][google.cloud.scheduler.v1beta1.CloudScheduler.GetJob].
177
209
message GetJobRequest {
178
210
// Required. The job name. For example:
179
211
// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
@@ -185,7 +217,8 @@ message GetJobRequest {
185
217
];
186
218
}
187
219
188
- // Request message for [CreateJob][google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob].
220
+ // Request message for
221
+ // [CreateJob][google.cloud.scheduler.v1beta1.CloudScheduler.CreateJob].
189
222
message CreateJobRequest {
190
223
// Required. The location name. For example:
191
224
// `projects/PROJECT_ID/locations/LOCATION_ID`.
@@ -197,16 +230,19 @@ message CreateJobRequest {
197
230
];
198
231
199
232
// Required. The job to add. The user can optionally specify a name for the
200
- // job in [name][google.cloud.scheduler.v1beta1.Job.name]. [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
233
+ // job in [name][google.cloud.scheduler.v1beta1.Job.name].
234
+ // [name][google.cloud.scheduler.v1beta1.Job.name] cannot be the same as an
201
235
// existing job. If a name is not specified then the system will
202
236
// generate a random unique name that will be returned
203
237
// ([name][google.cloud.scheduler.v1beta1.Job.name]) in the response.
204
238
Job job = 2 [(google.api.field_behavior ) = REQUIRED ];
205
239
}
206
240
207
- // Request message for [UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob].
241
+ // Request message for
242
+ // [UpdateJob][google.cloud.scheduler.v1beta1.CloudScheduler.UpdateJob].
208
243
message UpdateJobRequest {
209
- // Required. The new job properties. [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
244
+ // Required. The new job properties.
245
+ // [name][google.cloud.scheduler.v1beta1.Job.name] must be specified.
210
246
//
211
247
// Output only fields cannot be modified using UpdateJob.
212
248
// Any value specified for an output only field will be ignored.
@@ -227,9 +263,15 @@ message DeleteJobRequest {
227
263
type : "cloudscheduler.googleapis.com/Job"
228
264
}
229
265
];
266
+
267
+ // This field is used to manage the legacy App Engine Cron jobs using the
268
+ // Cloud Scheduler API. If the field is set to true, the job in the __cron
269
+ // queue with the corresponding name will be deleted instead.
270
+ bool legacy_app_engine_cron = 2 ;
230
271
}
231
272
232
- // Request message for [PauseJob][google.cloud.scheduler.v1beta1.CloudScheduler.PauseJob].
273
+ // Request message for
274
+ // [PauseJob][google.cloud.scheduler.v1beta1.CloudScheduler.PauseJob].
233
275
message PauseJobRequest {
234
276
// Required. The job name. For example:
235
277
// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
@@ -241,7 +283,8 @@ message PauseJobRequest {
241
283
];
242
284
}
243
285
244
- // Request message for [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob].
286
+ // Request message for
287
+ // [ResumeJob][google.cloud.scheduler.v1beta1.CloudScheduler.ResumeJob].
245
288
message ResumeJobRequest {
246
289
// Required. The job name. For example:
247
290
// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
@@ -264,4 +307,9 @@ message RunJobRequest {
264
307
type : "cloudscheduler.googleapis.com/Job"
265
308
}
266
309
];
310
+
311
+ // This field is used to manage the legacy App Engine Cron jobs using the
312
+ // Cloud Scheduler API. If the field is set to true, the job in the __cron
313
+ // queue with the corresponding name will be forced to run instead.
314
+ bool legacy_app_engine_cron = 2 ;
267
315
}
0 commit comments