google-cloud-tasks 1.5.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -1
  3. data/AUTHENTICATION.md +51 -54
  4. data/LICENSE.md +203 -0
  5. data/MIGRATING.md +274 -0
  6. data/README.md +37 -24
  7. data/lib/{google/cloud/tasks/v2beta2/doc/google/protobuf/empty.rb → google-cloud-tasks.rb} +4 -14
  8. data/lib/google/cloud/tasks.rb +82 -117
  9. data/lib/google/cloud/tasks/version.rb +6 -2
  10. metadata +104 -113
  11. data/LICENSE +0 -201
  12. data/lib/google/cloud/tasks/v2.rb +0 -147
  13. data/lib/google/cloud/tasks/v2/cloud_tasks_client.rb +0 -1233
  14. data/lib/google/cloud/tasks/v2/cloud_tasks_client_config.json +0 -106
  15. data/lib/google/cloud/tasks/v2/cloudtasks_pb.rb +0 -100
  16. data/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb +0 -203
  17. data/lib/google/cloud/tasks/v2/credentials.rb +0 -41
  18. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/cloudtasks.rb +0 -312
  19. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/queue.rb +0 -348
  20. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/target.rb +0 -414
  21. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/task.rb +0 -175
  22. data/lib/google/cloud/tasks/v2/doc/google/iam/v1/iam_policy.rb +0 -64
  23. data/lib/google/cloud/tasks/v2/doc/google/iam/v1/options.rb +0 -33
  24. data/lib/google/cloud/tasks/v2/doc/google/iam/v1/policy.rb +0 -151
  25. data/lib/google/cloud/tasks/v2/doc/google/protobuf/any.rb +0 -131
  26. data/lib/google/cloud/tasks/v2/doc/google/protobuf/duration.rb +0 -91
  27. data/lib/google/cloud/tasks/v2/doc/google/protobuf/empty.rb +0 -29
  28. data/lib/google/cloud/tasks/v2/doc/google/protobuf/field_mask.rb +0 -222
  29. data/lib/google/cloud/tasks/v2/doc/google/protobuf/timestamp.rb +0 -113
  30. data/lib/google/cloud/tasks/v2/doc/google/rpc/status.rb +0 -39
  31. data/lib/google/cloud/tasks/v2/doc/google/type/expr.rb +0 -45
  32. data/lib/google/cloud/tasks/v2/helpers.rb +0 -49
  33. data/lib/google/cloud/tasks/v2/queue_pb.rb +0 -56
  34. data/lib/google/cloud/tasks/v2/target_pb.rb +0 -66
  35. data/lib/google/cloud/tasks/v2/task_pb.rb +0 -51
  36. data/lib/google/cloud/tasks/v2beta2.rb +0 -147
  37. data/lib/google/cloud/tasks/v2beta2/cloud_tasks_client.rb +0 -1605
  38. data/lib/google/cloud/tasks/v2beta2/cloud_tasks_client_config.json +0 -126
  39. data/lib/google/cloud/tasks/v2beta2/cloudtasks_pb.rb +0 -133
  40. data/lib/google/cloud/tasks/v2beta2/cloudtasks_services_pb.rb +0 -258
  41. data/lib/google/cloud/tasks/v2beta2/credentials.rb +0 -41
  42. data/lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/cloudtasks.rb +0 -483
  43. data/lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/queue.rb +0 -336
  44. data/lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/target.rb +0 -377
  45. data/lib/google/cloud/tasks/v2beta2/doc/google/cloud/tasks/v2beta2/task.rb +0 -166
  46. data/lib/google/cloud/tasks/v2beta2/doc/google/iam/v1/iam_policy.rb +0 -64
  47. data/lib/google/cloud/tasks/v2beta2/doc/google/iam/v1/options.rb +0 -33
  48. data/lib/google/cloud/tasks/v2beta2/doc/google/iam/v1/policy.rb +0 -151
  49. data/lib/google/cloud/tasks/v2beta2/doc/google/protobuf/any.rb +0 -131
  50. data/lib/google/cloud/tasks/v2beta2/doc/google/protobuf/duration.rb +0 -91
  51. data/lib/google/cloud/tasks/v2beta2/doc/google/protobuf/field_mask.rb +0 -222
  52. data/lib/google/cloud/tasks/v2beta2/doc/google/protobuf/timestamp.rb +0 -113
  53. data/lib/google/cloud/tasks/v2beta2/doc/google/rpc/status.rb +0 -39
  54. data/lib/google/cloud/tasks/v2beta2/doc/google/type/expr.rb +0 -45
  55. data/lib/google/cloud/tasks/v2beta2/helpers.rb +0 -49
  56. data/lib/google/cloud/tasks/v2beta2/queue_pb.rb +0 -58
  57. data/lib/google/cloud/tasks/v2beta2/target_pb.rb +0 -54
  58. data/lib/google/cloud/tasks/v2beta2/task_pb.rb +0 -54
  59. data/lib/google/cloud/tasks/v2beta3.rb +0 -147
  60. data/lib/google/cloud/tasks/v2beta3/cloud_tasks_client.rb +0 -1233
  61. data/lib/google/cloud/tasks/v2beta3/cloud_tasks_client_config.json +0 -106
  62. data/lib/google/cloud/tasks/v2beta3/cloudtasks_pb.rb +0 -101
  63. data/lib/google/cloud/tasks/v2beta3/cloudtasks_services_pb.rb +0 -203
  64. data/lib/google/cloud/tasks/v2beta3/credentials.rb +0 -41
  65. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/cloudtasks.rb +0 -312
  66. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/queue.rb +0 -342
  67. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/target.rb +0 -431
  68. data/lib/google/cloud/tasks/v2beta3/doc/google/cloud/tasks/v2beta3/task.rb +0 -177
  69. data/lib/google/cloud/tasks/v2beta3/doc/google/iam/v1/iam_policy.rb +0 -64
  70. data/lib/google/cloud/tasks/v2beta3/doc/google/iam/v1/options.rb +0 -33
  71. data/lib/google/cloud/tasks/v2beta3/doc/google/iam/v1/policy.rb +0 -151
  72. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/any.rb +0 -131
  73. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/duration.rb +0 -91
  74. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/empty.rb +0 -29
  75. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/field_mask.rb +0 -222
  76. data/lib/google/cloud/tasks/v2beta3/doc/google/protobuf/timestamp.rb +0 -113
  77. data/lib/google/cloud/tasks/v2beta3/doc/google/rpc/status.rb +0 -39
  78. data/lib/google/cloud/tasks/v2beta3/doc/google/type/expr.rb +0 -45
  79. data/lib/google/cloud/tasks/v2beta3/helpers.rb +0 -49
  80. data/lib/google/cloud/tasks/v2beta3/queue_pb.rb +0 -59
  81. data/lib/google/cloud/tasks/v2beta3/target_pb.rb +0 -69
  82. data/lib/google/cloud/tasks/v2beta3/task_pb.rb +0 -52
@@ -1,336 +0,0 @@
1
- # Copyright 2020 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
- # https://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
-
16
- module Google
17
- module Cloud
18
- module Tasks
19
- module V2beta2
20
- # A queue is a container of related tasks. Queues are configured to manage
21
- # how those tasks are dispatched. Configurable properties include rate limits,
22
- # retry options, target types, and others.
23
- # @!attribute [rw] name
24
- # @return [String]
25
- # Caller-specified and required in {Google::Cloud::Tasks::V2beta2::CloudTasks::CreateQueue CreateQueue},
26
- # after which it becomes output only.
27
- #
28
- # The queue name.
29
- #
30
- # The queue name must have the following format:
31
- # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
32
- #
33
- # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
34
- # hyphens (-), colons (:), or periods (.).
35
- # For more information, see
36
- # [Identifying
37
- # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
38
- # * `LOCATION_ID` is the canonical ID for the queue's location.
39
- # The list of available locations can be obtained by calling
40
- # {Google::Cloud::Location::Locations::ListLocations ListLocations}.
41
- # For more information, see https://cloud.google.com/about/locations/.
42
- # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
43
- # hyphens (-). The maximum length is 100 characters.
44
- # @!attribute [rw] app_engine_http_target
45
- # @return [Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget]
46
- # App Engine HTTP target.
47
- #
48
- # An App Engine queue is a queue that has an {Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget}.
49
- # @!attribute [rw] pull_target
50
- # @return [Google::Cloud::Tasks::V2beta2::PullTarget]
51
- # Pull target.
52
- #
53
- # A pull queue is a queue that has a {Google::Cloud::Tasks::V2beta2::PullTarget PullTarget}.
54
- # @!attribute [rw] rate_limits
55
- # @return [Google::Cloud::Tasks::V2beta2::RateLimits]
56
- # Rate limits for task dispatches.
57
- #
58
- # {Google::Cloud::Tasks::V2beta2::Queue#rate_limits rate_limits} and
59
- # {Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} are related because they both
60
- # control task attempts however they control how tasks are
61
- # attempted in different ways:
62
- #
63
- # * {Google::Cloud::Tasks::V2beta2::Queue#rate_limits rate_limits} controls the total rate of
64
- # dispatches from a queue (i.e. all traffic dispatched from the
65
- # queue, regardless of whether the dispatch is from a first
66
- # attempt or a retry).
67
- # * {Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} controls what happens to
68
- # particular a task after its first attempt fails. That is,
69
- # {Google::Cloud::Tasks::V2beta2::Queue#retry_config retry_config} controls task retries (the
70
- # second attempt, third attempt, etc).
71
- # @!attribute [rw] retry_config
72
- # @return [Google::Cloud::Tasks::V2beta2::RetryConfig]
73
- # Settings that determine the retry behavior.
74
- #
75
- # * For tasks created using Cloud Tasks: the queue-level retry settings
76
- # apply to all tasks in the queue that were created using Cloud Tasks.
77
- # Retry settings cannot be set on individual tasks.
78
- # * For tasks created using the App Engine SDK: the queue-level retry
79
- # settings apply to all tasks in the queue which do not have retry settings
80
- # explicitly set on the task and were created by the App Engine SDK. See
81
- # [App Engine
82
- # documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
83
- # @!attribute [rw] state
84
- # @return [Google::Cloud::Tasks::V2beta2::Queue::State]
85
- # Output only. The state of the queue.
86
- #
87
- # `state` can only be changed by called
88
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::PauseQueue PauseQueue},
89
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::ResumeQueue ResumeQueue}, or uploading
90
- # [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
91
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::UpdateQueue UpdateQueue} cannot be used to change `state`.
92
- # @!attribute [rw] purge_time
93
- # @return [Google::Protobuf::Timestamp]
94
- # Output only. The last time this queue was purged.
95
- #
96
- # All tasks that were {Google::Cloud::Tasks::V2beta2::Task#create_time created} before this time
97
- # were purged.
98
- #
99
- # A queue can be purged using {Google::Cloud::Tasks::V2beta2::CloudTasks::PurgeQueue PurgeQueue}, the
100
- # [App Engine Task Queue SDK, or the Cloud
101
- # Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
102
- #
103
- # Purge time will be truncated to the nearest microsecond. Purge
104
- # time will be unset if the queue has never been purged.
105
- class Queue
106
- # State of the queue.
107
- module State
108
- # Unspecified state.
109
- STATE_UNSPECIFIED = 0
110
-
111
- # The queue is running. Tasks can be dispatched.
112
- #
113
- # If the queue was created using Cloud Tasks and the queue has
114
- # had no activity (method calls or task dispatches) for 30 days,
115
- # the queue may take a few minutes to re-activate. Some method
116
- # calls may return {Google::Rpc::Code::NOT_FOUND NOT_FOUND} and
117
- # tasks may not be dispatched for a few minutes until the queue
118
- # has been re-activated.
119
- RUNNING = 1
120
-
121
- # Tasks are paused by the user. If the queue is paused then Cloud
122
- # Tasks will stop delivering tasks from it, but more tasks can
123
- # still be added to it by the user. When a pull queue is paused,
124
- # all {Google::Cloud::Tasks::V2beta2::CloudTasks::LeaseTasks LeaseTasks} calls will return a
125
- # {Google::Rpc::Code::FAILED_PRECONDITION FAILED_PRECONDITION}.
126
- PAUSED = 2
127
-
128
- # The queue is disabled.
129
- #
130
- # A queue becomes `DISABLED` when
131
- # [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref)
132
- # or
133
- # [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref)
134
- # is uploaded which does not contain the queue. You cannot directly disable
135
- # a queue.
136
- #
137
- # When a queue is disabled, tasks can still be added to a queue
138
- # but the tasks are not dispatched and
139
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::LeaseTasks LeaseTasks} calls return a
140
- # `FAILED_PRECONDITION` error.
141
- #
142
- # To permanently delete this queue and all of its tasks, call
143
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::DeleteQueue DeleteQueue}.
144
- DISABLED = 3
145
- end
146
- end
147
-
148
- # Rate limits.
149
- #
150
- # This message determines the maximum rate that tasks can be dispatched by a
151
- # queue, regardless of whether the dispatch is a first task attempt or a retry.
152
- #
153
- # Note: The debugging command, {Google::Cloud::Tasks::V2beta2::CloudTasks::RunTask RunTask}, will run a task
154
- # even if the queue has reached its {Google::Cloud::Tasks::V2beta2::RateLimits RateLimits}.
155
- # @!attribute [rw] max_tasks_dispatched_per_second
156
- # @return [Float]
157
- # The maximum rate at which tasks are dispatched from this queue.
158
- #
159
- # If unspecified when the queue is created, Cloud Tasks will pick the
160
- # default.
161
- #
162
- # * For {Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget App Engine queues}, the maximum allowed value
163
- # is 500.
164
- # * This field is output only for {Google::Cloud::Tasks::V2beta2::PullTarget pull queues}. In addition to the
165
- # `max_tasks_dispatched_per_second` limit, a maximum of 10 QPS of
166
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::LeaseTasks LeaseTasks} requests are allowed per pull queue.
167
- #
168
- #
169
- # This field has the same meaning as
170
- # [rate in
171
- # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
172
- # @!attribute [rw] max_burst_size
173
- # @return [Integer]
174
- # Output only. The max burst size.
175
- #
176
- # Max burst size limits how fast tasks in queue are processed when
177
- # many tasks are in the queue and the rate is high. This field
178
- # allows the queue to have a high rate so processing starts shortly
179
- # after a task is enqueued, but still limits resource usage when
180
- # many tasks are enqueued in a short period of time.
181
- #
182
- # The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
183
- # algorithm is used to control the rate of task dispatches. Each
184
- # queue has a token bucket that holds tokens, up to the maximum
185
- # specified by `max_burst_size`. Each time a task is dispatched, a
186
- # token is removed from the bucket. Tasks will be dispatched until
187
- # the queue's bucket runs out of tokens. The bucket will be
188
- # continuously refilled with new tokens based on
189
- # {Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second}.
190
- #
191
- # Cloud Tasks will pick the value of `max_burst_size` based on the
192
- # value of
193
- # {Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second}.
194
- #
195
- # For App Engine queues that were created or updated using
196
- # `queue.yaml/xml`, `max_burst_size` is equal to
197
- # [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
198
- # Since `max_burst_size` is output only, if
199
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::UpdateQueue UpdateQueue} is called on a queue
200
- # created by `queue.yaml/xml`, `max_burst_size` will be reset based
201
- # on the value of
202
- # {Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second},
203
- # regardless of whether
204
- # {Google::Cloud::Tasks::V2beta2::RateLimits#max_tasks_dispatched_per_second max_tasks_dispatched_per_second}
205
- # is updated.
206
- # @!attribute [rw] max_concurrent_tasks
207
- # @return [Integer]
208
- # The maximum number of concurrent tasks that Cloud Tasks allows
209
- # to be dispatched for this queue. After this threshold has been
210
- # reached, Cloud Tasks stops dispatching tasks until the number of
211
- # concurrent requests decreases.
212
- #
213
- # If unspecified when the queue is created, Cloud Tasks will pick the
214
- # default.
215
- #
216
- #
217
- # The maximum allowed value is 5,000.
218
- #
219
- # This field is output only for
220
- # {Google::Cloud::Tasks::V2beta2::PullTarget pull queues} and always -1, which indicates no limit. No other
221
- # queue types can have `max_concurrent_tasks` set to -1.
222
- #
223
- #
224
- # This field has the same meaning as
225
- # [max_concurrent_requests in
226
- # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
227
- class RateLimits; end
228
-
229
- # Retry config.
230
- #
231
- # These settings determine how a failed task attempt is retried.
232
- # @!attribute [rw] max_attempts
233
- # @return [Integer]
234
- # The maximum number of attempts for a task.
235
- #
236
- # Cloud Tasks will attempt the task `max_attempts` times (that
237
- # is, if the first attempt fails, then there will be
238
- # `max_attempts - 1` retries). Must be > 0.
239
- # @!attribute [rw] unlimited_attempts
240
- # @return [true, false]
241
- # If true, then the number of attempts is unlimited.
242
- # @!attribute [rw] max_retry_duration
243
- # @return [Google::Protobuf::Duration]
244
- # If positive, `max_retry_duration` specifies the time limit for
245
- # retrying a failed task, measured from when the task was first
246
- # attempted. Once `max_retry_duration` time has passed *and* the
247
- # task has been attempted {Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts}
248
- # times, no further attempts will be made and the task will be
249
- # deleted.
250
- #
251
- # If zero, then the task age is unlimited.
252
- #
253
- # If unspecified when the queue is created, Cloud Tasks will pick the
254
- # default.
255
- #
256
- # This field is output only for {Google::Cloud::Tasks::V2beta2::PullTarget pull queues}.
257
- #
258
- #
259
- # `max_retry_duration` will be truncated to the nearest second.
260
- #
261
- # This field has the same meaning as
262
- # [task_age_limit in
263
- # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
264
- # @!attribute [rw] min_backoff
265
- # @return [Google::Protobuf::Duration]
266
- # A task will be {Google::Cloud::Tasks::V2beta2::Task#schedule_time scheduled} for retry between
267
- # {Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} and
268
- # {Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} duration after it fails,
269
- # if the queue's {Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig} specifies that the task should be
270
- # retried.
271
- #
272
- # If unspecified when the queue is created, Cloud Tasks will pick the
273
- # default.
274
- #
275
- # This field is output only for {Google::Cloud::Tasks::V2beta2::PullTarget pull queues}.
276
- #
277
- #
278
- # `min_backoff` will be truncated to the nearest second.
279
- #
280
- # This field has the same meaning as
281
- # [min_backoff_seconds in
282
- # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
283
- # @!attribute [rw] max_backoff
284
- # @return [Google::Protobuf::Duration]
285
- # A task will be {Google::Cloud::Tasks::V2beta2::Task#schedule_time scheduled} for retry between
286
- # {Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} and
287
- # {Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} duration after it fails,
288
- # if the queue's {Google::Cloud::Tasks::V2beta2::RetryConfig RetryConfig} specifies that the task should be
289
- # retried.
290
- #
291
- # If unspecified when the queue is created, Cloud Tasks will pick the
292
- # default.
293
- #
294
- # This field is output only for {Google::Cloud::Tasks::V2beta2::PullTarget pull queues}.
295
- #
296
- #
297
- # `max_backoff` will be truncated to the nearest second.
298
- #
299
- # This field has the same meaning as
300
- # [max_backoff_seconds in
301
- # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
302
- # @!attribute [rw] max_doublings
303
- # @return [Integer]
304
- # The time between retries will double `max_doublings` times.
305
- #
306
- # A task's retry interval starts at
307
- # {Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff}, then doubles
308
- # `max_doublings` times, then increases linearly, and finally
309
- # retries retries at intervals of
310
- # {Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} up to
311
- # {Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts} times.
312
- #
313
- # For example, if {Google::Cloud::Tasks::V2beta2::RetryConfig#min_backoff min_backoff} is 10s,
314
- # {Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} is 300s, and
315
- # `max_doublings` is 3, then the a task will first be retried in
316
- # 10s. The retry interval will double three times, and then
317
- # increase linearly by 2^3 * 10s. Finally, the task will retry at
318
- # intervals of {Google::Cloud::Tasks::V2beta2::RetryConfig#max_backoff max_backoff} until the
319
- # task has been attempted {Google::Cloud::Tasks::V2beta2::RetryConfig#max_attempts max_attempts}
320
- # times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s,
321
- # 240s, 300s, 300s, ....
322
- #
323
- # If unspecified when the queue is created, Cloud Tasks will pick the
324
- # default.
325
- #
326
- # This field is output only for {Google::Cloud::Tasks::V2beta2::PullTarget pull queues}.
327
- #
328
- #
329
- # This field has the same meaning as
330
- # [max_doublings in
331
- # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
332
- class RetryConfig; end
333
- end
334
- end
335
- end
336
- end
@@ -1,377 +0,0 @@
1
- # Copyright 2020 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
- # https://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
-
16
- module Google
17
- module Cloud
18
- module Tasks
19
- module V2beta2
20
- # Pull target.
21
- class PullTarget; end
22
-
23
- # The pull message contains data that can be used by the caller of
24
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::LeaseTasks LeaseTasks} to process the task.
25
- #
26
- # This proto can only be used for tasks in a queue which has
27
- # {Google::Cloud::Tasks::V2beta2::Queue#pull_target pull_target} set.
28
- # @!attribute [rw] payload
29
- # @return [String]
30
- # A data payload consumed by the worker to execute the task.
31
- # @!attribute [rw] tag
32
- # @return [String]
33
- # The task's tag.
34
- #
35
- # Tags allow similar tasks to be processed in a batch. If you label
36
- # tasks with a tag, your worker can
37
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::LeaseTasks lease tasks} with the same tag using
38
- # {Google::Cloud::Tasks::V2beta2::LeaseTasksRequest#filter filter}. For example, if you want to
39
- # aggregate the events associated with a specific user once a day,
40
- # you could tag tasks with the user ID.
41
- #
42
- # The task's tag can only be set when the
43
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::CreateTask task is created}.
44
- #
45
- # The tag must be less than 500 characters.
46
- #
47
- # SDK compatibility: Although the SDK allows tags to be either
48
- # string or
49
- # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
50
- # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
51
- # encoded, the tag will be empty when the task is returned by Cloud Tasks.
52
- class PullMessage; end
53
-
54
- # App Engine HTTP target.
55
- #
56
- # The task will be delivered to the App Engine application hostname
57
- # specified by its {Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget} and {Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest}.
58
- # The documentation for {Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest} explains how the
59
- # task's host URL is constructed.
60
- #
61
- # Using {Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget AppEngineHttpTarget} requires
62
- # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
63
- # Google IAM permission for the project
64
- # and the following scope:
65
- #
66
- # `https://www.googleapis.com/auth/cloud-platform`
67
- # @!attribute [rw] app_engine_routing_override
68
- # @return [Google::Cloud::Tasks::V2beta2::AppEngineRouting]
69
- # Overrides for the
70
- # {Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
71
- #
72
- # If set, `app_engine_routing_override` is used for all tasks in
73
- # the queue, no matter what the setting is for the
74
- # {Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
75
- class AppEngineHttpTarget; end
76
-
77
- # App Engine HTTP request.
78
- #
79
- # The message defines the HTTP request that is sent to an App Engine app when
80
- # the task is dispatched.
81
- #
82
- # This proto can only be used for tasks in a queue which has
83
- # {Google::Cloud::Tasks::V2beta2::Queue#app_engine_http_target app_engine_http_target} set.
84
- #
85
- # Using {Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest AppEngineHttpRequest} requires
86
- # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
87
- # Google IAM permission for the project
88
- # and the following scope:
89
- #
90
- # `https://www.googleapis.com/auth/cloud-platform`
91
- #
92
- # The task will be delivered to the App Engine app which belongs to the same
93
- # project as the queue. For more information, see
94
- # [How Requests are
95
- # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
96
- # and how routing is affected by
97
- # [dispatch
98
- # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
99
- # Traffic is encrypted during transport and never leaves Google datacenters.
100
- # Because this traffic is carried over a communication mechanism internal to
101
- # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
102
- # The request to the handler, however, will appear to have used the HTTP
103
- # protocol.
104
- #
105
- # The {Google::Cloud::Tasks::V2beta2::AppEngineRouting AppEngineRouting} used to construct the URL that the task is
106
- # delivered to can be set at the queue-level or task-level:
107
- #
108
- # * If set,
109
- # {Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget#app_engine_routing_override app_engine_routing_override}
110
- # is used for all tasks in the queue, no matter what the setting
111
- # is for the
112
- # {Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
113
- #
114
- #
115
- # The `url` that the task will be sent to is:
116
- #
117
- # * `url =` {Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} `+`
118
- # {Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#relative_url relative_url}
119
- #
120
- # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
121
- # URIs restricted with
122
- # [`login:
123
- # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
124
- # Because tasks are not run as any user, they cannot be dispatched to URIs
125
- # restricted with
126
- # [`login:
127
- # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
128
- # Task dispatches also do not follow redirects.
129
- #
130
- # The task attempt has succeeded if the app's request handler returns an HTTP
131
- # response code in the range [`200` - `299`]. The task attempt has failed if
132
- # the app's handler returns a non-2xx response code or Cloud Tasks does
133
- # not receive response before the {Task#dispatch_deadline deadline}. Failed
134
- # tasks will be retried according to the
135
- # {Google::Cloud::Tasks::V2beta2::Queue#retry_config retry configuration}. `503` (Service Unavailable) is
136
- # considered an App Engine system error instead of an application error and
137
- # will cause Cloud Tasks' traffic congestion control to temporarily throttle
138
- # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
139
- # Requests) response from an app handler does not cause traffic congestion
140
- # control to throttle the queue.
141
- # @!attribute [rw] http_method
142
- # @return [Google::Cloud::Tasks::V2beta2::HttpMethod]
143
- # The HTTP method to use for the request. The default is POST.
144
- #
145
- # The app's request handler for the task's target URL must be able to handle
146
- # HTTP requests with this http_method, otherwise the task attempt will fail
147
- # with error code 405 (Method Not Allowed). See
148
- # [Writing a push task request
149
- # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
150
- # and the documentation for the request handlers in the language your app is
151
- # written in e.g.
152
- # [Python Request
153
- # Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass).
154
- # @!attribute [rw] app_engine_routing
155
- # @return [Google::Cloud::Tasks::V2beta2::AppEngineRouting]
156
- # Task-level setting for App Engine routing.
157
- #
158
- # If set,
159
- # {Google::Cloud::Tasks::V2beta2::AppEngineHttpTarget#app_engine_routing_override app_engine_routing_override}
160
- # is used for all tasks in the queue, no matter what the setting is for the
161
- # {Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
162
- # @!attribute [rw] relative_url
163
- # @return [String]
164
- # The relative URL.
165
- #
166
- # The relative URL must begin with "/" and must be a valid HTTP relative URL.
167
- # It can contain a path and query string arguments.
168
- # If the relative URL is empty, then the root path "/" will be used.
169
- # No spaces are allowed, and the maximum length allowed is 2083 characters.
170
- # @!attribute [rw] headers
171
- # @return [Hash{String => String}]
172
- # HTTP request headers.
173
- #
174
- # This map contains the header field names and values.
175
- # Headers can be set when the
176
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::CreateTask task is created}.
177
- # Repeated headers are not supported but a header value can contain commas.
178
- #
179
- # Cloud Tasks sets some headers to default values:
180
- #
181
- # * `User-Agent`: By default, this header is
182
- # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
183
- # This header can be modified, but Cloud Tasks will append
184
- # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
185
- # modified `User-Agent`.
186
- #
187
- # If the task has a {Google::Cloud::Tasks::V2beta2::AppEngineHttpRequest#payload payload}, Cloud
188
- # Tasks sets the following headers:
189
- #
190
- # * `Content-Type`: By default, the `Content-Type` header is set to
191
- # `"application/octet-stream"`. The default can be overridden by explicitly
192
- # setting `Content-Type` to a particular media type when the
193
- # {Google::Cloud::Tasks::V2beta2::CloudTasks::CreateTask task is created}.
194
- # For example, `Content-Type` can be set to `"application/json"`.
195
- # * `Content-Length`: This is computed by Cloud Tasks. This value is
196
- # output only. It cannot be changed.
197
- #
198
- # The headers below cannot be set or overridden:
199
- #
200
- # * `Host`
201
- # * `X-Google-*`
202
- # * `X-AppEngine-*`
203
- #
204
- # In addition, Cloud Tasks sets some headers when the task is dispatched,
205
- # such as headers containing information about the task; see
206
- # [request
207
- # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
208
- # These headers are set only when the task is dispatched, so they are not
209
- # visible when the task is returned in a Cloud Tasks response.
210
- #
211
- # Although there is no specific limit for the maximum number of headers or
212
- # the size, there is a limit on the maximum size of the {Google::Cloud::Tasks::V2beta2::Task Task}. For more
213
- # information, see the {Google::Cloud::Tasks::V2beta2::CloudTasks::CreateTask CreateTask} documentation.
214
- # @!attribute [rw] payload
215
- # @return [String]
216
- # Payload.
217
- #
218
- # The payload will be sent as the HTTP message body. A message
219
- # body, and thus a payload, is allowed only if the HTTP method is
220
- # POST or PUT. It is an error to set a data payload on a task with
221
- # an incompatible {Google::Cloud::Tasks::V2beta2::HttpMethod HttpMethod}.
222
- class AppEngineHttpRequest; end
223
-
224
- # App Engine Routing.
225
- #
226
- # Defines routing characteristics specific to App Engine - service, version,
227
- # and instance.
228
- #
229
- # For more information about services, versions, and instances see
230
- # [An Overview of App
231
- # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
232
- # [Microservices Architecture on Google App
233
- # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
234
- # [App Engine Standard request
235
- # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
236
- # and [App Engine Flex request
237
- # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
238
- # @!attribute [rw] service
239
- # @return [String]
240
- # App service.
241
- #
242
- # By default, the task is sent to the service which is the default
243
- # service when the task is attempted.
244
- #
245
- # For some queues or tasks which were created using the App Engine
246
- # Task Queue API, {Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable
247
- # into {Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service},
248
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and
249
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance}. For example, some tasks
250
- # which were created using the App Engine SDK use a custom domain
251
- # name; custom domains are not parsed by Cloud Tasks. If
252
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable, then
253
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service},
254
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and
255
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} are the empty string.
256
- # @!attribute [rw] version
257
- # @return [String]
258
- # App version.
259
- #
260
- # By default, the task is sent to the version which is the default
261
- # version when the task is attempted.
262
- #
263
- # For some queues or tasks which were created using the App Engine
264
- # Task Queue API, {Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable
265
- # into {Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service},
266
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and
267
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance}. For example, some tasks
268
- # which were created using the App Engine SDK use a custom domain
269
- # name; custom domains are not parsed by Cloud Tasks. If
270
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#host host} is not parsable, then
271
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service},
272
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, and
273
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} are the empty string.
274
- # @!attribute [rw] instance
275
- # @return [String]
276
- # App instance.
277
- #
278
- # By default, the task is sent to an instance which is available when
279
- # the task is attempted.
280
- #
281
- # Requests can only be sent to a specific instance if
282
- # [manual scaling is used in App Engine
283
- # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
284
- # App Engine Flex does not support instances. For more information, see
285
- # [App Engine Standard request
286
- # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
287
- # and [App Engine Flex request
288
- # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
289
- # @!attribute [rw] host
290
- # @return [String]
291
- # Output only. The host that the task is sent to.
292
- #
293
- # For more information, see
294
- # [How Requests are
295
- # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
296
- #
297
- # The host is constructed as:
298
- #
299
- #
300
- # * `host = [application_domain_name]`</br>
301
- # `| [service] + '.' + [application_domain_name]`</br>
302
- # `| [version] + '.' + [application_domain_name]`</br>
303
- # `| [version_dot_service]+ '.' + [application_domain_name]`</br>
304
- # `| [instance] + '.' + [application_domain_name]`</br>
305
- # `| [instance_dot_service] + '.' + [application_domain_name]`</br>
306
- # `| [instance_dot_version] + '.' + [application_domain_name]`</br>
307
- # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
308
- #
309
- # * `application_domain_name` = The domain name of the app, for
310
- # example <app-id>.appspot.com, which is associated with the
311
- # queue's project ID. Some tasks which were created using the App Engine
312
- # SDK use a custom domain name.
313
- #
314
- # * `service =` {Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}
315
- #
316
- # * `version =` {Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}
317
- #
318
- # * `version_dot_service =`
319
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} `+ '.' +`
320
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}
321
- #
322
- # * `instance =` {Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance}
323
- #
324
- # * `instance_dot_service =`
325
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' +`
326
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}
327
- #
328
- # * `instance_dot_version =`
329
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' +`
330
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}
331
- #
332
- # * `instance_dot_version_dot_service =`
333
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} `+ '.' +`
334
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} `+ '.' +`
335
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service}
336
- #
337
- # If {Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service} is empty, then the task will be sent
338
- # to the service which is the default service when the task is attempted.
339
- #
340
- # If {Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version} is empty, then the task will be sent
341
- # to the version which is the default version when the task is attempted.
342
- #
343
- # If {Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} is empty, then the task
344
- # will be sent to an instance which is available when the task is
345
- # attempted.
346
- #
347
- # If {Google::Cloud::Tasks::V2beta2::AppEngineRouting#service service},
348
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#version version}, or
349
- # {Google::Cloud::Tasks::V2beta2::AppEngineRouting#instance instance} is invalid, then the task
350
- # will be sent to the default version of the default service when
351
- # the task is attempted.
352
- class AppEngineRouting; end
353
-
354
- # The HTTP method used to execute the task.
355
- module HttpMethod
356
- # HTTP method unspecified
357
- HTTP_METHOD_UNSPECIFIED = 0
358
-
359
- # HTTP POST
360
- POST = 1
361
-
362
- # HTTP GET
363
- GET = 2
364
-
365
- # HTTP HEAD
366
- HEAD = 3
367
-
368
- # HTTP PUT
369
- PUT = 4
370
-
371
- # HTTP DELETE
372
- DELETE = 5
373
- end
374
- end
375
- end
376
- end
377
- end