Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 675725e

Browse files
yoshi-automationtseaver
authored andcommitted
Add 'Task.http_request' and associated message type (via synth). (#7432)
1 parent 34f7732 commit 675725e

File tree

8 files changed

+434
-41
lines changed

8 files changed

+434
-41
lines changed

google/cloud/tasks_v2beta3/proto/cloudtasks.proto

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

google/cloud/tasks_v2beta3/proto/queue.proto

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC.
1+
// Copyright 2019 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.
@@ -92,6 +92,7 @@ message Queue {
9292
oneof queue_type {
9393
// [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] settings apply only to
9494
// [App Engine tasks][google.cloud.tasks.v2beta3.AppEngineHttpRequest] in this queue.
95+
// [Http tasks][google.cloud.tasks.v2beta3.HttpRequest] are not affected by this proto.
9596
AppEngineHttpQueue app_engine_http_queue = 3;
9697
}
9798

google/cloud/tasks_v2beta3/proto/queue_pb2.py

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

google/cloud/tasks_v2beta3/proto/target.proto

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2018 Google LLC.
1+
// Copyright 2019 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.
@@ -25,6 +25,91 @@ option java_outer_classname = "TargetProto";
2525
option java_package = "com.google.cloud.tasks.v2beta3";
2626

2727

28+
// HTTP request.
29+
//
30+
// Warning: This is an [alpha](https://cloud.google.com/terms/launch-stages)
31+
// feature. If you haven't already joined, you can [use this form to sign
32+
// up](https://docs.google.com/forms/d/e/1FAIpQLSfc4uEy9CBHKYUSdnY1hdhKDCX7julVZHy3imOiR-XrU7bUNQ/viewform?usp=sf_link).
33+
//
34+
// The task will be pushed to the worker as an HTTP request. If the worker
35+
// or the redirected worker acknowledges the task by returning a successful HTTP
36+
// response code ([`200` - `299`]), the task will removed from the queue. If
37+
// any other HTTP response code is returned or no response is received, the
38+
// task will be retried according to the following:
39+
//
40+
// * User-specified throttling: [retry configuration][Queue.RetryConfig],
41+
// [rate limits][Queue.RateLimits], and the [queue's state][google.cloud.tasks.v2beta3.Queue.state].
42+
//
43+
// * System throttling: To prevent the worker from overloading, Cloud Tasks may
44+
// temporarily reduce the queue's effective rate. User-specified settings
45+
// will not be changed.
46+
//
47+
// System throttling happens because:
48+
//
49+
// * Cloud Tasks backoffs on all errors. Normally the backoff specified in
50+
// [rate limits][Queue.RateLimits] will be used. But if the worker returns
51+
// `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
52+
// errors is high, Cloud Tasks will use a higher backoff rate. The retry
53+
// specified in the `Retry-After` HTTP response header is considered.
54+
//
55+
// * To prevent traffic spikes and to smooth sudden large traffic spikes,
56+
// dispatches ramp up slowly when the queue is newly created or idle and
57+
// if large numbers of tasks suddenly become available to dispatch (due to
58+
// spikes in create task rates, the queue being unpaused, or many tasks
59+
// that are scheduled at the same time).
60+
message HttpRequest {
61+
// Required. The full url path that the request will be sent to.
62+
//
63+
// This string must begin with either "http://" or "https://". Some examples
64+
// are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
65+
// encode some characters for safety and compatibility. The maximum allowed
66+
// URL length is 2083 characters after encoding.
67+
//
68+
// The `Location` header response from a redirect response [`300` - `399`]
69+
// may be followed. The redirect is not counted as a separate attempt.
70+
string url = 1;
71+
72+
// The HTTP method to use for the request. The default is POST.
73+
HttpMethod http_method = 2;
74+
75+
// HTTP request headers.
76+
//
77+
// This map contains the header field names and values.
78+
// Headers can be set when the
79+
// [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
80+
//
81+
// These headers represent a subset of the headers that will accompany the
82+
// task's HTTP request. Some HTTP request headers will be ignored or replaced.
83+
//
84+
// A partial list of headers that will be ignored or replaced is:
85+
//
86+
// * Host: This will be computed by Cloud Tasks and derived from
87+
// [HttpRequest.url][google.cloud.tasks.v2beta3.HttpRequest.url].
88+
// * Content-Length: This will be computed by Cloud Tasks.
89+
// * User-Agent: This will be set to `"Google-Cloud-Tasks"`.
90+
// * X-Google-*: Google use only.
91+
// * X-AppEngine-*: Google use only.
92+
//
93+
// `Content-Type` won't be set by Cloud Tasks. You can explicitly set
94+
// `Content-Type` to a media type when the
95+
// [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].
96+
// For example, `Content-Type` can be set to `"application/octet-stream"` or
97+
// `"application/json"`.
98+
//
99+
// Headers which can have multiple values (according to RFC2616) can be
100+
// specified using comma-separated values.
101+
//
102+
// The size of the headers must be less than 80KB.
103+
map<string, string> headers = 3;
104+
105+
// HTTP request body.
106+
//
107+
// A request body is allowed only if the
108+
// [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, PUT, or PATCH. It is an
109+
// error to set body on a task with an incompatible [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod].
110+
bytes body = 4;
111+
}
112+
28113
// App Engine HTTP queue.
29114
//
30115
// The task will be delivered to the App Engine application hostname

0 commit comments

Comments
 (0)