Skip to content

Commit dcb6f87

Browse files
feat: [tasks] increase timeout of RPC methods to 20s for v2 (#4425)
* feat: increase timeout of RPC methods to 20s for v2 feat: add YAML config for GetLocation and ListLocation for v2 feat: add UploadQueueYaml, BufferTask RPC method for CloudTasks service for v2beta2 feat: set deadline for GetLocation, ListLocations and UploadQueueYaml RPCs for v2beta2 feat: add BufferTask RPC method for CloudTasks service for v2beta3 feat: add YAML config for GetLocation and ListLocations for v2beta3 PiperOrigin-RevId: 548738528 Source-Link: googleapis/googleapis@4d98ffc Source-Link: googleapis/googleapis-gen@183d6bc Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLXRhc2tzLy5Pd2xCb3QueWFtbCIsImgiOiIxODNkNmJjNGVlM2MxODkwYjFkMjRmOWRjODU1MDQxZjQ5N2Q1ZDViIn0= * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 90d9a44 commit dcb6f87

51 files changed

Lines changed: 18014 additions & 6351 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/google-cloud-tasks/README.md

Lines changed: 58 additions & 56 deletions
Large diffs are not rendered by default.

packages/google-cloud-tasks/protos/google/cloud/tasks/v2/cloudtasks.proto

Lines changed: 117 additions & 101 deletions
Large diffs are not rendered by default.

packages/google-cloud-tasks/protos/google/cloud/tasks/v2/queue.proto

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2023 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

@@ -152,7 +151,7 @@ message Queue {
152151

153152
// Output only. The state of the queue.
154153
//
155-
// `state` can only be changed by called
154+
// `state` can only be changed by calling
156155
// [PauseQueue][google.cloud.tasks.v2.CloudTasks.PauseQueue],
157156
// [ResumeQueue][google.cloud.tasks.v2.CloudTasks.ResumeQueue], or uploading
158157
// [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
@@ -336,7 +335,7 @@ message RetryConfig {
336335
// A task's retry interval starts at
337336
// [min_backoff][google.cloud.tasks.v2.RetryConfig.min_backoff], then doubles
338337
// `max_doublings` times, then increases linearly, and finally
339-
// retries retries at intervals of
338+
// retries at intervals of
340339
// [max_backoff][google.cloud.tasks.v2.RetryConfig.max_backoff] up to
341340
// [max_attempts][google.cloud.tasks.v2.RetryConfig.max_attempts] times.
342341
//

packages/google-cloud-tasks/protos/google/cloud/tasks/v2/target.proto

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2023 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

@@ -166,9 +165,10 @@ message HttpRequest {
166165
// or task-level:
167166
//
168167
// * If [app_engine_routing_override is set on the
169-
// queue][Queue.app_engine_routing_override], this value is used for all
170-
// tasks in the queue, no matter what the setting is for the [task-level
171-
// app_engine_routing][AppEngineHttpRequest.app_engine_routing].
168+
// queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this value
169+
// is used for all tasks in the queue, no matter what the setting is for the
170+
// [task-level
171+
// app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing].
172172
//
173173
//
174174
// The `url` that the task will be sent to is:
@@ -202,22 +202,20 @@ message AppEngineHttpRequest {
202202
// The HTTP method to use for the request. The default is POST.
203203
//
204204
// The app's request handler for the task's target URL must be able to handle
205-
// HTTP requests with this http_method, otherwise the task attempt will fail
206-
// with error code 405 (Method Not Allowed). See
207-
// [Writing a push task request
205+
// HTTP requests with this http_method, otherwise the task attempt fails with
206+
// error code 405 (Method Not Allowed). See [Writing a push task request
208207
// handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
209-
// and the documentation for the request handlers in the language your app is
210-
// written in e.g.
211-
// [Python Request
212-
// Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass).
208+
// and the App Engine documentation for your runtime on [How Requests are
209+
// Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
213210
HttpMethod http_method = 1;
214211

215212
// Task-level setting for App Engine routing.
216213
//
217214
// * If [app_engine_routing_override is set on the
218-
// queue][Queue.app_engine_routing_override], this value is used for all
219-
// tasks in the queue, no matter what the setting is for the [task-level
220-
// app_engine_routing][AppEngineHttpRequest.app_engine_routing].
215+
// queue][google.cloud.tasks.v2.Queue.app_engine_routing_override], this
216+
// value is used for all tasks in the queue, no matter what the setting is
217+
// for the [task-level
218+
// app_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing].
221219
AppEngineRouting app_engine_routing = 2;
222220

223221
// The relative URI.

packages/google-cloud-tasks/protos/google/cloud/tasks/v2/task.proto

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019 Google LLC.
1+
// Copyright 2023 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

@@ -118,8 +117,8 @@ message Task {
118117
// is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
119118
// task according to the [RetryConfig][google.cloud.tasks.v2.RetryConfig].
120119
//
121-
// Note that when the request is cancelled, Cloud Tasks will stop listing for
122-
// the response, but whether the worker stops processing depends on the
120+
// Note that when the request is cancelled, Cloud Tasks will stop listening
121+
// for the response, but whether the worker stops processing depends on the
123122
// worker. For example, if the worker is stuck, it may not react to cancelled
124123
// requests.
125124
//

packages/google-cloud-tasks/protos/google/cloud/tasks/v2beta2/cloudtasks.proto

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2023 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.
@@ -19,6 +19,7 @@ package google.cloud.tasks.v2beta2;
1919
import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
22+
import "google/api/httpbody.proto";
2223
import "google/api/resource.proto";
2324
import "google/cloud/tasks/v2beta2/queue.proto";
2425
import "google/cloud/tasks/v2beta2/task.proto";
@@ -34,6 +35,10 @@ option java_multiple_files = true;
3435
option java_outer_classname = "CloudTasksProto";
3536
option java_package = "com.google.cloud.tasks.v2beta2";
3637
option objc_class_prefix = "TASKS";
38+
option (google.api.resource_definition) = {
39+
type: "cloudtasks.googleapis.com/Location"
40+
pattern: "projects/{project}/locations/{location}"
41+
};
3742

3843
// Cloud Tasks allows developers to manage the execution of background
3944
// work in their applications.
@@ -176,6 +181,13 @@ service CloudTasks {
176181
option (google.api.method_signature) = "name";
177182
}
178183

184+
// Update queue list by uploading a queue.yaml file.
185+
//
186+
// The queue.yaml file is supplied in the request body as a YAML encoded
187+
// string. This method was added to support gcloud clients versions before
188+
// 322.0.0. New clients should use CreateQueue instead of this method.
189+
rpc UploadQueueYaml(UploadQueueYamlRequest) returns (google.protobuf.Empty) {}
190+
179191
// Gets the access control policy for a
180192
// [Queue][google.cloud.tasks.v2beta2.Queue]. Returns an empty policy if the
181193
// resource exists and does not have a policy set.
@@ -402,6 +414,25 @@ service CloudTasks {
402414
};
403415
option (google.api.method_signature) = "name";
404416
}
417+
418+
// Creates and buffers a new task without the need to explicitly define a Task
419+
// message. The queue must have [HTTP
420+
// target][google.cloud.tasks.v2beta2.HttpTarget]. To create the task with a
421+
// custom ID, use the following format and set TASK_ID to your desired ID:
422+
// projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer
423+
// To create the task with an automatically generated ID, use the following
424+
// format:
425+
// projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer.
426+
// Note: This feature is in its experimental stage. You must request access to
427+
// the API through the [Cloud Tasks BufferTask Experiment Signup
428+
// form](https://forms.gle/X8Zr5hiXH5tTGFqh8).
429+
rpc BufferTask(BufferTaskRequest) returns (BufferTaskResponse) {
430+
option (google.api.http) = {
431+
post: "/v2beta2/{queue=projects/*/locations/*/queues/*}/tasks/{task_id}:buffer"
432+
body: "*"
433+
};
434+
option (google.api.method_signature) = "queue,task_id,body";
435+
}
405436
}
406437

407438
// Request message for
@@ -591,6 +622,18 @@ message ResumeQueueRequest {
591622
];
592623
}
593624

625+
// Request message for
626+
// [UploadQueueYaml][google.cloud.tasks.v2beta2.CloudTasks.UploadQueueYaml].
627+
message UploadQueueYamlRequest {
628+
// Required. The App ID is supplied as an HTTP parameter. Unlike internal
629+
// usage of App ID, it does not include a region prefix. Rather, the App ID
630+
// represents the Project ID against which to make the request.
631+
string app_id = 1 [(google.api.field_behavior) = REQUIRED];
632+
633+
// The http body contains the queue.yaml file which used to update queue lists
634+
optional google.api.HttpBody http_body = 2;
635+
}
636+
594637
// Request message for listing tasks using
595638
// [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks].
596639
message ListTasksRequest {
@@ -716,10 +759,10 @@ message CreateTaskRequest {
716759
// that was deleted or completed recently then the call will fail
717760
// with [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS].
718761
// If the task's queue was created using Cloud Tasks, then another task with
719-
// the same name can't be created for ~1hour after the original task was
762+
// the same name can't be created for ~1 hour after the original task was
720763
// deleted or completed. If the task's queue was created using queue.yaml or
721764
// queue.xml, then another task with the same name can't be created
722-
// for ~9days after the original task was deleted or completed.
765+
// for ~9 days after the original task was deleted or completed.
723766
//
724767
// Because there is an extra lookup cost to identify duplicate task
725768
// names, these [CreateTask][google.cloud.tasks.v2beta2.CloudTasks.CreateTask]
@@ -985,3 +1028,36 @@ message RunTaskRequest {
9851028
// [Task][google.cloud.tasks.v2beta2.Task] resource.
9861029
Task.View response_view = 2;
9871030
}
1031+
1032+
// LINT.IfChange
1033+
// Request message for
1034+
// [BufferTask][google.cloud.tasks.v2beta2.CloudTasks.BufferTask].
1035+
message BufferTaskRequest {
1036+
// Required. The parent queue name. For example:
1037+
// projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
1038+
//
1039+
// The queue must already exist.
1040+
string queue = 1 [
1041+
(google.api.field_behavior) = REQUIRED,
1042+
(google.api.resource_reference) = {
1043+
child_type: "cloudtasks.googleapis.com/Task"
1044+
}
1045+
];
1046+
1047+
// Optional. Task ID for the task being created. If not provided, a random
1048+
// task ID is assigned to the task.
1049+
string task_id = 2 [(google.api.field_behavior) = OPTIONAL];
1050+
1051+
// Optional. Body of the HTTP request.
1052+
//
1053+
// The body can take any generic value. The value is written to the
1054+
// [HttpRequest][payload] of the [Task].
1055+
google.api.HttpBody body = 3 [(google.api.field_behavior) = OPTIONAL];
1056+
}
1057+
1058+
// Response message for
1059+
// [BufferTask][google.cloud.tasks.v2beta2.CloudTasks.BufferTask].
1060+
message BufferTaskResponse {
1061+
// The created task.
1062+
Task task = 1;
1063+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
15+
syntax = "proto3";
16+
17+
package google.cloud.tasks.v2beta2;
18+
19+
option go_package = "cloud.google.com/go/cloudtasks/apiv2beta2/cloudtaskspb;cloudtaskspb";
20+
option java_multiple_files = true;
21+
option java_outer_classname = "OldTargetProto";
22+
option java_package = "com.google.cloud.tasks.v2beta2";

packages/google-cloud-tasks/protos/google/cloud/tasks/v2beta2/queue.proto

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020 Google LLC
1+
// Copyright 2023 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.
@@ -119,6 +119,9 @@ message Queue {
119119
// A pull queue is a queue that has a
120120
// [PullTarget][google.cloud.tasks.v2beta2.PullTarget].
121121
PullTarget pull_target = 4;
122+
123+
// An http_target is used to override the target values for HTTP tasks.
124+
HttpTarget http_target = 17;
122125
}
123126

124127
// Rate limits for task dispatches.
@@ -154,7 +157,7 @@ message Queue {
154157

155158
// Output only. The state of the queue.
156159
//
157-
// `state` can only be changed by calling
160+
// `state` can only be changed by called
158161
// [PauseQueue][google.cloud.tasks.v2beta2.CloudTasks.PauseQueue],
159162
// [ResumeQueue][google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue], or
160163
// uploading

0 commit comments

Comments
 (0)