Skip to content

Commit 822476c

Browse files
Google APIscopybara-github
authored andcommitted
feat: Location API methods
docs: updated comments chore: proto formatting PiperOrigin-RevId: 513582719
1 parent a285b66 commit 822476c

7 files changed

Lines changed: 188 additions & 157 deletions

File tree

google/cloud/scheduler/v1/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ proto_library_with_info(
4343
deps = [
4444
":scheduler_proto",
4545
"//google/cloud:common_resources_proto",
46+
"//google/cloud/location:location_proto",
4647
],
4748
)
4849

@@ -77,12 +78,14 @@ java_gapic_library(
7778
rest_numeric_enums = True,
7879
service_yaml = "cloudscheduler_v1.yaml",
7980
test_deps = [
81+
"//google/cloud/location:location_java_grpc",
8082
":scheduler_java_grpc",
8183
],
8284
transport = "grpc+rest",
8385
deps = [
8486
":scheduler_java_proto",
8587
"//google/api:api_java_proto",
88+
"//google/cloud/location:location_java_proto",
8689
],
8790
)
8891

@@ -142,6 +145,7 @@ go_gapic_library(
142145
transport = "grpc+rest",
143146
deps = [
144147
":scheduler_go_proto",
148+
"//google/cloud/location:location_go_proto",
145149
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
146150
],
147151
)

google/cloud/scheduler/v1/cloudscheduler.proto

Lines changed: 54 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2022 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -11,7 +11,6 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14-
//
1514

1615
syntax = "proto3";
1716

@@ -35,7 +34,8 @@ option objc_class_prefix = "SCHEDULER";
3534
// schedule asynchronous jobs.
3635
service CloudScheduler {
3736
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";
3939

4040
// Lists jobs.
4141
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {
@@ -64,13 +64,14 @@ service CloudScheduler {
6464

6565
// Updates a job.
6666
//
67-
// If successful, the updated [Job][google.cloud.scheduler.v1.Job] is returned. If the job does
68-
// not exist, `NOT_FOUND` is returned.
67+
// If successful, the updated [Job][google.cloud.scheduler.v1.Job] is
68+
// returned. If the job does not exist, `NOT_FOUND` is returned.
6969
//
7070
// If UpdateJob does not successfully return, it is possible for the
71-
// job to be in an [Job.State.UPDATE_FAILED][google.cloud.scheduler.v1.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.v1.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.
7475
rpc UpdateJob(UpdateJobRequest) returns (Job) {
7576
option (google.api.http) = {
7677
patch: "/v1/{job.name=projects/*/locations/*/jobs/*}"
@@ -90,10 +91,13 @@ service CloudScheduler {
9091
// Pauses a job.
9192
//
9293
// If a job is paused then the system will stop executing the job
93-
// until it is re-enabled via [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The
94-
// state of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if paused it
95-
// will be set to [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]
96-
// to be paused.
94+
// until it is re-enabled via
95+
// [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob]. The state
96+
// of the job is stored in [state][google.cloud.scheduler.v1.Job.state]; if
97+
// paused it will be set to
98+
// [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. A job must
99+
// be in [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED] to
100+
// be paused.
97101
rpc PauseJob(PauseJobRequest) returns (Job) {
98102
option (google.api.http) = {
99103
post: "/v1/{name=projects/*/locations/*/jobs/*}:pause"
@@ -104,10 +108,13 @@ service CloudScheduler {
104108

105109
// Resume a job.
106110
//
107-
// This method reenables a job after it has been [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The
108-
// state of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state]; after calling this method it
109-
// will be set to [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job must be in
110-
// [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED] to be resumed.
111+
// This method reenables a job after it has been
112+
// [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]. The state
113+
// of a job is stored in [Job.state][google.cloud.scheduler.v1.Job.state];
114+
// after calling this method it will be set to
115+
// [Job.State.ENABLED][google.cloud.scheduler.v1.Job.State.ENABLED]. A job
116+
// must be in [Job.State.PAUSED][google.cloud.scheduler.v1.Job.State.PAUSED]
117+
// to be resumed.
111118
rpc ResumeJob(ResumeJobRequest) returns (Job) {
112119
option (google.api.http) = {
113120
post: "/v1/{name=projects/*/locations/*/jobs/*}:resume"
@@ -129,7 +136,8 @@ service CloudScheduler {
129136
}
130137
}
131138

132-
// Request message for listing jobs using [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs].
139+
// Request message for listing jobs using
140+
// [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs].
133141
message ListJobsRequest {
134142
// Required. The location name. For example:
135143
// `projects/PROJECT_ID/locations/LOCATION_ID`.
@@ -151,29 +159,35 @@ message ListJobsRequest {
151159
// A token identifying a page of results the server will return. To
152160
// request the first page results, page_token must be empty. To
153161
// request the next page of results, page_token must be the value of
154-
// [next_page_token][google.cloud.scheduler.v1.ListJobsResponse.next_page_token] returned from
155-
// the previous call to [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an error to
156-
// switch the value of [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or
157-
// [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while iterating through pages.
162+
// [next_page_token][google.cloud.scheduler.v1.ListJobsResponse.next_page_token]
163+
// returned from the previous call to
164+
// [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs]. It is an
165+
// error to switch the value of
166+
// [filter][google.cloud.scheduler.v1.ListJobsRequest.filter] or
167+
// [order_by][google.cloud.scheduler.v1.ListJobsRequest.order_by] while
168+
// iterating through pages.
158169
string page_token = 6;
159170
}
160171

161-
// Response message for listing jobs using [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs].
172+
// Response message for listing jobs using
173+
// [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs].
162174
message ListJobsResponse {
163175
// The list of jobs.
164176
repeated Job jobs = 1;
165177

166178
// A token to retrieve next page of results. Pass this value in the
167-
// [page_token][google.cloud.scheduler.v1.ListJobsRequest.page_token] field in the subsequent call to
168-
// [ListJobs][google.cloud.scheduler.v1.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.
179+
// [page_token][google.cloud.scheduler.v1.ListJobsRequest.page_token] field in
180+
// the subsequent call to
181+
// [ListJobs][google.cloud.scheduler.v1.CloudScheduler.ListJobs] to retrieve
182+
// the next page of results. If this is empty it indicates that there are no
183+
// more results through which to paginate.
171184
//
172185
// The page token is valid for only 2 hours.
173186
string next_page_token = 2;
174187
}
175188

176-
// Request message for [GetJob][google.cloud.scheduler.v1.CloudScheduler.GetJob].
189+
// Request message for
190+
// [GetJob][google.cloud.scheduler.v1.CloudScheduler.GetJob].
177191
message GetJobRequest {
178192
// Required. The job name. For example:
179193
// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
@@ -185,7 +199,8 @@ message GetJobRequest {
185199
];
186200
}
187201

188-
// Request message for [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob].
202+
// Request message for
203+
// [CreateJob][google.cloud.scheduler.v1.CloudScheduler.CreateJob].
189204
message CreateJobRequest {
190205
// Required. The location name. For example:
191206
// `projects/PROJECT_ID/locations/LOCATION_ID`.
@@ -197,24 +212,26 @@ message CreateJobRequest {
197212
];
198213

199214
// Required. The job to add. The user can optionally specify a name for the
200-
// job in [name][google.cloud.scheduler.v1.Job.name]. [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an
215+
// job in [name][google.cloud.scheduler.v1.Job.name].
216+
// [name][google.cloud.scheduler.v1.Job.name] cannot be the same as an
201217
// existing job. If a name is not specified then the system will
202218
// generate a random unique name that will be returned
203219
// ([name][google.cloud.scheduler.v1.Job.name]) in the response.
204220
Job job = 2 [(google.api.field_behavior) = REQUIRED];
205221
}
206222

207-
// Request message for [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob].
223+
// Request message for
224+
// [UpdateJob][google.cloud.scheduler.v1.CloudScheduler.UpdateJob].
208225
message UpdateJobRequest {
209-
// Required. The new job properties. [name][google.cloud.scheduler.v1.Job.name] must be specified.
226+
// Required. The new job properties.
227+
// [name][google.cloud.scheduler.v1.Job.name] must be specified.
210228
//
211229
// Output only fields cannot be modified using UpdateJob.
212230
// Any value specified for an output only field will be ignored.
213231
Job job = 1 [(google.api.field_behavior) = REQUIRED];
214232

215233
// A mask used to specify which fields of the job are being updated.
216-
google.protobuf.FieldMask update_mask = 2
217-
[(google.api.field_behavior) = REQUIRED];
234+
google.protobuf.FieldMask update_mask = 2;
218235
}
219236

220237
// Request message for deleting a job using
@@ -230,7 +247,8 @@ message DeleteJobRequest {
230247
];
231248
}
232249

233-
// Request message for [PauseJob][google.cloud.scheduler.v1.CloudScheduler.PauseJob].
250+
// Request message for
251+
// [PauseJob][google.cloud.scheduler.v1.CloudScheduler.PauseJob].
234252
message PauseJobRequest {
235253
// Required. The job name. For example:
236254
// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.
@@ -242,7 +260,8 @@ message PauseJobRequest {
242260
];
243261
}
244262

245-
// Request message for [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob].
263+
// Request message for
264+
// [ResumeJob][google.cloud.scheduler.v1.CloudScheduler.ResumeJob].
246265
message ResumeJobRequest {
247266
// Required. The job name. For example:
248267
// `projects/PROJECT_ID/locations/LOCATION_ID/jobs/JOB_ID`.

google/cloud/scheduler/v1/cloudscheduler_v1.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,44 @@ name: cloudscheduler.googleapis.com
44
title: Cloud Scheduler API
55

66
apis:
7+
- name: google.cloud.location.Locations
78
- name: google.cloud.scheduler.v1.CloudScheduler
89

910
documentation:
1011
summary: Creates and manages jobs run on a regular recurring schedule.
12+
rules:
13+
- selector: google.cloud.location.Locations.GetLocation
14+
description: Gets information about a location.
15+
16+
- selector: google.cloud.location.Locations.ListLocations
17+
description: Lists information about the supported locations for this service.
1118

1219
backend:
1320
rules:
21+
- selector: google.cloud.location.Locations.GetLocation
22+
deadline: 30.0
23+
- selector: google.cloud.location.Locations.ListLocations
24+
deadline: 30.0
1425
- selector: 'google.cloud.scheduler.v1.CloudScheduler.*'
1526
deadline: 30.0
1627

28+
http:
29+
rules:
30+
- selector: google.cloud.location.Locations.GetLocation
31+
get: '/v1/{name=projects/*/locations/*}'
32+
- selector: google.cloud.location.Locations.ListLocations
33+
get: '/v1/{name=projects/*}/locations'
34+
1735
authentication:
1836
rules:
37+
- selector: google.cloud.location.Locations.GetLocation
38+
oauth:
39+
canonical_scopes: |-
40+
https://www.googleapis.com/auth/cloud-platform
41+
- selector: google.cloud.location.Locations.ListLocations
42+
oauth:
43+
canonical_scopes: |-
44+
https://www.googleapis.com/auth/cloud-platform
1945
- selector: 'google.cloud.scheduler.v1.CloudScheduler.*'
2046
oauth:
2147
canonical_scopes: |-

0 commit comments

Comments
 (0)