google-cloud-tasks 0.5.0 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (26) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/google/cloud/tasks/v2/cloud_tasks_client.rb +1254 -0
  4. data/lib/google/cloud/tasks/v2/cloud_tasks_client_config.json +106 -0
  5. data/lib/google/cloud/tasks/v2/cloudtasks_pb.rb +99 -0
  6. data/lib/google/cloud/tasks/v2/cloudtasks_services_pb.rb +200 -0
  7. data/lib/google/cloud/tasks/v2/credentials.rb +41 -0
  8. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/cloudtasks.rb +340 -0
  9. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/queue.rb +333 -0
  10. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/target.rb +270 -0
  11. data/lib/google/cloud/tasks/v2/doc/google/cloud/tasks/v2/task.rb +170 -0
  12. data/lib/google/cloud/tasks/v2/doc/google/iam/v1/iam_policy.rb +63 -0
  13. data/lib/google/cloud/tasks/v2/doc/google/iam/v1/policy.rb +104 -0
  14. data/lib/google/cloud/tasks/v2/doc/google/protobuf/any.rb +130 -0
  15. data/lib/google/cloud/tasks/v2/doc/google/protobuf/duration.rb +91 -0
  16. data/lib/google/cloud/tasks/v2/doc/google/protobuf/empty.rb +29 -0
  17. data/lib/google/cloud/tasks/v2/doc/google/protobuf/field_mask.rb +230 -0
  18. data/lib/google/cloud/tasks/v2/doc/google/protobuf/timestamp.rb +109 -0
  19. data/lib/google/cloud/tasks/v2/doc/google/rpc/status.rb +87 -0
  20. data/lib/google/cloud/tasks/v2/helpers.rb +56 -0
  21. data/lib/google/cloud/tasks/v2/queue_pb.rb +51 -0
  22. data/lib/google/cloud/tasks/v2/target_pb.rb +44 -0
  23. data/lib/google/cloud/tasks/v2/task_pb.rb +50 -0
  24. data/lib/google/cloud/tasks/v2.rb +139 -0
  25. data/lib/google/cloud/tasks.rb +2 -2
  26. metadata +24 -2
@@ -0,0 +1,340 @@
1
+ # Copyright 2019 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 V2
20
+ # Request message for {Google::Cloud::Tasks::V2::CloudTasks::ListQueues ListQueues}.
21
+ # @!attribute [rw] parent
22
+ # @return [String]
23
+ # Required.
24
+ #
25
+ # The location name.
26
+ # For example: `projects/PROJECT_ID/locations/LOCATION_ID`
27
+ # @!attribute [rw] filter
28
+ # @return [String]
29
+ # `filter` can be used to specify a subset of queues. Any {Google::Cloud::Tasks::V2::Queue Queue}
30
+ # field can be used as a filter and several operators as supported.
31
+ # For example: `<=, <, >=, >, !=, =, :`. The filter syntax is the same as
32
+ # described in
33
+ # [Stackdriver's Advanced Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
34
+ #
35
+ # Sample filter "state: PAUSED".
36
+ #
37
+ # Note that using filters might cause fewer queues than the
38
+ # requested page_size to be returned.
39
+ # @!attribute [rw] page_size
40
+ # @return [Integer]
41
+ # Requested page size.
42
+ #
43
+ # The maximum page size is 9800. If unspecified, the page size will
44
+ # be the maximum. Fewer queues than requested might be returned,
45
+ # even if more queues exist; use the
46
+ # {Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} in the
47
+ # response to determine if more queues exist.
48
+ # @!attribute [rw] page_token
49
+ # @return [String]
50
+ # A token identifying the page of results to return.
51
+ #
52
+ # To request the first page results, page_token must be empty. To
53
+ # request the next page of results, page_token must be the value of
54
+ # {Google::Cloud::Tasks::V2::ListQueuesResponse#next_page_token next_page_token} returned
55
+ # from the previous call to {Google::Cloud::Tasks::V2::CloudTasks::ListQueues ListQueues}
56
+ # method. It is an error to switch the value of the
57
+ # {Google::Cloud::Tasks::V2::ListQueuesRequest#filter filter} while iterating through pages.
58
+ class ListQueuesRequest; end
59
+
60
+ # Response message for {Google::Cloud::Tasks::V2::CloudTasks::ListQueues ListQueues}.
61
+ # @!attribute [rw] queues
62
+ # @return [Array<Google::Cloud::Tasks::V2::Queue>]
63
+ # The list of queues.
64
+ # @!attribute [rw] next_page_token
65
+ # @return [String]
66
+ # A token to retrieve next page of results.
67
+ #
68
+ # To return the next page of results, call
69
+ # {Google::Cloud::Tasks::V2::CloudTasks::ListQueues ListQueues} with this value as the
70
+ # {Google::Cloud::Tasks::V2::ListQueuesRequest#page_token page_token}.
71
+ #
72
+ # If the next_page_token is empty, there are no more results.
73
+ #
74
+ # The page token is valid for only 2 hours.
75
+ class ListQueuesResponse; end
76
+
77
+ # Request message for {Google::Cloud::Tasks::V2::CloudTasks::GetQueue GetQueue}.
78
+ # @!attribute [rw] name
79
+ # @return [String]
80
+ # Required.
81
+ #
82
+ # The resource name of the queue. For example:
83
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
84
+ class GetQueueRequest; end
85
+
86
+ # Request message for {Google::Cloud::Tasks::V2::CloudTasks::CreateQueue CreateQueue}.
87
+ # @!attribute [rw] parent
88
+ # @return [String]
89
+ # Required.
90
+ #
91
+ # The location name in which the queue will be created.
92
+ # For example: `projects/PROJECT_ID/locations/LOCATION_ID`
93
+ #
94
+ # The list of allowed locations can be obtained by calling Cloud
95
+ # Tasks' implementation of
96
+ # {Google::Cloud::Location::Locations::ListLocations ListLocations}.
97
+ # @!attribute [rw] queue
98
+ # @return [Google::Cloud::Tasks::V2::Queue]
99
+ # Required.
100
+ #
101
+ # The queue to create.
102
+ #
103
+ # {Google::Cloud::Tasks::V2::Queue#name Queue's name} cannot be the same as an existing queue.
104
+ class CreateQueueRequest; end
105
+
106
+ # Request message for {Google::Cloud::Tasks::V2::CloudTasks::UpdateQueue UpdateQueue}.
107
+ # @!attribute [rw] queue
108
+ # @return [Google::Cloud::Tasks::V2::Queue]
109
+ # Required.
110
+ #
111
+ # The queue to create or update.
112
+ #
113
+ # The queue's {Google::Cloud::Tasks::V2::Queue#name name} must be specified.
114
+ #
115
+ # Output only fields cannot be modified using UpdateQueue.
116
+ # Any value specified for an output only field will be ignored.
117
+ # The queue's {Google::Cloud::Tasks::V2::Queue#name name} cannot be changed.
118
+ # @!attribute [rw] update_mask
119
+ # @return [Google::Protobuf::FieldMask]
120
+ # A mask used to specify which fields of the queue are being updated.
121
+ #
122
+ # If empty, then all fields will be updated.
123
+ class UpdateQueueRequest; end
124
+
125
+ # Request message for {Google::Cloud::Tasks::V2::CloudTasks::DeleteQueue DeleteQueue}.
126
+ # @!attribute [rw] name
127
+ # @return [String]
128
+ # Required.
129
+ #
130
+ # The queue name. For example:
131
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
132
+ class DeleteQueueRequest; end
133
+
134
+ # Request message for {Google::Cloud::Tasks::V2::CloudTasks::PurgeQueue PurgeQueue}.
135
+ # @!attribute [rw] name
136
+ # @return [String]
137
+ # Required.
138
+ #
139
+ # The queue name. For example:
140
+ # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
141
+ class PurgeQueueRequest; end
142
+
143
+ # Request message for {Google::Cloud::Tasks::V2::CloudTasks::PauseQueue PauseQueue}.
144
+ # @!attribute [rw] name
145
+ # @return [String]
146
+ # Required.
147
+ #
148
+ # The queue name. For example:
149
+ # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
150
+ class PauseQueueRequest; end
151
+
152
+ # Request message for {Google::Cloud::Tasks::V2::CloudTasks::ResumeQueue ResumeQueue}.
153
+ # @!attribute [rw] name
154
+ # @return [String]
155
+ # Required.
156
+ #
157
+ # The queue name. For example:
158
+ # `projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`
159
+ class ResumeQueueRequest; end
160
+
161
+ # Request message for listing tasks using {Google::Cloud::Tasks::V2::CloudTasks::ListTasks ListTasks}.
162
+ # @!attribute [rw] parent
163
+ # @return [String]
164
+ # Required.
165
+ #
166
+ # The queue name. For example:
167
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
168
+ # @!attribute [rw] response_view
169
+ # @return [Google::Cloud::Tasks::V2::Task::View]
170
+ # The response_view specifies which subset of the {Google::Cloud::Tasks::V2::Task Task} will be
171
+ # returned.
172
+ #
173
+ # By default response_view is {Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; not all
174
+ # information is retrieved by default because some data, such as
175
+ # payloads, might be desirable to return only when needed because
176
+ # of its large size or because of the sensitivity of data that it
177
+ # contains.
178
+ #
179
+ # Authorization for {Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires
180
+ # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
181
+ # permission on the {Google::Cloud::Tasks::V2::Task Task} resource.
182
+ # @!attribute [rw] page_size
183
+ # @return [Integer]
184
+ # Requested page size. Fewer tasks than requested might be returned.
185
+ #
186
+ # The maximum page size is 1000. If unspecified, the page size will
187
+ # be the maximum. Fewer tasks than requested might be returned,
188
+ # even if more tasks exist; use
189
+ # {Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} in the
190
+ # response to determine if more tasks exist.
191
+ # @!attribute [rw] page_token
192
+ # @return [String]
193
+ # A token identifying the page of results to return.
194
+ #
195
+ # To request the first page results, page_token must be empty. To
196
+ # request the next page of results, page_token must be the value of
197
+ # {Google::Cloud::Tasks::V2::ListTasksResponse#next_page_token next_page_token} returned
198
+ # from the previous call to {Google::Cloud::Tasks::V2::CloudTasks::ListTasks ListTasks}
199
+ # method.
200
+ #
201
+ # The page token is valid for only 2 hours.
202
+ class ListTasksRequest; end
203
+
204
+ # Response message for listing tasks using {Google::Cloud::Tasks::V2::CloudTasks::ListTasks ListTasks}.
205
+ # @!attribute [rw] tasks
206
+ # @return [Array<Google::Cloud::Tasks::V2::Task>]
207
+ # The list of tasks.
208
+ # @!attribute [rw] next_page_token
209
+ # @return [String]
210
+ # A token to retrieve next page of results.
211
+ #
212
+ # To return the next page of results, call
213
+ # {Google::Cloud::Tasks::V2::CloudTasks::ListTasks ListTasks} with this value as the
214
+ # {Google::Cloud::Tasks::V2::ListTasksRequest#page_token page_token}.
215
+ #
216
+ # If the next_page_token is empty, there are no more results.
217
+ class ListTasksResponse; end
218
+
219
+ # Request message for getting a task using {Google::Cloud::Tasks::V2::CloudTasks::GetTask GetTask}.
220
+ # @!attribute [rw] name
221
+ # @return [String]
222
+ # Required.
223
+ #
224
+ # The task name. For example:
225
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
226
+ # @!attribute [rw] response_view
227
+ # @return [Google::Cloud::Tasks::V2::Task::View]
228
+ # The response_view specifies which subset of the {Google::Cloud::Tasks::V2::Task Task} will be
229
+ # returned.
230
+ #
231
+ # By default response_view is {Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; not all
232
+ # information is retrieved by default because some data, such as
233
+ # payloads, might be desirable to return only when needed because
234
+ # of its large size or because of the sensitivity of data that it
235
+ # contains.
236
+ #
237
+ # Authorization for {Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires
238
+ # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
239
+ # permission on the {Google::Cloud::Tasks::V2::Task Task} resource.
240
+ class GetTaskRequest; end
241
+
242
+ # Request message for {Google::Cloud::Tasks::V2::CloudTasks::CreateTask CreateTask}.
243
+ # @!attribute [rw] parent
244
+ # @return [String]
245
+ # Required.
246
+ #
247
+ # The queue name. For example:
248
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
249
+ #
250
+ # The queue must already exist.
251
+ # @!attribute [rw] task
252
+ # @return [Google::Cloud::Tasks::V2::Task]
253
+ # Required.
254
+ #
255
+ # The task to add.
256
+ #
257
+ # Task names have the following format:
258
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
259
+ # The user can optionally specify a task {Google::Cloud::Tasks::V2::Task#name name}. If a
260
+ # name is not specified then the system will generate a random
261
+ # unique task id, which will be set in the task returned in the
262
+ # {Google::Cloud::Tasks::V2::Task#name response}.
263
+ #
264
+ # If {Google::Cloud::Tasks::V2::Task#schedule_time schedule_time} is not set or is in the
265
+ # past then Cloud Tasks will set it to the current time.
266
+ #
267
+ # Task De-duplication:
268
+ #
269
+ # Explicitly specifying a task ID enables task de-duplication. If
270
+ # a task's ID is identical to that of an existing task or a task
271
+ # that was deleted or executed recently then the call will fail
272
+ # with {Google::Rpc::Code::ALREADY_EXISTS ALREADY_EXISTS}.
273
+ # If the task's queue was created using Cloud Tasks, then another task with
274
+ # the same name can't be created for ~1hour after the original task was
275
+ # deleted or executed. If the task's queue was created using queue.yaml or
276
+ # queue.xml, then another task with the same name can't be created
277
+ # for ~9days after the original task was deleted or executed.
278
+ #
279
+ # Because there is an extra lookup cost to identify duplicate task
280
+ # names, these {Google::Cloud::Tasks::V2::CloudTasks::CreateTask CreateTask} calls have significantly
281
+ # increased latency. Using hashed strings for the task id or for
282
+ # the prefix of the task id is recommended. Choosing task ids that
283
+ # are sequential or have sequential prefixes, for example using a
284
+ # timestamp, causes an increase in latency and error rates in all
285
+ # task commands. The infrastructure relies on an approximately
286
+ # uniform distribution of task ids to store and serve tasks
287
+ # efficiently.
288
+ # @!attribute [rw] response_view
289
+ # @return [Google::Cloud::Tasks::V2::Task::View]
290
+ # The response_view specifies which subset of the {Google::Cloud::Tasks::V2::Task Task} will be
291
+ # returned.
292
+ #
293
+ # By default response_view is {Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; not all
294
+ # information is retrieved by default because some data, such as
295
+ # payloads, might be desirable to return only when needed because
296
+ # of its large size or because of the sensitivity of data that it
297
+ # contains.
298
+ #
299
+ # Authorization for {Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires
300
+ # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
301
+ # permission on the {Google::Cloud::Tasks::V2::Task Task} resource.
302
+ class CreateTaskRequest; end
303
+
304
+ # Request message for deleting a task using
305
+ # {Google::Cloud::Tasks::V2::CloudTasks::DeleteTask DeleteTask}.
306
+ # @!attribute [rw] name
307
+ # @return [String]
308
+ # Required.
309
+ #
310
+ # The task name. For example:
311
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
312
+ class DeleteTaskRequest; end
313
+
314
+ # Request message for forcing a task to run now using
315
+ # {Google::Cloud::Tasks::V2::CloudTasks::RunTask RunTask}.
316
+ # @!attribute [rw] name
317
+ # @return [String]
318
+ # Required.
319
+ #
320
+ # The task name. For example:
321
+ # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
322
+ # @!attribute [rw] response_view
323
+ # @return [Google::Cloud::Tasks::V2::Task::View]
324
+ # The response_view specifies which subset of the {Google::Cloud::Tasks::V2::Task Task} will be
325
+ # returned.
326
+ #
327
+ # By default response_view is {Google::Cloud::Tasks::V2::Task::View::BASIC BASIC}; not all
328
+ # information is retrieved by default because some data, such as
329
+ # payloads, might be desirable to return only when needed because
330
+ # of its large size or because of the sensitivity of data that it
331
+ # contains.
332
+ #
333
+ # Authorization for {Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires
334
+ # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
335
+ # permission on the {Google::Cloud::Tasks::V2::Task Task} resource.
336
+ class RunTaskRequest; end
337
+ end
338
+ end
339
+ end
340
+ end
@@ -0,0 +1,333 @@
1
+ # Copyright 2019 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 V2
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, queue types, and others.
23
+ # @!attribute [rw] name
24
+ # @return [String]
25
+ # Caller-specified and required in {Google::Cloud::Tasks::V2::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_routing_override
45
+ # @return [Google::Cloud::Tasks::V2::AppEngineRouting]
46
+ # Overrides for
47
+ # {Google::Cloud::Tasks::V2::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
48
+ # These settings apply only to
49
+ # {Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks} in this queue.
50
+ #
51
+ # If set, `app_engine_routing_override` is used for all
52
+ # {Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks} in the queue, no matter what the
53
+ # setting is for the
54
+ # {Google::Cloud::Tasks::V2::AppEngineHttpRequest#app_engine_routing task-level app_engine_routing}.
55
+ # @!attribute [rw] rate_limits
56
+ # @return [Google::Cloud::Tasks::V2::RateLimits]
57
+ # Rate limits for task dispatches.
58
+ #
59
+ # {Google::Cloud::Tasks::V2::Queue#rate_limits rate_limits} and {Google::Cloud::Tasks::V2::Queue#retry_config retry_config} are
60
+ # related because they both control task attempts. However they control task
61
+ # attempts in different ways:
62
+ #
63
+ # * {Google::Cloud::Tasks::V2::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::V2::Queue#retry_config retry_config} controls what happens to
68
+ # particular a task after its first attempt fails. That is,
69
+ # {Google::Cloud::Tasks::V2::Queue#retry_config retry_config} controls task retries (the
70
+ # second attempt, third attempt, etc).
71
+ #
72
+ # The queue's actual dispatch rate is the result of:
73
+ #
74
+ # * Number of tasks in the queue
75
+ # * User-specified throttling: {Google::Cloud::Tasks::V2::Queue#rate_limits rate_limits},
76
+ # {Google::Cloud::Tasks::V2::Queue#retry_config retry_config}, and the
77
+ # {Google::Cloud::Tasks::V2::Queue#state queue's state}.
78
+ # * System throttling due to `429` (Too Many Requests) or `503` (Service
79
+ # Unavailable) responses from the worker, high error rates, or to smooth
80
+ # sudden large traffic spikes.
81
+ # @!attribute [rw] retry_config
82
+ # @return [Google::Cloud::Tasks::V2::RetryConfig]
83
+ # Settings that determine the retry behavior.
84
+ #
85
+ # * For tasks created using Cloud Tasks: the queue-level retry settings
86
+ # apply to all tasks in the queue that were created using Cloud Tasks.
87
+ # Retry settings cannot be set on individual tasks.
88
+ # * For tasks created using the App Engine SDK: the queue-level retry
89
+ # settings apply to all tasks in the queue which do not have retry settings
90
+ # explicitly set on the task and were created by the App Engine SDK. See
91
+ # [App Engine
92
+ # documentation](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/retrying-tasks).
93
+ # @!attribute [rw] state
94
+ # @return [Google::Cloud::Tasks::V2::Queue::State]
95
+ # Output only. The state of the queue.
96
+ #
97
+ # `state` can only be changed by called
98
+ # {Google::Cloud::Tasks::V2::CloudTasks::PauseQueue PauseQueue},
99
+ # {Google::Cloud::Tasks::V2::CloudTasks::ResumeQueue ResumeQueue}, or uploading
100
+ # [queue.yaml/xml](https://cloud.google.com/appengine/docs/python/config/queueref).
101
+ # {Google::Cloud::Tasks::V2::CloudTasks::UpdateQueue UpdateQueue} cannot be used to change `state`.
102
+ # @!attribute [rw] purge_time
103
+ # @return [Google::Protobuf::Timestamp]
104
+ # Output only. The last time this queue was purged.
105
+ #
106
+ # All tasks that were {Google::Cloud::Tasks::V2::Task#create_time created} before this time
107
+ # were purged.
108
+ #
109
+ # A queue can be purged using {Google::Cloud::Tasks::V2::CloudTasks::PurgeQueue PurgeQueue}, the
110
+ # [App Engine Task Queue SDK, or the Cloud
111
+ # Console](https://cloud.google.com/appengine/docs/standard/python/taskqueue/push/deleting-tasks-and-queues#purging_all_tasks_from_a_queue).
112
+ #
113
+ # Purge time will be truncated to the nearest microsecond. Purge
114
+ # time will be unset if the queue has never been purged.
115
+ class Queue
116
+ # State of the queue.
117
+ module State
118
+ # Unspecified state.
119
+ STATE_UNSPECIFIED = 0
120
+
121
+ # The queue is running. Tasks can be dispatched.
122
+ #
123
+ # If the queue was created using Cloud Tasks and the queue has
124
+ # had no activity (method calls or task dispatches) for 30 days,
125
+ # the queue may take a few minutes to re-activate. Some method
126
+ # calls may return {Google::Rpc::Code::NOT_FOUND NOT_FOUND} and
127
+ # tasks may not be dispatched for a few minutes until the queue
128
+ # has been re-activated.
129
+ RUNNING = 1
130
+
131
+ # Tasks are paused by the user. If the queue is paused then Cloud
132
+ # Tasks will stop delivering tasks from it, but more tasks can
133
+ # still be added to it by the user.
134
+ PAUSED = 2
135
+
136
+ # The queue is disabled.
137
+ #
138
+ # A queue becomes `DISABLED` when
139
+ # [queue.yaml](https://cloud.google.com/appengine/docs/python/config/queueref)
140
+ # or
141
+ # [queue.xml](https://cloud.google.com/appengine/docs/standard/java/config/queueref)
142
+ # is uploaded which does not contain the queue. You cannot directly disable
143
+ # a queue.
144
+ #
145
+ # When a queue is disabled, tasks can still be added to a queue
146
+ # but the tasks are not dispatched.
147
+ #
148
+ # To permanently delete this queue and all of its tasks, call
149
+ # {Google::Cloud::Tasks::V2::CloudTasks::DeleteQueue DeleteQueue}.
150
+ DISABLED = 3
151
+ end
152
+ end
153
+
154
+ # Rate limits.
155
+ #
156
+ # This message determines the maximum rate that tasks can be dispatched by a
157
+ # queue, regardless of whether the dispatch is a first task attempt or a retry.
158
+ #
159
+ # Note: The debugging command, {Google::Cloud::Tasks::V2::CloudTasks::RunTask RunTask}, will run a task
160
+ # even if the queue has reached its {Google::Cloud::Tasks::V2::RateLimits RateLimits}.
161
+ # @!attribute [rw] max_dispatches_per_second
162
+ # @return [Float]
163
+ # The maximum rate at which tasks are dispatched from this queue.
164
+ #
165
+ # If unspecified when the queue is created, Cloud Tasks will pick the
166
+ # default.
167
+ #
168
+ # * For {Google::Cloud::Tasks::V2::AppEngineHttpQueue App Engine queues}, the maximum allowed value
169
+ # is 500.
170
+ #
171
+ #
172
+ # This field has the same meaning as
173
+ # [rate in
174
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#rate).
175
+ # @!attribute [rw] max_burst_size
176
+ # @return [Integer]
177
+ # Output only. The max burst size.
178
+ #
179
+ # Max burst size limits how fast tasks in queue are processed when
180
+ # many tasks are in the queue and the rate is high. This field
181
+ # allows the queue to have a high rate so processing starts shortly
182
+ # after a task is enqueued, but still limits resource usage when
183
+ # many tasks are enqueued in a short period of time.
184
+ #
185
+ # The [token bucket](https://wikipedia.org/wiki/Token_Bucket)
186
+ # algorithm is used to control the rate of task dispatches. Each
187
+ # queue has a token bucket that holds tokens, up to the maximum
188
+ # specified by `max_burst_size`. Each time a task is dispatched, a
189
+ # token is removed from the bucket. Tasks will be dispatched until
190
+ # the queue's bucket runs out of tokens. The bucket will be
191
+ # continuously refilled with new tokens based on
192
+ # {Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second}.
193
+ #
194
+ # Cloud Tasks will pick the value of `max_burst_size` based on the
195
+ # value of
196
+ # {Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second}.
197
+ #
198
+ # For App Engine queues that were created or updated using
199
+ # `queue.yaml/xml`, `max_burst_size` is equal to
200
+ # [bucket_size](https://cloud.google.com/appengine/docs/standard/python/config/queueref#bucket_size).
201
+ # Since `max_burst_size` is output only, if
202
+ # {Google::Cloud::Tasks::V2::CloudTasks::UpdateQueue UpdateQueue} is called on a queue
203
+ # created by `queue.yaml/xml`, `max_burst_size` will be reset based
204
+ # on the value of
205
+ # {Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second},
206
+ # regardless of whether
207
+ # {Google::Cloud::Tasks::V2::RateLimits#max_dispatches_per_second max_dispatches_per_second}
208
+ # is updated.
209
+ # @!attribute [rw] max_concurrent_dispatches
210
+ # @return [Integer]
211
+ # The maximum number of concurrent tasks that Cloud Tasks allows
212
+ # to be dispatched for this queue. After this threshold has been
213
+ # reached, Cloud Tasks stops dispatching tasks until the number of
214
+ # concurrent requests decreases.
215
+ #
216
+ # If unspecified when the queue is created, Cloud Tasks will pick the
217
+ # default.
218
+ #
219
+ #
220
+ # The maximum allowed value is 5,000.
221
+ #
222
+ #
223
+ # This field has the same meaning as
224
+ # [max_concurrent_requests in
225
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#max_concurrent_requests).
226
+ class RateLimits; end
227
+
228
+ # Retry config.
229
+ #
230
+ # These settings determine when a failed task attempt is retried.
231
+ # @!attribute [rw] max_attempts
232
+ # @return [Integer]
233
+ # Number of attempts per task.
234
+ #
235
+ # Cloud Tasks will attempt the task `max_attempts` times (that is, if the
236
+ # first attempt fails, then there will be `max_attempts - 1` retries). Must
237
+ # be >= -1.
238
+ #
239
+ # If unspecified when the queue is created, Cloud Tasks will pick the
240
+ # default.
241
+ #
242
+ # -1 indicates unlimited attempts.
243
+ #
244
+ # This field has the same meaning as
245
+ # [task_retry_limit in
246
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
247
+ # @!attribute [rw] max_retry_duration
248
+ # @return [Google::Protobuf::Duration]
249
+ # If positive, `max_retry_duration` specifies the time limit for
250
+ # retrying a failed task, measured from when the task was first
251
+ # attempted. Once `max_retry_duration` time has passed *and* the
252
+ # task has been attempted {Google::Cloud::Tasks::V2::RetryConfig#max_attempts max_attempts}
253
+ # times, no further attempts will be made and the task will be
254
+ # deleted.
255
+ #
256
+ # If zero, then the task age is unlimited.
257
+ #
258
+ # If unspecified when the queue is created, Cloud Tasks will pick the
259
+ # default.
260
+ #
261
+ #
262
+ # `max_retry_duration` will be truncated to the nearest second.
263
+ #
264
+ # This field has the same meaning as
265
+ # [task_age_limit in
266
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
267
+ # @!attribute [rw] min_backoff
268
+ # @return [Google::Protobuf::Duration]
269
+ # A task will be {Google::Cloud::Tasks::V2::Task#schedule_time scheduled} for retry between
270
+ # {Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff} and
271
+ # {Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} duration after it fails,
272
+ # if the queue's {Google::Cloud::Tasks::V2::RetryConfig RetryConfig} specifies that the task should be
273
+ # retried.
274
+ #
275
+ # If unspecified when the queue is created, Cloud Tasks will pick the
276
+ # default.
277
+ #
278
+ #
279
+ # `min_backoff` will be truncated to the nearest second.
280
+ #
281
+ # This field has the same meaning as
282
+ # [min_backoff_seconds in
283
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
284
+ # @!attribute [rw] max_backoff
285
+ # @return [Google::Protobuf::Duration]
286
+ # A task will be {Google::Cloud::Tasks::V2::Task#schedule_time scheduled} for retry between
287
+ # {Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff} and
288
+ # {Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} duration after it fails,
289
+ # if the queue's {Google::Cloud::Tasks::V2::RetryConfig RetryConfig} specifies that the task should be
290
+ # retried.
291
+ #
292
+ # If unspecified when the queue is created, Cloud Tasks will pick the
293
+ # default.
294
+ #
295
+ #
296
+ # `max_backoff` will be truncated to the nearest second.
297
+ #
298
+ # This field has the same meaning as
299
+ # [max_backoff_seconds in
300
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
301
+ # @!attribute [rw] max_doublings
302
+ # @return [Integer]
303
+ # The time between retries will double `max_doublings` times.
304
+ #
305
+ # A task's retry interval starts at
306
+ # {Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff}, then doubles
307
+ # `max_doublings` times, then increases linearly, and finally
308
+ # retries retries at intervals of
309
+ # {Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} up to
310
+ # {Google::Cloud::Tasks::V2::RetryConfig#max_attempts max_attempts} times.
311
+ #
312
+ # For example, if {Google::Cloud::Tasks::V2::RetryConfig#min_backoff min_backoff} is 10s,
313
+ # {Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} is 300s, and
314
+ # `max_doublings` is 3, then the a task will first be retried in
315
+ # 10s. The retry interval will double three times, and then
316
+ # increase linearly by 2^3 * 10s. Finally, the task will retry at
317
+ # intervals of {Google::Cloud::Tasks::V2::RetryConfig#max_backoff max_backoff} until the
318
+ # task has been attempted {Google::Cloud::Tasks::V2::RetryConfig#max_attempts max_attempts}
319
+ # times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s,
320
+ # 240s, 300s, 300s, ....
321
+ #
322
+ # If unspecified when the queue is created, Cloud Tasks will pick the
323
+ # default.
324
+ #
325
+ #
326
+ # This field has the same meaning as
327
+ # [max_doublings in
328
+ # queue.yaml/xml](https://cloud.google.com/appengine/docs/standard/python/config/queueref#retry_parameters).
329
+ class RetryConfig; end
330
+ end
331
+ end
332
+ end
333
+ end