google-cloud-tasks 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/queue.rb +1 -0
- data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/target.rb +137 -0
- data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/task.rb +7 -0
- data/lib/google/cloud/tasks/v2/target_pb.rb +22 -0
- data/lib/google/cloud/tasks/v2/task_pb.rb +1 -0
- data/lib/google/cloud/tasks/version.rb +1 -1
- metadata +22 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eacc99a23370cde37eb0bf8342e880ade8aa922df00be3ff0e911c58cca92bf6
|
4
|
+
data.tar.gz: 18b46a6ab275c72c6178dcacb7f9f07fe50c43376db411698d1097c70ee97803
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a166a9c546aace51099763868add20f1b1f39db74bf976c694ca547c35f26f86ebeacfaa78da8724246601dfd01f85dbe75d0a7d0e9253794f4b5c6d0c8b2581
|
7
|
+
data.tar.gz: c75c88ea5fd1659bae29464357a5452a4a8138d27ae6163c6ffb8d280e59cf718cdc69d74b445d58dcfa1d4d43c56730444cf400505672e969105fd2672d5f88
|
@@ -47,6 +47,7 @@ module Google
|
|
47
47
|
# {Google::Cloud::Tasks::V2::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
|
48
48
|
# These settings apply only to
|
49
49
|
# {Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks} in this queue.
|
50
|
+
# {Google::Cloud::Tasks::V2::HttpRequest Http tasks} are not affected.
|
50
51
|
#
|
51
52
|
# If set, `app_engine_routing_override` is used for all
|
52
53
|
# {Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks} in the queue, no matter what the
|
@@ -17,6 +17,106 @@ module Google
|
|
17
17
|
module Cloud
|
18
18
|
module Tasks
|
19
19
|
module V2
|
20
|
+
# HTTP request.
|
21
|
+
#
|
22
|
+
# The task will be pushed to the worker as an HTTP request. If the worker
|
23
|
+
# or the redirected worker acknowledges the task by returning a successful HTTP
|
24
|
+
# response code ([`200` - `299`]), the task will removed from the queue. If
|
25
|
+
# any other HTTP response code is returned or no response is received, the
|
26
|
+
# task will be retried according to the following:
|
27
|
+
#
|
28
|
+
# * User-specified throttling: {Google::Cloud::Tasks::V2::Queue#retry_config retry configuration},
|
29
|
+
# {Google::Cloud::Tasks::V2::Queue#rate_limits rate limits}, and the {Google::Cloud::Tasks::V2::Queue#state queue's state}.
|
30
|
+
#
|
31
|
+
# * System throttling: To prevent the worker from overloading, Cloud Tasks may
|
32
|
+
# temporarily reduce the queue's effective rate. User-specified settings
|
33
|
+
# will not be changed.
|
34
|
+
#
|
35
|
+
# System throttling happens because:
|
36
|
+
#
|
37
|
+
# * Cloud Tasks backs off on all errors. Normally the backoff specified in
|
38
|
+
# {Google::Cloud::Tasks::V2::Queue#rate_limits rate limits} will be used. But if the worker returns
|
39
|
+
# `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
|
40
|
+
# errors is high, Cloud Tasks will use a higher backoff rate. The retry
|
41
|
+
# specified in the `Retry-After` HTTP response header is considered.
|
42
|
+
#
|
43
|
+
# * To prevent traffic spikes and to smooth sudden large traffic spikes,
|
44
|
+
# dispatches ramp up slowly when the queue is newly created or idle and
|
45
|
+
# if large numbers of tasks suddenly become available to dispatch (due to
|
46
|
+
# spikes in create task rates, the queue being unpaused, or many tasks
|
47
|
+
# that are scheduled at the same time).
|
48
|
+
# @!attribute [rw] url
|
49
|
+
# @return [String]
|
50
|
+
# Required. The full url path that the request will be sent to.
|
51
|
+
#
|
52
|
+
# This string must begin with either "http://" or "https://". Some examples
|
53
|
+
# are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
|
54
|
+
# encode some characters for safety and compatibility. The maximum allowed
|
55
|
+
# URL length is 2083 characters after encoding.
|
56
|
+
#
|
57
|
+
# The `Location` header response from a redirect response [`300` - `399`]
|
58
|
+
# may be followed. The redirect is not counted as a separate attempt.
|
59
|
+
# @!attribute [rw] http_method
|
60
|
+
# @return [Google::Cloud::Tasks::V2::HttpMethod]
|
61
|
+
# The HTTP method to use for the request. The default is POST.
|
62
|
+
# @!attribute [rw] headers
|
63
|
+
# @return [Hash{String => String}]
|
64
|
+
# HTTP request headers.
|
65
|
+
#
|
66
|
+
# This map contains the header field names and values.
|
67
|
+
# Headers can be set when the
|
68
|
+
# {Google::Cloud::Tasks::V2beta3::CloudTasks::CreateTask task is created}.
|
69
|
+
#
|
70
|
+
# These headers represent a subset of the headers that will accompany the
|
71
|
+
# task's HTTP request. Some HTTP request headers will be ignored or replaced.
|
72
|
+
#
|
73
|
+
# A partial list of headers that will be ignored or replaced is:
|
74
|
+
#
|
75
|
+
# * Host: This will be computed by Cloud Tasks and derived from
|
76
|
+
# {Google::Cloud::Tasks::V2::HttpRequest#url HttpRequest#url}.
|
77
|
+
# * Content-Length: This will be computed by Cloud Tasks.
|
78
|
+
# * User-Agent: This will be set to `"Google-Cloud-Tasks"`.
|
79
|
+
# * X-Google-*: Google use only.
|
80
|
+
# * X-AppEngine-*: Google use only.
|
81
|
+
#
|
82
|
+
# `Content-Type` won't be set by Cloud Tasks. You can explicitly set
|
83
|
+
# `Content-Type` to a media type when the
|
84
|
+
# {Google::Cloud::Tasks::V2beta3::CloudTasks::CreateTask task is created}.
|
85
|
+
# For example, `Content-Type` can be set to `"application/octet-stream"` or
|
86
|
+
# `"application/json"`.
|
87
|
+
#
|
88
|
+
# Headers which can have multiple values (according to RFC2616) can be
|
89
|
+
# specified using comma-separated values.
|
90
|
+
#
|
91
|
+
# The size of the headers must be less than 80KB.
|
92
|
+
# @!attribute [rw] body
|
93
|
+
# @return [String]
|
94
|
+
# HTTP request body.
|
95
|
+
#
|
96
|
+
# A request body is allowed only if the
|
97
|
+
# {Google::Cloud::Tasks::V2::HttpRequest#http_method HTTP method} is POST, PUT, or PATCH. It is an
|
98
|
+
# error to set body on a task with an incompatible {Google::Cloud::Tasks::V2::HttpMethod HttpMethod}.
|
99
|
+
# @!attribute [rw] oauth_token
|
100
|
+
# @return [Google::Cloud::Tasks::V2::OAuthToken]
|
101
|
+
# If specified, an
|
102
|
+
# [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
|
103
|
+
# will be generated and attached as an `Authorization` header in the HTTP
|
104
|
+
# request.
|
105
|
+
#
|
106
|
+
# This type of authorization should generally only be used when calling
|
107
|
+
# Google APIs hosted on *.googleapis.com.
|
108
|
+
# @!attribute [rw] oidc_token
|
109
|
+
# @return [Google::Cloud::Tasks::V2::OidcToken]
|
110
|
+
# If specified, an
|
111
|
+
# [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
|
112
|
+
# token will be generated and attached as an `Authorization` header in the
|
113
|
+
# HTTP request.
|
114
|
+
#
|
115
|
+
# This type of authorization can be used for many scenarios, including
|
116
|
+
# calling Cloud Run, or endpoints where you intend to validate the token
|
117
|
+
# yourself.
|
118
|
+
class HttpRequest; end
|
119
|
+
|
20
120
|
# App Engine HTTP request.
|
21
121
|
#
|
22
122
|
# The message defines the HTTP request that is sent to an App Engine app when
|
@@ -245,6 +345,43 @@ module Google
|
|
245
345
|
# Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
|
246
346
|
class AppEngineRouting; end
|
247
347
|
|
348
|
+
# Contains information needed for generating an
|
349
|
+
# [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
|
350
|
+
# This type of authorization should generally only be used when calling Google
|
351
|
+
# APIs hosted on *.googleapis.com.
|
352
|
+
# @!attribute [rw] service_account_email
|
353
|
+
# @return [String]
|
354
|
+
# [Service account email](https://cloud.google.com/iam/docs/service-accounts)
|
355
|
+
# to be used for generating OAuth token.
|
356
|
+
# The service account must be within the same project as the queue. The
|
357
|
+
# caller must have iam.serviceAccounts.actAs permission for the service
|
358
|
+
# account.
|
359
|
+
# @!attribute [rw] scope
|
360
|
+
# @return [String]
|
361
|
+
# OAuth scope to be used for generating OAuth access token.
|
362
|
+
# If not specified, "https://www.googleapis.com/auth/cloud-platform"
|
363
|
+
# will be used.
|
364
|
+
class OAuthToken; end
|
365
|
+
|
366
|
+
# Contains information needed for generating an
|
367
|
+
# [OpenID Connect
|
368
|
+
# token](https://developers.google.com/identity/protocols/OpenIDConnect).
|
369
|
+
# This type of authorization can be used for many scenarios, including
|
370
|
+
# calling Cloud Run, or endpoints where you intend to validate the token
|
371
|
+
# yourself.
|
372
|
+
# @!attribute [rw] service_account_email
|
373
|
+
# @return [String]
|
374
|
+
# [Service account email](https://cloud.google.com/iam/docs/service-accounts)
|
375
|
+
# to be used for generating OIDC token.
|
376
|
+
# The service account must be within the same project as the queue. The
|
377
|
+
# caller must have iam.serviceAccounts.actAs permission for the service
|
378
|
+
# account.
|
379
|
+
# @!attribute [rw] audience
|
380
|
+
# @return [String]
|
381
|
+
# Audience to be used when generating OIDC token. If not specified, the URI
|
382
|
+
# specified in target will be used.
|
383
|
+
class OidcToken; end
|
384
|
+
|
248
385
|
# The HTTP method used to deliver the task.
|
249
386
|
module HttpMethod
|
250
387
|
# HTTP method unspecified
|
@@ -45,6 +45,11 @@ module Google
|
|
45
45
|
# HTTP request that is sent to the App Engine app handler.
|
46
46
|
#
|
47
47
|
# An App Engine task is a task that has {Google::Cloud::Tasks::V2::AppEngineHttpRequest AppEngineHttpRequest} set.
|
48
|
+
# @!attribute [rw] http_request
|
49
|
+
# @return [Google::Cloud::Tasks::V2::HttpRequest]
|
50
|
+
# HTTP request that is sent to the worker.
|
51
|
+
#
|
52
|
+
# An HTTP task is a task that has {Google::Cloud::Tasks::V2::HttpRequest HttpRequest} set.
|
48
53
|
# @!attribute [rw] schedule_time
|
49
54
|
# @return [Google::Protobuf::Timestamp]
|
50
55
|
# The time when the task is scheduled to be attempted or retried.
|
@@ -69,6 +74,8 @@ module Google
|
|
69
74
|
#
|
70
75
|
# The default and maximum values depend on the type of request:
|
71
76
|
#
|
77
|
+
# * For {Google::Cloud::Tasks::V2::HttpRequest HTTP tasks}, the default is 10 minutes. The deadline
|
78
|
+
# must be in the interval [15 seconds, 30 minutes].
|
72
79
|
#
|
73
80
|
# * For {Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks}, 0 indicates that the
|
74
81
|
# request has the default deadline. The default deadline depends on the
|
@@ -4,8 +4,19 @@
|
|
4
4
|
|
5
5
|
require 'google/protobuf'
|
6
6
|
|
7
|
+
require 'google/api/field_behavior_pb'
|
7
8
|
require 'google/api/annotations_pb'
|
8
9
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
|
+
add_message "google.cloud.tasks.v2.HttpRequest" do
|
11
|
+
optional :url, :string, 1
|
12
|
+
optional :http_method, :enum, 2, "google.cloud.tasks.v2.HttpMethod"
|
13
|
+
map :headers, :string, :string, 3
|
14
|
+
optional :body, :bytes, 4
|
15
|
+
oneof :authorization_header do
|
16
|
+
optional :oauth_token, :message, 5, "google.cloud.tasks.v2.OAuthToken"
|
17
|
+
optional :oidc_token, :message, 6, "google.cloud.tasks.v2.OidcToken"
|
18
|
+
end
|
19
|
+
end
|
9
20
|
add_message "google.cloud.tasks.v2.AppEngineHttpRequest" do
|
10
21
|
optional :http_method, :enum, 1, "google.cloud.tasks.v2.HttpMethod"
|
11
22
|
optional :app_engine_routing, :message, 2, "google.cloud.tasks.v2.AppEngineRouting"
|
@@ -19,6 +30,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
19
30
|
optional :instance, :string, 3
|
20
31
|
optional :host, :string, 4
|
21
32
|
end
|
33
|
+
add_message "google.cloud.tasks.v2.OAuthToken" do
|
34
|
+
optional :service_account_email, :string, 1
|
35
|
+
optional :scope, :string, 2
|
36
|
+
end
|
37
|
+
add_message "google.cloud.tasks.v2.OidcToken" do
|
38
|
+
optional :service_account_email, :string, 1
|
39
|
+
optional :audience, :string, 2
|
40
|
+
end
|
22
41
|
add_enum "google.cloud.tasks.v2.HttpMethod" do
|
23
42
|
value :HTTP_METHOD_UNSPECIFIED, 0
|
24
43
|
value :POST, 1
|
@@ -35,8 +54,11 @@ module Google
|
|
35
54
|
module Cloud
|
36
55
|
module Tasks
|
37
56
|
module V2
|
57
|
+
HttpRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.HttpRequest").msgclass
|
38
58
|
AppEngineHttpRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.AppEngineHttpRequest").msgclass
|
39
59
|
AppEngineRouting = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.AppEngineRouting").msgclass
|
60
|
+
OAuthToken = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.OAuthToken").msgclass
|
61
|
+
OidcToken = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.OidcToken").msgclass
|
40
62
|
HttpMethod = Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.tasks.v2.HttpMethod").enummodule
|
41
63
|
end
|
42
64
|
end
|
@@ -22,6 +22,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
22
22
|
optional :view, :enum, 11, "google.cloud.tasks.v2.Task.View"
|
23
23
|
oneof :message_type do
|
24
24
|
optional :app_engine_http_request, :message, 2, "google.cloud.tasks.v2.AppEngineHttpRequest"
|
25
|
+
optional :http_request, :message, 3, "google.cloud.tasks.v2.HttpRequest"
|
25
26
|
end
|
26
27
|
end
|
27
28
|
add_enum "google.cloud.tasks.v2.Task.View" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-gax
|
@@ -44,6 +44,26 @@ dependencies:
|
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: '2.0'
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: googleapis-common-protos-types
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.0.4
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '2.0'
|
57
|
+
type: :runtime
|
58
|
+
prerelease: false
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 1.0.4
|
64
|
+
- - "<"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '2.0'
|
47
67
|
- !ruby/object:Gem::Dependency
|
48
68
|
name: grpc-google-iam-v1
|
49
69
|
requirement: !ruby/object:Gem::Requirement
|