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