@@ -18,6 +18,8 @@ syntax = "proto3";
1818package google.cloud.scheduler.v1 ;
1919
2020import "google/api/annotations.proto" ;
21+ import "google/api/client.proto" ;
22+ import "google/api/field_behavior.proto" ;
2123import "google/api/resource.proto" ;
2224import "google/cloud/scheduler/v1/job.proto" ;
2325import "google/protobuf/empty.proto" ;
@@ -32,18 +34,23 @@ option objc_class_prefix = "SCHEDULER";
3234// The Cloud Scheduler API allows external entities to reliably
3335// schedule asynchronous jobs.
3436service CloudScheduler {
37+ option (google.api.default_host ) = "cloudscheduler.googleapis.com" ;
38+ option (google.api.oauth_scopes ) = "https://www.googleapis.com/auth/cloud-platform" ;
39+
3540 // Lists jobs.
3641 rpc ListJobs (ListJobsRequest ) returns (ListJobsResponse ) {
3742 option (google.api.http ) = {
3843 get : "/v1/{parent=projects/*/locations/*}/jobs"
3944 };
45+ option (google.api.method_signature ) = "parent" ;
4046 }
4147
4248 // Gets a job.
4349 rpc GetJob (GetJobRequest ) returns (Job ) {
4450 option (google.api.http ) = {
4551 get : "/v1/{name=projects/*/locations/*/jobs/*}"
4652 };
53+ option (google.api.method_signature ) = "name" ;
4754 }
4855
4956 // Creates a job.
@@ -52,6 +59,7 @@ service CloudScheduler {
5259 post : "/v1/{parent=projects/*/locations/*}/jobs"
5360 body : "job"
5461 };
62+ option (google.api.method_signature ) = "parent,job" ;
5563 }
5664
5765 // Updates a job.
@@ -68,13 +76,15 @@ service CloudScheduler {
6876 patch : "/v1/{job.name=projects/*/locations/*/jobs/*}"
6977 body : "job"
7078 };
79+ option (google.api.method_signature ) = "job,update_mask" ;
7180 }
7281
7382 // Deletes a job.
7483 rpc DeleteJob (DeleteJobRequest ) returns (google.protobuf.Empty ) {
7584 option (google.api.http ) = {
7685 delete : "/v1/{name=projects/*/locations/*/jobs/*}"
7786 };
87+ option (google.api.method_signature ) = "name" ;
7888 }
7989
8090 // Pauses a job.
@@ -89,6 +99,7 @@ service CloudScheduler {
8999 post : "/v1/{name=projects/*/locations/*/jobs/*}:pause"
90100 body : "*"
91101 };
102+ option (google.api.method_signature ) = "name" ;
92103 }
93104
94105 // Resume a job.
@@ -102,6 +113,7 @@ service CloudScheduler {
102113 post : "/v1/{name=projects/*/locations/*/jobs/*}:resume"
103114 body : "*"
104115 };
116+ option (google.api.method_signature ) = "name" ;
105117 }
106118
107119 // Forces a job to run now.
@@ -113,16 +125,20 @@ service CloudScheduler {
113125 post : "/v1/{name=projects/*/locations/*/jobs/*}:run"
114126 body : "*"
115127 };
128+ option (google.api.method_signature ) = "name" ;
116129 }
117130}
118131
119132// Request message for listing jobs using [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs].
120133message ListJobsRequest {
121- // Required.
122- //
123- // The location name. For example:
134+ // Required. The location name. For example:
124135 // `projects/PROJECT_ID/locations/LOCATION_ID`.
125- string parent = 1 ;
136+ string parent = 1 [
137+ (google.api.field_behavior ) = REQUIRED ,
138+ (google.api.resource_reference ) = {
139+ child_type : "locations.googleapis.com/Location"
140+ }
141+ ];
126142
127143 // Requested page size.
128144 //
@@ -159,79 +175,94 @@ message ListJobsResponse {
159175
160176// Request message for [GetJob][google.cloud.scheduler.v1.CloudScheduler.GetJob].
161177message GetJobRequest {
162- // Required.
163- //
164- // The job name. For example:
178+ // Required. The job name. For example:
165179 // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
166- string name = 1 ;
180+ string name = 1 [
181+ (google.api.field_behavior ) = REQUIRED ,
182+ (google.api.resource_reference ) = {
183+ type : "cloudscheduler.googleapis.com/Job"
184+ }
185+ ];
167186}
168187
169188// Request message for [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob].
170189message CreateJobRequest {
171- // Required.
172- //
173- // The location name. For example:
190+ // Required. The location name. For example:
174191 // `projects/PROJECT_ID/locations/LOCATION_ID`.
175- string parent = 1 ;
192+ string parent = 1 [
193+ (google.api.field_behavior ) = REQUIRED ,
194+ (google.api.resource_reference ) = {
195+ child_type : "locations.googleapis.com/Location"
196+ }
197+ ];
176198
177- // Required.
178- //
179- // The job to add. The user can optionally specify a name for the
199+ // Required. The job to add. The user can optionally specify a name for the
180200 // job in [name][google.cloud.scheduler.v1.Job.name]. [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an
181201 // existing job. If a name is not specified then the system will
182202 // generate a random unique name that will be returned
183203 // ([name][google.cloud.scheduler.v1.Job.name]) in the response.
184- Job job = 2 ;
204+ Job job = 2 [ (google.api .field_behavior ) = REQUIRED ] ;
185205}
186206
187207// Request message for [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob].
188208message UpdateJobRequest {
189- // Required.
190- //
191- // The new job properties. [name][google.cloud.scheduler.v1.Job.name] must be specified.
209+ // Required. The new job properties. [name][google.cloud.scheduler.v1.Job.name] must be specified.
192210 //
193211 // Output only fields cannot be modified using UpdateJob.
194212 // Any value specified for an output only field will be ignored.
195- Job job = 1 ;
213+ Job job = 1 [ (google.api .field_behavior ) = REQUIRED ] ;
196214
197215 // A mask used to specify which fields of the job are being updated.
198- google.protobuf.FieldMask update_mask = 2 ;
216+ google.protobuf.FieldMask update_mask = 2
217+ [(google.api.field_behavior ) = REQUIRED ];
199218}
200219
201220// Request message for deleting a job using
202221// [DeleteJob][google.cloud.scheduler.v1.CloudScheduler.DeleteJob].
203222message DeleteJobRequest {
204- // Required.
205- //
206- // The job name. For example:
223+ // Required. The job name. For example:
207224 // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
208- string name = 1 ;
225+ string name = 1 [
226+ (google.api.field_behavior ) = REQUIRED ,
227+ (google.api.resource_reference ) = {
228+ type : "cloudscheduler.googleapis.com/Job"
229+ }
230+ ];
209231}
210232
211233// Request message for [PauseJob][google.cloud.scheduler.v1.CloudScheduler.PauseJob].
212234message PauseJobRequest {
213- // Required.
214- //
215- // The job name. For example:
235+ // Required. The job name. For example:
216236 // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
217- string name = 1 ;
237+ string name = 1 [
238+ (google.api.field_behavior ) = REQUIRED ,
239+ (google.api.resource_reference ) = {
240+ type : "cloudscheduler.googleapis.com/Job"
241+ }
242+ ];
218243}
219244
220245// Request message for [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob].
221246message ResumeJobRequest {
222- // Required.
223- //
224- // The job name. For example:
247+ // Required. The job name. For example:
225248 // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
226- string name = 1 ;
249+ string name = 1 [
250+ (google.api.field_behavior ) = REQUIRED ,
251+ (google.api.resource_reference ) = {
252+ type : "cloudscheduler.googleapis.com/Job"
253+ }
254+ ];
227255}
228256
229257// Request message for forcing a job to run now using
230258// [RunJob][google.cloud.scheduler.v1.CloudScheduler.RunJob].
231259message RunJobRequest {
232- // Required.
233- //
234- // The job name. For example:
260+ // Required. The job name. For example:
235261 // `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
236- string name = 1 ;
262+ string name = 1 [
263+ (google.api.field_behavior ) = REQUIRED ,
264+ (google.api.resource_reference ) = {
265+ type : "cloudscheduler.googleapis.com/Job"
266+ }
267+ ];
237268}
0 commit comments