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