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