google-cloud-tasks 1.5.1 → 2.1.3

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 +320 -0
  6. data/README.md +96 -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 +88 -117
  9. data/lib/google/cloud/tasks/version.rb +6 -2
  10. metadata +78 -115
  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,414 +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
- # HTTP request.
21
- #
22
- # The task will be pushed to the worker as an HTTP request. If the worker
23
- # or the redirected worker acknowledges the task by returning a successful HTTP
24
- # response code ([`200` - `299`]), the task will be removed from the queue. If
25
- # any other HTTP response code is returned or no response is received, the
26
- # task will be retried according to the following:
27
- #
28
- # * User-specified throttling: {Google::Cloud::Tasks::V2::Queue#retry_config retry configuration},
29
- # {Google::Cloud::Tasks::V2::Queue#rate_limits rate limits}, and the {Google::Cloud::Tasks::V2::Queue#state queue's state}.
30
- #
31
- # * System throttling: To prevent the worker from overloading, Cloud Tasks may
32
- # temporarily reduce the queue's effective rate. User-specified settings
33
- # will not be changed.
34
- #
35
- # System throttling happens because:
36
- #
37
- # * Cloud Tasks backs off on all errors. Normally the backoff specified in
38
- # {Google::Cloud::Tasks::V2::Queue#rate_limits rate limits} will be used. But if the worker returns
39
- # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
40
- # errors is high, Cloud Tasks will use a higher backoff rate. The retry
41
- # specified in the `Retry-After` HTTP response header is considered.
42
- #
43
- # * To prevent traffic spikes and to smooth sudden increases in traffic,
44
- # dispatches ramp up slowly when the queue is newly created or idle and
45
- # if large numbers of tasks suddenly become available to dispatch (due to
46
- # spikes in create task rates, the queue being unpaused, or many tasks
47
- # that are scheduled at the same time).
48
- # @!attribute [rw] url
49
- # @return [String]
50
- # Required. The full url path that the request will be sent to.
51
- #
52
- # This string must begin with either "http://" or "https://". Some examples
53
- # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
54
- # encode some characters for safety and compatibility. The maximum allowed
55
- # URL length is 2083 characters after encoding.
56
- #
57
- # The `Location` header response from a redirect response [`300` - `399`]
58
- # may be followed. The redirect is not counted as a separate attempt.
59
- # @!attribute [rw] http_method
60
- # @return [Google::Cloud::Tasks::V2::HttpMethod]
61
- # The HTTP method to use for the request. The default is POST.
62
- # @!attribute [rw] headers
63
- # @return [Hash{String => String}]
64
- # HTTP request headers.
65
- #
66
- # This map contains the header field names and values.
67
- # Headers can be set when the
68
- # {Google::Cloud::Tasks::V2beta3::CloudTasks::CreateTask task is created}.
69
- #
70
- # These headers represent a subset of the headers that will accompany the
71
- # task's HTTP request. Some HTTP request headers will be ignored or replaced.
72
- #
73
- # A partial list of headers that will be ignored or replaced is:
74
- #
75
- # * Host: This will be computed by Cloud Tasks and derived from
76
- # {Google::Cloud::Tasks::V2::HttpRequest#url HttpRequest#url}.
77
- # * Content-Length: This will be computed by Cloud Tasks.
78
- # * User-Agent: This will be set to `"Google-Cloud-Tasks"`.
79
- # * X-Google-*: Google use only.
80
- # * X-AppEngine-*: Google use only.
81
- #
82
- # `Content-Type` won't be set by Cloud Tasks. You can explicitly set
83
- # `Content-Type` to a media type when the
84
- # {Google::Cloud::Tasks::V2beta3::CloudTasks::CreateTask task is created}.
85
- # For example, `Content-Type` can be set to `"application/octet-stream"` or
86
- # `"application/json"`.
87
- #
88
- # Headers which can have multiple values (according to RFC2616) can be
89
- # specified using comma-separated values.
90
- #
91
- # The size of the headers must be less than 80KB.
92
- # @!attribute [rw] body
93
- # @return [String]
94
- # HTTP request body.
95
- #
96
- # A request body is allowed only if the
97
- # {Google::Cloud::Tasks::V2::HttpRequest#http_method HTTP method} is POST, PUT, or PATCH. It is an
98
- # error to set body on a task with an incompatible {Google::Cloud::Tasks::V2::HttpMethod HttpMethod}.
99
- # @!attribute [rw] oauth_token
100
- # @return [Google::Cloud::Tasks::V2::OAuthToken]
101
- # If specified, an
102
- # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
103
- # will be generated and attached as an `Authorization` header in the HTTP
104
- # request.
105
- #
106
- # This type of authorization should generally only be used when calling
107
- # Google APIs hosted on *.googleapis.com.
108
- # @!attribute [rw] oidc_token
109
- # @return [Google::Cloud::Tasks::V2::OidcToken]
110
- # If specified, an
111
- # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
112
- # token will be generated and attached as an `Authorization` header in the
113
- # HTTP request.
114
- #
115
- # This type of authorization can be used for many scenarios, including
116
- # calling Cloud Run, or endpoints where you intend to validate the token
117
- # yourself.
118
- class HttpRequest; end
119
-
120
- # App Engine HTTP request.
121
- #
122
- # The message defines the HTTP request that is sent to an App Engine app when
123
- # the task is dispatched.
124
- #
125
- # Using {Google::Cloud::Tasks::V2::AppEngineHttpRequest AppEngineHttpRequest} requires
126
- # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
127
- # Google IAM permission for the project
128
- # and the following scope:
129
- #
130
- # `https://www.googleapis.com/auth/cloud-platform`
131
- #
132
- # The task will be delivered to the App Engine app which belongs to the same
133
- # project as the queue. For more information, see
134
- # [How Requests are
135
- # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
136
- # and how routing is affected by
137
- # [dispatch
138
- # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
139
- # Traffic is encrypted during transport and never leaves Google datacenters.
140
- # Because this traffic is carried over a communication mechanism internal to
141
- # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
142
- # The request to the handler, however, will appear to have used the HTTP
143
- # protocol.
144
- #
145
- # The {Google::Cloud::Tasks::V2::AppEngineRouting AppEngineRouting} used to construct the URL that the task is
146
- # delivered to can be set at the queue-level or task-level:
147
- #
148
- # * If [app_engine_routing_override is set on the
149
- # queue][Queue.app_engine_routing_override], this value is used for all
150
- # tasks in the queue, no matter what the setting is for the [task-level
151
- # app_engine_routing][AppEngineHttpRequest.app_engine_routing].
152
- #
153
- #
154
- # The `url` that the task will be sent to is:
155
- #
156
- # * `url =` {Google::Cloud::Tasks::V2::AppEngineRouting#host host} `+`
157
- # {Google::Cloud::Tasks::V2::AppEngineHttpRequest#relative_uri relative_uri}
158
- #
159
- # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
160
- # URIs restricted with
161
- # [`login:
162
- # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
163
- # Because tasks are not run as any user, they cannot be dispatched to URIs
164
- # restricted with
165
- # [`login:
166
- # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
167
- # Task dispatches also do not follow redirects.
168
- #
169
- # The task attempt has succeeded if the app's request handler returns an HTTP
170
- # response code in the range [`200` - `299`]. The task attempt has failed if
171
- # the app's handler returns a non-2xx response code or Cloud Tasks does
172
- # not receive response before the {Google::Cloud::Tasks::V2::Task#dispatch_deadline deadline}. Failed
173
- # tasks will be retried according to the
174
- # {Google::Cloud::Tasks::V2::Queue#retry_config retry configuration}. `503` (Service Unavailable) is
175
- # considered an App Engine system error instead of an application error and
176
- # will cause Cloud Tasks' traffic congestion control to temporarily throttle
177
- # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
178
- # Requests) response from an app handler does not cause traffic congestion
179
- # control to throttle the queue.
180
- # @!attribute [rw] http_method
181
- # @return [Google::Cloud::Tasks::V2::HttpMethod]
182
- # The HTTP method to use for the request. The default is POST.
183
- #
184
- # The app's request handler for the task's target URL must be able to handle
185
- # HTTP requests with this http_method, otherwise the task attempt will fail
186
- # with error code 405 (Method Not Allowed). See
187
- # [Writing a push task request
188
- # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
189
- # and the documentation for the request handlers in the language your app is
190
- # written in e.g.
191
- # [Python Request
192
- # Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass).
193
- # @!attribute [rw] app_engine_routing
194
- # @return [Google::Cloud::Tasks::V2::AppEngineRouting]
195
- # Task-level setting for App Engine routing.
196
- #
197
- # * If [app_engine_routing_override is set on the
198
- # queue][Queue.app_engine_routing_override], this value is used for all
199
- # tasks in the queue, no matter what the setting is for the [task-level
200
- # app_engine_routing][AppEngineHttpRequest.app_engine_routing].
201
- # @!attribute [rw] relative_uri
202
- # @return [String]
203
- # The relative URI.
204
- #
205
- # The relative URI must begin with "/" and must be a valid HTTP relative URI.
206
- # It can contain a path and query string arguments.
207
- # If the relative URI is empty, then the root path "/" will be used.
208
- # No spaces are allowed, and the maximum length allowed is 2083 characters.
209
- # @!attribute [rw] headers
210
- # @return [Hash{String => String}]
211
- # HTTP request headers.
212
- #
213
- # This map contains the header field names and values.
214
- # Headers can be set when the
215
- # {Google::Cloud::Tasks::V2::CloudTasks::CreateTask task is created}.
216
- # Repeated headers are not supported but a header value can contain commas.
217
- #
218
- # Cloud Tasks sets some headers to default values:
219
- #
220
- # * `User-Agent`: By default, this header is
221
- # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
222
- # This header can be modified, but Cloud Tasks will append
223
- # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
224
- # modified `User-Agent`.
225
- #
226
- # If the task has a {Google::Cloud::Tasks::V2::AppEngineHttpRequest#body body}, Cloud
227
- # Tasks sets the following headers:
228
- #
229
- # * `Content-Type`: By default, the `Content-Type` header is set to
230
- # `"application/octet-stream"`. The default can be overridden by explicitly
231
- # setting `Content-Type` to a particular media type when the
232
- # {Google::Cloud::Tasks::V2::CloudTasks::CreateTask task is created}.
233
- # For example, `Content-Type` can be set to `"application/json"`.
234
- # * `Content-Length`: This is computed by Cloud Tasks. This value is
235
- # output only. It cannot be changed.
236
- #
237
- # The headers below cannot be set or overridden:
238
- #
239
- # * `Host`
240
- # * `X-Google-*`
241
- # * `X-AppEngine-*`
242
- #
243
- # In addition, Cloud Tasks sets some headers when the task is dispatched,
244
- # such as headers containing information about the task; see
245
- # [request
246
- # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
247
- # These headers are set only when the task is dispatched, so they are not
248
- # visible when the task is returned in a Cloud Tasks response.
249
- #
250
- # Although there is no specific limit for the maximum number of headers or
251
- # the size, there is a limit on the maximum size of the {Google::Cloud::Tasks::V2::Task Task}. For more
252
- # information, see the {Google::Cloud::Tasks::V2::CloudTasks::CreateTask CreateTask} documentation.
253
- # @!attribute [rw] body
254
- # @return [String]
255
- # HTTP request body.
256
- #
257
- # A request body is allowed only if the HTTP method is POST or PUT. It is
258
- # an error to set a body on a task with an incompatible {Google::Cloud::Tasks::V2::HttpMethod HttpMethod}.
259
- class AppEngineHttpRequest; end
260
-
261
- # App Engine Routing.
262
- #
263
- # Defines routing characteristics specific to App Engine - service, version,
264
- # and instance.
265
- #
266
- # For more information about services, versions, and instances see
267
- # [An Overview of App
268
- # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
269
- # [Microservices Architecture on Google App
270
- # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
271
- # [App Engine Standard request
272
- # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
273
- # and [App Engine Flex request
274
- # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
275
- #
276
- # Using {Google::Cloud::Tasks::V2::AppEngineRouting AppEngineRouting} requires
277
- # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
278
- # Google IAM permission for the project
279
- # and the following scope:
280
- #
281
- # `https://www.googleapis.com/auth/cloud-platform`
282
- # @!attribute [rw] service
283
- # @return [String]
284
- # App service.
285
- #
286
- # By default, the task is sent to the service which is the default
287
- # service when the task is attempted.
288
- #
289
- # For some queues or tasks which were created using the App Engine
290
- # Task Queue API, {Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not parsable
291
- # into {Google::Cloud::Tasks::V2::AppEngineRouting#service service},
292
- # {Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and
293
- # {Google::Cloud::Tasks::V2::AppEngineRouting#instance instance}. For example, some tasks
294
- # which were created using the App Engine SDK use a custom domain
295
- # name; custom domains are not parsed by Cloud Tasks. If
296
- # {Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not parsable, then
297
- # {Google::Cloud::Tasks::V2::AppEngineRouting#service service},
298
- # {Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and
299
- # {Google::Cloud::Tasks::V2::AppEngineRouting#instance instance} are the empty string.
300
- # @!attribute [rw] version
301
- # @return [String]
302
- # App version.
303
- #
304
- # By default, the task is sent to the version which is the default
305
- # version when the task is attempted.
306
- #
307
- # For some queues or tasks which were created using the App Engine
308
- # Task Queue API, {Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not parsable
309
- # into {Google::Cloud::Tasks::V2::AppEngineRouting#service service},
310
- # {Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and
311
- # {Google::Cloud::Tasks::V2::AppEngineRouting#instance instance}. For example, some tasks
312
- # which were created using the App Engine SDK use a custom domain
313
- # name; custom domains are not parsed by Cloud Tasks. If
314
- # {Google::Cloud::Tasks::V2::AppEngineRouting#host host} is not parsable, then
315
- # {Google::Cloud::Tasks::V2::AppEngineRouting#service service},
316
- # {Google::Cloud::Tasks::V2::AppEngineRouting#version version}, and
317
- # {Google::Cloud::Tasks::V2::AppEngineRouting#instance instance} are the empty string.
318
- # @!attribute [rw] instance
319
- # @return [String]
320
- # App instance.
321
- #
322
- # By default, the task is sent to an instance which is available when
323
- # the task is attempted.
324
- #
325
- # Requests can only be sent to a specific instance if
326
- # [manual scaling is used in App Engine
327
- # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
328
- # App Engine Flex does not support instances. For more information, see
329
- # [App Engine Standard request
330
- # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
331
- # and [App Engine Flex request
332
- # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
333
- # @!attribute [rw] host
334
- # @return [String]
335
- # Output only. The host that the task is sent to.
336
- #
337
- # The host is constructed from the domain name of the app associated with
338
- # the queue's project ID (for example <app-id>.appspot.com), and the
339
- # {Google::Cloud::Tasks::V2::AppEngineRouting#service service}, {Google::Cloud::Tasks::V2::AppEngineRouting#version version},
340
- # and {Google::Cloud::Tasks::V2::AppEngineRouting#instance instance}. Tasks which were created using
341
- # the App Engine SDK might have a custom domain name.
342
- #
343
- # For more information, see
344
- # [How Requests are
345
- # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
346
- class AppEngineRouting; end
347
-
348
- # Contains information needed for generating an
349
- # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
350
- # This type of authorization should generally only be used when calling Google
351
- # APIs hosted on *.googleapis.com.
352
- # @!attribute [rw] service_account_email
353
- # @return [String]
354
- # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
355
- # to be used for generating OAuth token.
356
- # The service account must be within the same project as the queue. The
357
- # caller must have iam.serviceAccounts.actAs permission for the service
358
- # account.
359
- # @!attribute [rw] scope
360
- # @return [String]
361
- # OAuth scope to be used for generating OAuth access token.
362
- # If not specified, "https://www.googleapis.com/auth/cloud-platform"
363
- # will be used.
364
- class OAuthToken; end
365
-
366
- # Contains information needed for generating an
367
- # [OpenID Connect
368
- # token](https://developers.google.com/identity/protocols/OpenIDConnect).
369
- # This type of authorization can be used for many scenarios, including
370
- # calling Cloud Run, or endpoints where you intend to validate the token
371
- # yourself.
372
- # @!attribute [rw] service_account_email
373
- # @return [String]
374
- # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
375
- # to be used for generating OIDC token.
376
- # The service account must be within the same project as the queue. The
377
- # caller must have iam.serviceAccounts.actAs permission for the service
378
- # account.
379
- # @!attribute [rw] audience
380
- # @return [String]
381
- # Audience to be used when generating OIDC token. If not specified, the URI
382
- # specified in target will be used.
383
- class OidcToken; end
384
-
385
- # The HTTP method used to deliver the task.
386
- module HttpMethod
387
- # HTTP method unspecified
388
- HTTP_METHOD_UNSPECIFIED = 0
389
-
390
- # HTTP POST
391
- POST = 1
392
-
393
- # HTTP GET
394
- GET = 2
395
-
396
- # HTTP HEAD
397
- HEAD = 3
398
-
399
- # HTTP PUT
400
- PUT = 4
401
-
402
- # HTTP DELETE
403
- DELETE = 5
404
-
405
- # HTTP PATCH
406
- PATCH = 6
407
-
408
- # HTTP OPTIONS
409
- OPTIONS = 7
410
- end
411
- end
412
- end
413
- end
414
- end
@@ -1,175 +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 unit of scheduled work.
21
- # @!attribute [rw] name
22
- # @return [String]
23
- # Optionally caller-specified in {Google::Cloud::Tasks::V2::CloudTasks::CreateTask CreateTask}.
24
- #
25
- # The task name.
26
- #
27
- # The task name must have the following format:
28
- # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
29
- #
30
- # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
31
- # hyphens (-), colons (:), or periods (.).
32
- # For more information, see
33
- # [Identifying
34
- # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
35
- # * `LOCATION_ID` is the canonical ID for the task's location.
36
- # The list of available locations can be obtained by calling
37
- # {Google::Cloud::Location::Locations::ListLocations ListLocations}.
38
- # For more information, see https://cloud.google.com/about/locations/.
39
- # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
40
- # hyphens (-). The maximum length is 100 characters.
41
- # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
42
- # hyphens (-), or underscores (_). The maximum length is 500 characters.
43
- # @!attribute [rw] app_engine_http_request
44
- # @return [Google::Cloud::Tasks::V2::AppEngineHttpRequest]
45
- # HTTP request that is sent to the App Engine app handler.
46
- #
47
- # An App Engine task is a task that has {Google::Cloud::Tasks::V2::AppEngineHttpRequest AppEngineHttpRequest} set.
48
- # @!attribute [rw] http_request
49
- # @return [Google::Cloud::Tasks::V2::HttpRequest]
50
- # HTTP request that is sent to the worker.
51
- #
52
- # An HTTP task is a task that has {Google::Cloud::Tasks::V2::HttpRequest HttpRequest} set.
53
- # @!attribute [rw] schedule_time
54
- # @return [Google::Protobuf::Timestamp]
55
- # The time when the task is scheduled to be attempted or retried.
56
- #
57
- # `schedule_time` will be truncated to the nearest microsecond.
58
- # @!attribute [rw] create_time
59
- # @return [Google::Protobuf::Timestamp]
60
- # Output only. The time that the task was created.
61
- #
62
- # `create_time` will be truncated to the nearest second.
63
- # @!attribute [rw] dispatch_deadline
64
- # @return [Google::Protobuf::Duration]
65
- # The deadline for requests sent to the worker. If the worker does not
66
- # respond by this deadline then the request is cancelled and the attempt
67
- # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
68
- # task according to the {Google::Cloud::Tasks::V2::RetryConfig RetryConfig}.
69
- #
70
- # Note that when the request is cancelled, Cloud Tasks will stop listing for
71
- # the response, but whether the worker stops processing depends on the
72
- # worker. For example, if the worker is stuck, it may not react to cancelled
73
- # requests.
74
- #
75
- # The default and maximum values depend on the type of request:
76
- #
77
- # * For {Google::Cloud::Tasks::V2::HttpRequest HTTP tasks}, the default is 10 minutes. The deadline
78
- # must be in the interval [15 seconds, 30 minutes].
79
- #
80
- # * For {Google::Cloud::Tasks::V2::AppEngineHttpRequest App Engine tasks}, 0 indicates that the
81
- # request has the default deadline. The default deadline depends on the
82
- # [scaling
83
- # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
84
- # of the service: 10 minutes for standard apps with automatic scaling, 24
85
- # hours for standard apps with manual and basic scaling, and 60 minutes for
86
- # flex apps. If the request deadline is set, it must be in the interval [15
87
- # seconds, 24 hours 15 seconds]. Regardless of the task's
88
- # `dispatch_deadline`, the app handler will not run for longer than than
89
- # the service's timeout. We recommend setting the `dispatch_deadline` to
90
- # at most a few seconds more than the app handler's timeout. For more
91
- # information see
92
- # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
93
- #
94
- # `dispatch_deadline` will be truncated to the nearest millisecond. The
95
- # deadline is an approximate deadline.
96
- # @!attribute [rw] dispatch_count
97
- # @return [Integer]
98
- # Output only. The number of attempts dispatched.
99
- #
100
- # This count includes attempts which have been dispatched but haven't
101
- # received a response.
102
- # @!attribute [rw] response_count
103
- # @return [Integer]
104
- # Output only. The number of attempts which have received a response.
105
- # @!attribute [rw] first_attempt
106
- # @return [Google::Cloud::Tasks::V2::Attempt]
107
- # Output only. The status of the task's first attempt.
108
- #
109
- # Only {Google::Cloud::Tasks::V2::Attempt#dispatch_time dispatch_time} will be set.
110
- # The other {Google::Cloud::Tasks::V2::Attempt Attempt} information is not retained by Cloud Tasks.
111
- # @!attribute [rw] last_attempt
112
- # @return [Google::Cloud::Tasks::V2::Attempt]
113
- # Output only. The status of the task's last attempt.
114
- # @!attribute [rw] view
115
- # @return [Google::Cloud::Tasks::V2::Task::View]
116
- # Output only. The view specifies which subset of the {Google::Cloud::Tasks::V2::Task Task} has
117
- # been returned.
118
- class Task
119
- # The view specifies a subset of {Google::Cloud::Tasks::V2::Task Task} data.
120
- #
121
- # When a task is returned in a response, not all
122
- # information is retrieved by default because some data, such as
123
- # payloads, might be desirable to return only when needed because
124
- # of its large size or because of the sensitivity of data that it
125
- # contains.
126
- module View
127
- # Unspecified. Defaults to BASIC.
128
- VIEW_UNSPECIFIED = 0
129
-
130
- # The basic view omits fields which can be large or can contain
131
- # sensitive data.
132
- #
133
- # This view does not include the
134
- # {Google::Cloud::Tasks::V2::AppEngineHttpRequest#body body in AppEngineHttpRequest}.
135
- # Bodies are desirable to return only when needed, because they
136
- # can be large and because of the sensitivity of the data that you
137
- # choose to store in it.
138
- BASIC = 1
139
-
140
- # All information is returned.
141
- #
142
- # Authorization for {Google::Cloud::Tasks::V2::Task::View::FULL FULL} requires
143
- # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
144
- # permission on the {Google::Cloud::Tasks::V2::Queue Queue} resource.
145
- FULL = 2
146
- end
147
- end
148
-
149
- # The status of a task attempt.
150
- # @!attribute [rw] schedule_time
151
- # @return [Google::Protobuf::Timestamp]
152
- # Output only. The time that this attempt was scheduled.
153
- #
154
- # `schedule_time` will be truncated to the nearest microsecond.
155
- # @!attribute [rw] dispatch_time
156
- # @return [Google::Protobuf::Timestamp]
157
- # Output only. The time that this attempt was dispatched.
158
- #
159
- # `dispatch_time` will be truncated to the nearest microsecond.
160
- # @!attribute [rw] response_time
161
- # @return [Google::Protobuf::Timestamp]
162
- # Output only. The time that this attempt response was received.
163
- #
164
- # `response_time` will be truncated to the nearest microsecond.
165
- # @!attribute [rw] response_status
166
- # @return [Google::Rpc::Status]
167
- # Output only. The response from the worker for this attempt.
168
- #
169
- # If `response_time` is unset, then the task has not been attempted or is
170
- # currently running and the `response_status` field is meaningless.
171
- class Attempt; end
172
- end
173
- end
174
- end
175
- end