blob: eb65be9cc780ff2fcd53901157b21cc2218e5991 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="cloudtasks_v2beta3.html">Cloud Tasks API</a> . <a href="cloudtasks_v2beta3.projects.html">projects</a> . <a href="cloudtasks_v2beta3.projects.locations.html">locations</a> . <a href="cloudtasks_v2beta3.projects.locations.queues.html">queues</a> . <a href="cloudtasks_v2beta3.projects.locations.queues.tasks.html">tasks</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Creates a task and adds it to a queue.</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
82<p class="firstline">Deletes a task.</p>
83<p class="toc_element">
84 <code><a href="#get">get(name, responseView=None, x__xgafv=None)</a></code></p>
85<p class="firstline">Gets a task.</p>
86<p class="toc_element">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070087 <code><a href="#list">list(parent, responseView=None, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070088<p class="firstline">Lists the tasks in a queue.</p>
89<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#run">run(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Forces a task to run now.</p>
95<h3>Method Details</h3>
96<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070097 <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070098 <pre>Creates a task and adds it to a queue.
99
100Tasks cannot be updated after creation; there is no UpdateTask command.
101
102* The maximum task size is 100KB.
103
104Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 parent: string, Required. The queue name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700106`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
107
108The queue must already exist. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700109 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700110 The object takes the form of:
111
112{ # Request message for CreateTask.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700113 &quot;responseView&quot;: &quot;A String&quot;, # The response_view specifies which subset of the Task will be
114 # returned.
115 #
116 # By default response_view is BASIC; not all
117 # information is retrieved by default because some data, such as
118 # payloads, might be desirable to return only when needed because
119 # of its large size or because of the sensitivity of data that it
120 # contains.
121 #
122 # Authorization for FULL requires
123 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
124 # permission on the Task resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700125 &quot;task&quot;: { # A unit of scheduled work. # Required. The task to add.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700126 #
127 # Task names have the following format:
128 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
129 # The user can optionally specify a task name. If a
130 # name is not specified then the system will generate a random
131 # unique task id, which will be set in the task returned in the
132 # response.
133 #
134 # If schedule_time is not set or is in the
135 # past then Cloud Tasks will set it to the current time.
136 #
137 # Task De-duplication:
138 #
139 # Explicitly specifying a task ID enables task de-duplication. If
Bu Sun Kim65020912020-05-20 12:08:20 -0700140 # a task&#x27;s ID is identical to that of an existing task or a task
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700141 # that was deleted or executed recently then the call will fail
142 # with ALREADY_EXISTS.
Bu Sun Kim65020912020-05-20 12:08:20 -0700143 # If the task&#x27;s queue was created using Cloud Tasks, then another task with
144 # the same name can&#x27;t be created for ~1hour after the original task was
145 # deleted or executed. If the task&#x27;s queue was created using queue.yaml or
146 # queue.xml, then another task with the same name can&#x27;t be created
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700147 # for ~9days after the original task was deleted or executed.
148 #
149 # Because there is an extra lookup cost to identify duplicate task
150 # names, these CreateTask calls have significantly
151 # increased latency. Using hashed strings for the task id or for
152 # the prefix of the task id is recommended. Choosing task ids that
153 # are sequential or have sequential prefixes, for example using a
154 # timestamp, causes an increase in latency and error rates in all
155 # task commands. The infrastructure relies on an approximately
156 # uniform distribution of task ids to store and serve tasks
157 # efficiently.
Bu Sun Kim65020912020-05-20 12:08:20 -0700158 &quot;responseCount&quot;: 42, # Output only. The number of attempts which have received a response.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700159 &quot;lastAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
160 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
161 #
162 # `schedule_time` will be truncated to the nearest microsecond.
163 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
164 #
165 # `response_time` will be truncated to the nearest microsecond.
166 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
167 #
168 # `dispatch_time` will be truncated to the nearest microsecond.
169 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
170 #
171 # If `response_time` is unset, then the task has not been attempted or is
172 # currently running and the `response_status` field is meaningless.
173 # different programming environments, including REST APIs and RPC APIs. It is
174 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
175 # three pieces of data: error code, error message, and error details.
176 #
177 # You can find out more about this error model and how to work with it in the
178 # [API Design Guide](https://cloud.google.com/apis/design/errors).
179 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
180 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
181 # user-facing error message should be localized and sent in the
182 # google.rpc.Status.details field, or localized by the client.
183 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
184 # message types for APIs to use.
185 {
186 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
187 },
188 ],
189 },
190 },
191 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
192 #
193 # `create_time` will be truncated to the nearest second.
194 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
195 #
196 # The task name.
197 #
198 # The task name must have the following format:
199 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
200 #
201 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
202 # hyphens (-), colons (:), or periods (.).
203 # For more information, see
204 # [Identifying
205 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
206 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
207 # The list of available locations can be obtained by calling
208 # ListLocations.
209 # For more information, see https://cloud.google.com/about/locations/.
210 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
211 # hyphens (-). The maximum length is 100 characters.
212 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
213 # hyphens (-), or underscores (_). The maximum length is 500 characters.
214 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
215 #
216 # For App Engine queues, this is when the task will be attempted or retried.
217 #
218 # `schedule_time` will be truncated to the nearest microsecond.
219 &quot;httpRequest&quot;: { # HTTP request. # HTTP request that is sent to the task&#x27;s target.
220 #
221 # An HTTP task is a task that has HttpRequest set.
222 #
223 # The task will be pushed to the worker as an HTTP request. If the worker
224 # or the redirected worker acknowledges the task by returning a successful HTTP
225 # response code ([`200` - `299`]), the task will be removed from the queue. If
226 # any other HTTP response code is returned or no response is received, the
227 # task will be retried according to the following:
228 #
229 # * User-specified throttling: retry configuration,
230 # rate limits, and the queue&#x27;s state.
231 #
232 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
233 # temporarily reduce the queue&#x27;s effective rate. User-specified settings
234 # will not be changed.
235 #
236 # System throttling happens because:
237 #
238 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
239 # rate limits will be used. But if the worker returns
240 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
241 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
242 # specified in the `Retry-After` HTTP response header is considered.
243 #
244 # * To prevent traffic spikes and to smooth sudden increases in traffic,
245 # dispatches ramp up slowly when the queue is newly created or idle and
246 # if large numbers of tasks suddenly become available to dispatch (due to
247 # spikes in create task rates, the queue being unpaused, or many tasks
248 # that are scheduled at the same time).
249 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, an
250 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
251 # token will be generated and attached as an `Authorization` header in the
252 # HTTP request.
253 #
254 # This type of authorization can be used for many scenarios, including
255 # calling Cloud Run, or endpoints where you intend to validate the token
256 # yourself.
257 # [OpenID Connect
258 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
259 # This type of authorization can be used for many scenarios, including
260 # calling Cloud Run, or endpoints where you intend to validate the token
261 # yourself.
262 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
263 # to be used for generating OIDC token.
264 # The service account must be within the same project as the queue. The
265 # caller must have iam.serviceAccounts.actAs permission for the service
266 # account.
267 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. If not specified, the URI
268 # specified in target will be used.
269 },
270 &quot;oauthToken&quot;: { # Contains information needed for generating an # If specified, an
271 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
272 # will be generated and attached as an `Authorization` header in the HTTP
273 # request.
274 #
275 # This type of authorization should generally only be used when calling
276 # Google APIs hosted on *.googleapis.com.
277 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
278 # This type of authorization should generally only be used when calling Google
279 # APIs hosted on *.googleapis.com.
280 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
281 # to be used for generating OAuth token.
282 # The service account must be within the same project as the queue. The
283 # caller must have iam.serviceAccounts.actAs permission for the service
284 # account.
285 &quot;scope&quot;: &quot;A String&quot;, # OAuth scope to be used for generating OAuth access token.
286 # If not specified, &quot;https://www.googleapis.com/auth/cloud-platform&quot;
287 # will be used.
288 },
289 &quot;url&quot;: &quot;A String&quot;, # Required. The full url path that the request will be sent to.
290 #
291 # This string must begin with either &quot;http://&quot; or &quot;https://&quot;. Some examples
292 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
293 # encode some characters for safety and compatibility. The maximum allowed
294 # URL length is 2083 characters after encoding.
295 #
296 # The `Location` header response from a redirect response [`300` - `399`]
297 # may be followed. The redirect is not counted as a separate attempt.
298 &quot;headers&quot;: { # HTTP request headers.
299 #
300 # This map contains the header field names and values.
301 # Headers can be set when the
302 # task is created.
303 #
304 # These headers represent a subset of the headers that will accompany the
305 # task&#x27;s HTTP request. Some HTTP request headers will be ignored or replaced.
306 #
307 # A partial list of headers that will be ignored or replaced is:
308 #
309 # * Host: This will be computed by Cloud Tasks and derived from
310 # HttpRequest.url.
311 # * Content-Length: This will be computed by Cloud Tasks.
312 # * User-Agent: This will be set to `&quot;Google-Cloud-Tasks&quot;`.
313 # * X-Google-*: Google use only.
314 # * X-AppEngine-*: Google use only.
315 #
316 # `Content-Type` won&#x27;t be set by Cloud Tasks. You can explicitly set
317 # `Content-Type` to a media type when the
318 # task is created.
319 # For example, `Content-Type` can be set to `&quot;application/octet-stream&quot;` or
320 # `&quot;application/json&quot;`.
321 #
322 # Headers which can have multiple values (according to RFC2616) can be
323 # specified using comma-separated values.
324 #
325 # The size of the headers must be less than 80KB.
326 &quot;a_key&quot;: &quot;A String&quot;,
327 },
328 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
329 #
330 # A request body is allowed only if the
331 # HTTP method is POST, PUT, or PATCH. It is an
332 # error to set body on a task with an incompatible HttpMethod.
333 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
334 },
335 &quot;firstAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
336 #
337 # Only dispatch_time will be set.
338 # The other Attempt information is not retained by Cloud Tasks.
339 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
340 #
341 # `schedule_time` will be truncated to the nearest microsecond.
342 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
343 #
344 # `response_time` will be truncated to the nearest microsecond.
345 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
346 #
347 # `dispatch_time` will be truncated to the nearest microsecond.
348 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
349 #
350 # If `response_time` is unset, then the task has not been attempted or is
351 # currently running and the `response_status` field is meaningless.
352 # different programming environments, including REST APIs and RPC APIs. It is
353 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
354 # three pieces of data: error code, error message, and error details.
355 #
356 # You can find out more about this error model and how to work with it in the
357 # [API Design Guide](https://cloud.google.com/apis/design/errors).
358 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
359 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
360 # user-facing error message should be localized and sent in the
361 # google.rpc.Status.details field, or localized by the client.
362 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
363 # message types for APIs to use.
364 {
365 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
366 },
367 ],
368 },
369 },
370 &quot;dispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
371 #
372 # This count includes attempts which have been dispatched but haven&#x27;t
373 # received a response.
374 &quot;dispatchDeadline&quot;: &quot;A String&quot;, # The deadline for requests sent to the worker. If the worker does not
375 # respond by this deadline then the request is cancelled and the attempt
376 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
377 # task according to the RetryConfig.
378 #
379 # Note that when the request is cancelled, Cloud Tasks will stop listening
380 # for the response, but whether the worker stops processing depends on the
381 # worker. For example, if the worker is stuck, it may not react to cancelled
382 # requests.
383 #
384 # The default and maximum values depend on the type of request:
385 #
386 # * For HTTP tasks, the default is 10 minutes. The deadline
387 # must be in the interval [15 seconds, 30 minutes].
388 #
389 # * For App Engine tasks, 0 indicates that the
390 # request has the default deadline. The default deadline depends on the
391 # [scaling
392 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
393 # of the service: 10 minutes for standard apps with automatic scaling, 24
394 # hours for standard apps with manual and basic scaling, and 60 minutes for
395 # flex apps. If the request deadline is set, it must be in the interval [15
396 # seconds, 24 hours 15 seconds]. Regardless of the task&#x27;s
397 # `dispatch_deadline`, the app handler will not run for longer than than
398 # the service&#x27;s timeout. We recommend setting the `dispatch_deadline` to
399 # at most a few seconds more than the app handler&#x27;s timeout. For more
400 # information see
401 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
402 #
403 # `dispatch_deadline` will be truncated to the nearest millisecond. The
404 # deadline is an approximate deadline.
405 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
406 # been returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700407 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700408 #
409 # An App Engine task is a task that has AppEngineHttpRequest set.
410 #
411 # The message defines the HTTP request that is sent to an App Engine app when
412 # the task is dispatched.
413 #
414 # Using AppEngineHttpRequest requires
415 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
416 # Google IAM permission for the project
417 # and the following scope:
418 #
419 # `https://www.googleapis.com/auth/cloud-platform`
420 #
421 # The task will be delivered to the App Engine app which belongs to the same
422 # project as the queue. For more information, see
423 # [How Requests are
424 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
425 # and how routing is affected by
426 # [dispatch
427 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
428 # Traffic is encrypted during transport and never leaves Google datacenters.
429 # Because this traffic is carried over a communication mechanism internal to
430 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
431 # The request to the handler, however, will appear to have used the HTTP
432 # protocol.
433 #
434 # The AppEngineRouting used to construct the URL that the task is
435 # delivered to can be set at the queue-level or task-level:
436 #
437 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -0700438 # app_engine_routing_override
439 # is used for all tasks in the queue, no matter what the setting
440 # is for the
441 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700442 #
443 #
444 # The `url` that the task will be sent to is:
445 #
446 # * `url =` host `+`
447 # relative_uri
448 #
449 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
450 # URIs restricted with
451 # [`login:
452 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
453 # Because tasks are not run as any user, they cannot be dispatched to URIs
454 # restricted with
455 # [`login:
456 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
457 # Task dispatches also do not follow redirects.
458 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700459 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700460 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -0700461 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700462 # not receive response before the deadline. Failed
463 # tasks will be retried according to the
464 # retry configuration. `503` (Service Unavailable) is
465 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -0700466 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
467 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700468 # Requests) response from an app handler does not cause traffic congestion
469 # control to throttle the queue.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700470 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
471 #
472 # A request body is allowed only if the HTTP method is POST or PUT. It is
473 # an error to set a body on a task with an incompatible HttpMethod.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700474 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
475 #
476 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
477 # HTTP requests with this http_method, otherwise the task attempt fails with
478 # error code 405 (Method Not Allowed). See [Writing a push task request
479 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
480 # and the App Engine documentation for your runtime on [How Requests are
481 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700482 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700483 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700484 # If set,
485 # app_engine_routing_override
486 # is used for all tasks in the queue, no matter what the setting is for the
487 # task-level app_engine_routing.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700488 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700489 # Defines routing characteristics specific to App Engine - service, version,
490 # and instance.
491 #
492 # For more information about services, versions, and instances see
493 # [An Overview of App
494 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
495 # [Microservices Architecture on Google App
496 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
497 # [App Engine Standard request
498 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
499 # and [App Engine Flex request
500 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
501 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
502 #
503 # The host is constructed from the domain name of the app associated with
504 # the queue&#x27;s project ID (for example &lt;app-id&gt;.appspot.com), and the
505 # service, version,
506 # and instance. Tasks which were created using
507 # the App Engine SDK might have a custom domain name.
508 #
509 # For more information, see
510 # [How Requests are
511 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
512 &quot;instance&quot;: &quot;A String&quot;, # App instance.
513 #
514 # By default, the task is sent to an instance which is available when
515 # the task is attempted.
516 #
517 # Requests can only be sent to a specific instance if
518 # [manual scaling is used in App Engine
519 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
520 # App Engine Flex does not support instances. For more information, see
521 # [App Engine Standard request
522 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
523 # and [App Engine Flex request
524 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
525 &quot;service&quot;: &quot;A String&quot;, # App service.
526 #
527 # By default, the task is sent to the service which is the default
528 # service when the task is attempted.
529 #
530 # For some queues or tasks which were created using the App Engine
531 # Task Queue API, host is not parsable
532 # into service,
533 # version, and
534 # instance. For example, some tasks
535 # which were created using the App Engine SDK use a custom domain
536 # name; custom domains are not parsed by Cloud Tasks. If
537 # host is not parsable, then
538 # service,
539 # version, and
540 # instance are the empty string.
541 &quot;version&quot;: &quot;A String&quot;, # App version.
542 #
543 # By default, the task is sent to the version which is the default
544 # version when the task is attempted.
545 #
546 # For some queues or tasks which were created using the App Engine
547 # Task Queue API, host is not parsable
548 # into service,
549 # version, and
550 # instance. For example, some tasks
551 # which were created using the App Engine SDK use a custom domain
552 # name; custom domains are not parsed by Cloud Tasks. If
553 # host is not parsable, then
554 # service,
555 # version, and
556 # instance are the empty string.
557 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700558 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700559 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700560 # This map contains the header field names and values.
561 # Headers can be set when the
562 # task is created.
563 # Repeated headers are not supported but a header value can contain commas.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700564 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700565 # Cloud Tasks sets some headers to default values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700566 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700567 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -0700568 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700569 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -0700570 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -0700571 # modified `User-Agent`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700572 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700573 # If the task has a body, Cloud
574 # Tasks sets the following headers:
575 #
576 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -0700577 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -0700578 # setting `Content-Type` to a particular media type when the
579 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -0700580 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700581 # * `Content-Length`: This is computed by Cloud Tasks. This value is
582 # output only. It cannot be changed.
583 #
584 # The headers below cannot be set or overridden:
585 #
586 # * `Host`
587 # * `X-Google-*`
588 # * `X-AppEngine-*`
589 #
590 # In addition, Cloud Tasks sets some headers when the task is dispatched,
591 # such as headers containing information about the task; see
592 # [request
593 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
594 # These headers are set only when the task is dispatched, so they are not
595 # visible when the task is returned in a Cloud Tasks response.
596 #
597 # Although there is no specific limit for the maximum number of headers or
598 # the size, there is a limit on the maximum size of the Task. For more
599 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700600 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700601 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700602 &quot;relativeUri&quot;: &quot;A String&quot;, # The relative URI.
Bu Sun Kim65020912020-05-20 12:08:20 -0700603 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700604 # The relative URI must begin with &quot;/&quot; and must be a valid HTTP relative URI.
605 # It can contain a path and query string arguments.
606 # If the relative URI is empty, then the root path &quot;/&quot; will be used.
607 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700608 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700609 },
610 }
611
612 x__xgafv: string, V1 error format.
613 Allowed values
614 1 - v1 error format
615 2 - v2 error format
616
617Returns:
618 An object of the form:
619
620 { # A unit of scheduled work.
Bu Sun Kim65020912020-05-20 12:08:20 -0700621 &quot;responseCount&quot;: 42, # Output only. The number of attempts which have received a response.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700622 &quot;lastAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
623 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
624 #
625 # `schedule_time` will be truncated to the nearest microsecond.
626 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
627 #
628 # `response_time` will be truncated to the nearest microsecond.
629 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
630 #
631 # `dispatch_time` will be truncated to the nearest microsecond.
632 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
633 #
634 # If `response_time` is unset, then the task has not been attempted or is
635 # currently running and the `response_status` field is meaningless.
636 # different programming environments, including REST APIs and RPC APIs. It is
637 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
638 # three pieces of data: error code, error message, and error details.
639 #
640 # You can find out more about this error model and how to work with it in the
641 # [API Design Guide](https://cloud.google.com/apis/design/errors).
642 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
643 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
644 # user-facing error message should be localized and sent in the
645 # google.rpc.Status.details field, or localized by the client.
646 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
647 # message types for APIs to use.
648 {
649 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
650 },
651 ],
652 },
653 },
654 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
655 #
656 # `create_time` will be truncated to the nearest second.
657 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
658 #
659 # The task name.
660 #
661 # The task name must have the following format:
662 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
663 #
664 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
665 # hyphens (-), colons (:), or periods (.).
666 # For more information, see
667 # [Identifying
668 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
669 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
670 # The list of available locations can be obtained by calling
671 # ListLocations.
672 # For more information, see https://cloud.google.com/about/locations/.
673 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
674 # hyphens (-). The maximum length is 100 characters.
675 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
676 # hyphens (-), or underscores (_). The maximum length is 500 characters.
677 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
678 #
679 # For App Engine queues, this is when the task will be attempted or retried.
680 #
681 # `schedule_time` will be truncated to the nearest microsecond.
682 &quot;httpRequest&quot;: { # HTTP request. # HTTP request that is sent to the task&#x27;s target.
683 #
684 # An HTTP task is a task that has HttpRequest set.
685 #
686 # The task will be pushed to the worker as an HTTP request. If the worker
687 # or the redirected worker acknowledges the task by returning a successful HTTP
688 # response code ([`200` - `299`]), the task will be removed from the queue. If
689 # any other HTTP response code is returned or no response is received, the
690 # task will be retried according to the following:
691 #
692 # * User-specified throttling: retry configuration,
693 # rate limits, and the queue&#x27;s state.
694 #
695 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
696 # temporarily reduce the queue&#x27;s effective rate. User-specified settings
697 # will not be changed.
698 #
699 # System throttling happens because:
700 #
701 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
702 # rate limits will be used. But if the worker returns
703 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
704 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
705 # specified in the `Retry-After` HTTP response header is considered.
706 #
707 # * To prevent traffic spikes and to smooth sudden increases in traffic,
708 # dispatches ramp up slowly when the queue is newly created or idle and
709 # if large numbers of tasks suddenly become available to dispatch (due to
710 # spikes in create task rates, the queue being unpaused, or many tasks
711 # that are scheduled at the same time).
712 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, an
713 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
714 # token will be generated and attached as an `Authorization` header in the
715 # HTTP request.
716 #
717 # This type of authorization can be used for many scenarios, including
718 # calling Cloud Run, or endpoints where you intend to validate the token
719 # yourself.
720 # [OpenID Connect
721 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
722 # This type of authorization can be used for many scenarios, including
723 # calling Cloud Run, or endpoints where you intend to validate the token
724 # yourself.
725 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
726 # to be used for generating OIDC token.
727 # The service account must be within the same project as the queue. The
728 # caller must have iam.serviceAccounts.actAs permission for the service
729 # account.
730 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. If not specified, the URI
731 # specified in target will be used.
732 },
733 &quot;oauthToken&quot;: { # Contains information needed for generating an # If specified, an
734 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
735 # will be generated and attached as an `Authorization` header in the HTTP
736 # request.
737 #
738 # This type of authorization should generally only be used when calling
739 # Google APIs hosted on *.googleapis.com.
740 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
741 # This type of authorization should generally only be used when calling Google
742 # APIs hosted on *.googleapis.com.
743 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
744 # to be used for generating OAuth token.
745 # The service account must be within the same project as the queue. The
746 # caller must have iam.serviceAccounts.actAs permission for the service
747 # account.
748 &quot;scope&quot;: &quot;A String&quot;, # OAuth scope to be used for generating OAuth access token.
749 # If not specified, &quot;https://www.googleapis.com/auth/cloud-platform&quot;
750 # will be used.
751 },
752 &quot;url&quot;: &quot;A String&quot;, # Required. The full url path that the request will be sent to.
753 #
754 # This string must begin with either &quot;http://&quot; or &quot;https://&quot;. Some examples
755 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
756 # encode some characters for safety and compatibility. The maximum allowed
757 # URL length is 2083 characters after encoding.
758 #
759 # The `Location` header response from a redirect response [`300` - `399`]
760 # may be followed. The redirect is not counted as a separate attempt.
761 &quot;headers&quot;: { # HTTP request headers.
762 #
763 # This map contains the header field names and values.
764 # Headers can be set when the
765 # task is created.
766 #
767 # These headers represent a subset of the headers that will accompany the
768 # task&#x27;s HTTP request. Some HTTP request headers will be ignored or replaced.
769 #
770 # A partial list of headers that will be ignored or replaced is:
771 #
772 # * Host: This will be computed by Cloud Tasks and derived from
773 # HttpRequest.url.
774 # * Content-Length: This will be computed by Cloud Tasks.
775 # * User-Agent: This will be set to `&quot;Google-Cloud-Tasks&quot;`.
776 # * X-Google-*: Google use only.
777 # * X-AppEngine-*: Google use only.
778 #
779 # `Content-Type` won&#x27;t be set by Cloud Tasks. You can explicitly set
780 # `Content-Type` to a media type when the
781 # task is created.
782 # For example, `Content-Type` can be set to `&quot;application/octet-stream&quot;` or
783 # `&quot;application/json&quot;`.
784 #
785 # Headers which can have multiple values (according to RFC2616) can be
786 # specified using comma-separated values.
787 #
788 # The size of the headers must be less than 80KB.
789 &quot;a_key&quot;: &quot;A String&quot;,
790 },
791 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
792 #
793 # A request body is allowed only if the
794 # HTTP method is POST, PUT, or PATCH. It is an
795 # error to set body on a task with an incompatible HttpMethod.
796 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
797 },
798 &quot;firstAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
799 #
800 # Only dispatch_time will be set.
801 # The other Attempt information is not retained by Cloud Tasks.
802 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
803 #
804 # `schedule_time` will be truncated to the nearest microsecond.
805 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
806 #
807 # `response_time` will be truncated to the nearest microsecond.
808 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
809 #
810 # `dispatch_time` will be truncated to the nearest microsecond.
811 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
812 #
813 # If `response_time` is unset, then the task has not been attempted or is
814 # currently running and the `response_status` field is meaningless.
815 # different programming environments, including REST APIs and RPC APIs. It is
816 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
817 # three pieces of data: error code, error message, and error details.
818 #
819 # You can find out more about this error model and how to work with it in the
820 # [API Design Guide](https://cloud.google.com/apis/design/errors).
821 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
822 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
823 # user-facing error message should be localized and sent in the
824 # google.rpc.Status.details field, or localized by the client.
825 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
826 # message types for APIs to use.
827 {
828 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
829 },
830 ],
831 },
832 },
833 &quot;dispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
834 #
835 # This count includes attempts which have been dispatched but haven&#x27;t
836 # received a response.
837 &quot;dispatchDeadline&quot;: &quot;A String&quot;, # The deadline for requests sent to the worker. If the worker does not
838 # respond by this deadline then the request is cancelled and the attempt
839 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
840 # task according to the RetryConfig.
841 #
842 # Note that when the request is cancelled, Cloud Tasks will stop listening
843 # for the response, but whether the worker stops processing depends on the
844 # worker. For example, if the worker is stuck, it may not react to cancelled
845 # requests.
846 #
847 # The default and maximum values depend on the type of request:
848 #
849 # * For HTTP tasks, the default is 10 minutes. The deadline
850 # must be in the interval [15 seconds, 30 minutes].
851 #
852 # * For App Engine tasks, 0 indicates that the
853 # request has the default deadline. The default deadline depends on the
854 # [scaling
855 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
856 # of the service: 10 minutes for standard apps with automatic scaling, 24
857 # hours for standard apps with manual and basic scaling, and 60 minutes for
858 # flex apps. If the request deadline is set, it must be in the interval [15
859 # seconds, 24 hours 15 seconds]. Regardless of the task&#x27;s
860 # `dispatch_deadline`, the app handler will not run for longer than than
861 # the service&#x27;s timeout. We recommend setting the `dispatch_deadline` to
862 # at most a few seconds more than the app handler&#x27;s timeout. For more
863 # information see
864 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
865 #
866 # `dispatch_deadline` will be truncated to the nearest millisecond. The
867 # deadline is an approximate deadline.
868 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
869 # been returned.
Bu Sun Kim65020912020-05-20 12:08:20 -0700870 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700871 #
872 # An App Engine task is a task that has AppEngineHttpRequest set.
873 #
874 # The message defines the HTTP request that is sent to an App Engine app when
875 # the task is dispatched.
876 #
877 # Using AppEngineHttpRequest requires
878 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
879 # Google IAM permission for the project
880 # and the following scope:
881 #
882 # `https://www.googleapis.com/auth/cloud-platform`
883 #
884 # The task will be delivered to the App Engine app which belongs to the same
885 # project as the queue. For more information, see
886 # [How Requests are
887 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
888 # and how routing is affected by
889 # [dispatch
890 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
891 # Traffic is encrypted during transport and never leaves Google datacenters.
892 # Because this traffic is carried over a communication mechanism internal to
893 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
894 # The request to the handler, however, will appear to have used the HTTP
895 # protocol.
896 #
897 # The AppEngineRouting used to construct the URL that the task is
898 # delivered to can be set at the queue-level or task-level:
899 #
900 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -0700901 # app_engine_routing_override
902 # is used for all tasks in the queue, no matter what the setting
903 # is for the
904 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700905 #
906 #
907 # The `url` that the task will be sent to is:
908 #
909 # * `url =` host `+`
910 # relative_uri
911 #
912 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
913 # URIs restricted with
914 # [`login:
915 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
916 # Because tasks are not run as any user, they cannot be dispatched to URIs
917 # restricted with
918 # [`login:
919 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
920 # Task dispatches also do not follow redirects.
921 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700922 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700923 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -0700924 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700925 # not receive response before the deadline. Failed
926 # tasks will be retried according to the
927 # retry configuration. `503` (Service Unavailable) is
928 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -0700929 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
930 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700931 # Requests) response from an app handler does not cause traffic congestion
932 # control to throttle the queue.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700933 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
934 #
935 # A request body is allowed only if the HTTP method is POST or PUT. It is
936 # an error to set a body on a task with an incompatible HttpMethod.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700937 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
938 #
939 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
940 # HTTP requests with this http_method, otherwise the task attempt fails with
941 # error code 405 (Method Not Allowed). See [Writing a push task request
942 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
943 # and the App Engine documentation for your runtime on [How Requests are
944 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700945 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700946 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700947 # If set,
948 # app_engine_routing_override
949 # is used for all tasks in the queue, no matter what the setting is for the
950 # task-level app_engine_routing.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700951 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700952 # Defines routing characteristics specific to App Engine - service, version,
953 # and instance.
954 #
955 # For more information about services, versions, and instances see
956 # [An Overview of App
957 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
958 # [Microservices Architecture on Google App
959 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
960 # [App Engine Standard request
961 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
962 # and [App Engine Flex request
963 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
964 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
965 #
966 # The host is constructed from the domain name of the app associated with
967 # the queue&#x27;s project ID (for example &lt;app-id&gt;.appspot.com), and the
968 # service, version,
969 # and instance. Tasks which were created using
970 # the App Engine SDK might have a custom domain name.
971 #
972 # For more information, see
973 # [How Requests are
974 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
975 &quot;instance&quot;: &quot;A String&quot;, # App instance.
976 #
977 # By default, the task is sent to an instance which is available when
978 # the task is attempted.
979 #
980 # Requests can only be sent to a specific instance if
981 # [manual scaling is used in App Engine
982 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
983 # App Engine Flex does not support instances. For more information, see
984 # [App Engine Standard request
985 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
986 # and [App Engine Flex request
987 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
988 &quot;service&quot;: &quot;A String&quot;, # App service.
989 #
990 # By default, the task is sent to the service which is the default
991 # service when the task is attempted.
992 #
993 # For some queues or tasks which were created using the App Engine
994 # Task Queue API, host is not parsable
995 # into service,
996 # version, and
997 # instance. For example, some tasks
998 # which were created using the App Engine SDK use a custom domain
999 # name; custom domains are not parsed by Cloud Tasks. If
1000 # host is not parsable, then
1001 # service,
1002 # version, and
1003 # instance are the empty string.
1004 &quot;version&quot;: &quot;A String&quot;, # App version.
1005 #
1006 # By default, the task is sent to the version which is the default
1007 # version when the task is attempted.
1008 #
1009 # For some queues or tasks which were created using the App Engine
1010 # Task Queue API, host is not parsable
1011 # into service,
1012 # version, and
1013 # instance. For example, some tasks
1014 # which were created using the App Engine SDK use a custom domain
1015 # name; custom domains are not parsed by Cloud Tasks. If
1016 # host is not parsable, then
1017 # service,
1018 # version, and
1019 # instance are the empty string.
1020 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001021 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001022 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001023 # This map contains the header field names and values.
1024 # Headers can be set when the
1025 # task is created.
1026 # Repeated headers are not supported but a header value can contain commas.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001027 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001028 # Cloud Tasks sets some headers to default values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001029 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001030 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07001031 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07001032 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07001033 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -07001034 # modified `User-Agent`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001035 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001036 # If the task has a body, Cloud
1037 # Tasks sets the following headers:
1038 #
1039 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07001040 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -07001041 # setting `Content-Type` to a particular media type when the
1042 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07001043 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07001044 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1045 # output only. It cannot be changed.
1046 #
1047 # The headers below cannot be set or overridden:
1048 #
1049 # * `Host`
1050 # * `X-Google-*`
1051 # * `X-AppEngine-*`
1052 #
1053 # In addition, Cloud Tasks sets some headers when the task is dispatched,
1054 # such as headers containing information about the task; see
1055 # [request
1056 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
1057 # These headers are set only when the task is dispatched, so they are not
1058 # visible when the task is returned in a Cloud Tasks response.
1059 #
1060 # Although there is no specific limit for the maximum number of headers or
1061 # the size, there is a limit on the maximum size of the Task. For more
1062 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07001063 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001064 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001065 &quot;relativeUri&quot;: &quot;A String&quot;, # The relative URI.
Bu Sun Kim65020912020-05-20 12:08:20 -07001066 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001067 # The relative URI must begin with &quot;/&quot; and must be a valid HTTP relative URI.
1068 # It can contain a path and query string arguments.
1069 # If the relative URI is empty, then the root path &quot;/&quot; will be used.
1070 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001071 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001072 }</pre>
1073</div>
1074
1075<div class="method">
1076 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
1077 <pre>Deletes a task.
1078
1079A task can be deleted if it is scheduled or dispatched. A task
1080cannot be deleted if it has executed successfully or permanently
1081failed.
1082
1083Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001084 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001085`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
1086 x__xgafv: string, V1 error format.
1087 Allowed values
1088 1 - v1 error format
1089 2 - v2 error format
1090
1091Returns:
1092 An object of the form:
1093
1094 { # A generic empty message that you can re-use to avoid defining duplicated
1095 # empty messages in your APIs. A typical example is to use it as the request
1096 # or the response type of an API method. For instance:
1097 #
1098 # service Foo {
1099 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
1100 # }
1101 #
1102 # The JSON representation for `Empty` is empty JSON object `{}`.
1103 }</pre>
1104</div>
1105
1106<div class="method">
1107 <code class="details" id="get">get(name, responseView=None, x__xgafv=None)</code>
1108 <pre>Gets a task.
1109
1110Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001111 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001112`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
1113 responseView: string, The response_view specifies which subset of the Task will be
1114returned.
1115
1116By default response_view is BASIC; not all
1117information is retrieved by default because some data, such as
1118payloads, might be desirable to return only when needed because
1119of its large size or because of the sensitivity of data that it
1120contains.
1121
1122Authorization for FULL requires
1123`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1124permission on the Task resource.
1125 x__xgafv: string, V1 error format.
1126 Allowed values
1127 1 - v1 error format
1128 2 - v2 error format
1129
1130Returns:
1131 An object of the form:
1132
1133 { # A unit of scheduled work.
Bu Sun Kim65020912020-05-20 12:08:20 -07001134 &quot;responseCount&quot;: 42, # Output only. The number of attempts which have received a response.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001135 &quot;lastAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
1136 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1137 #
1138 # `schedule_time` will be truncated to the nearest microsecond.
1139 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1140 #
1141 # `response_time` will be truncated to the nearest microsecond.
1142 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1143 #
1144 # `dispatch_time` will be truncated to the nearest microsecond.
1145 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
1146 #
1147 # If `response_time` is unset, then the task has not been attempted or is
1148 # currently running and the `response_status` field is meaningless.
1149 # different programming environments, including REST APIs and RPC APIs. It is
1150 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1151 # three pieces of data: error code, error message, and error details.
1152 #
1153 # You can find out more about this error model and how to work with it in the
1154 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1155 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1156 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1157 # user-facing error message should be localized and sent in the
1158 # google.rpc.Status.details field, or localized by the client.
1159 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1160 # message types for APIs to use.
1161 {
1162 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1163 },
1164 ],
1165 },
1166 },
1167 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
1168 #
1169 # `create_time` will be truncated to the nearest second.
1170 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
1171 #
1172 # The task name.
1173 #
1174 # The task name must have the following format:
1175 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1176 #
1177 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1178 # hyphens (-), colons (:), or periods (.).
1179 # For more information, see
1180 # [Identifying
1181 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1182 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
1183 # The list of available locations can be obtained by calling
1184 # ListLocations.
1185 # For more information, see https://cloud.google.com/about/locations/.
1186 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1187 # hyphens (-). The maximum length is 100 characters.
1188 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1189 # hyphens (-), or underscores (_). The maximum length is 500 characters.
1190 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
1191 #
1192 # For App Engine queues, this is when the task will be attempted or retried.
1193 #
1194 # `schedule_time` will be truncated to the nearest microsecond.
1195 &quot;httpRequest&quot;: { # HTTP request. # HTTP request that is sent to the task&#x27;s target.
1196 #
1197 # An HTTP task is a task that has HttpRequest set.
1198 #
1199 # The task will be pushed to the worker as an HTTP request. If the worker
1200 # or the redirected worker acknowledges the task by returning a successful HTTP
1201 # response code ([`200` - `299`]), the task will be removed from the queue. If
1202 # any other HTTP response code is returned or no response is received, the
1203 # task will be retried according to the following:
1204 #
1205 # * User-specified throttling: retry configuration,
1206 # rate limits, and the queue&#x27;s state.
1207 #
1208 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
1209 # temporarily reduce the queue&#x27;s effective rate. User-specified settings
1210 # will not be changed.
1211 #
1212 # System throttling happens because:
1213 #
1214 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
1215 # rate limits will be used. But if the worker returns
1216 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
1217 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
1218 # specified in the `Retry-After` HTTP response header is considered.
1219 #
1220 # * To prevent traffic spikes and to smooth sudden increases in traffic,
1221 # dispatches ramp up slowly when the queue is newly created or idle and
1222 # if large numbers of tasks suddenly become available to dispatch (due to
1223 # spikes in create task rates, the queue being unpaused, or many tasks
1224 # that are scheduled at the same time).
1225 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, an
1226 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
1227 # token will be generated and attached as an `Authorization` header in the
1228 # HTTP request.
1229 #
1230 # This type of authorization can be used for many scenarios, including
1231 # calling Cloud Run, or endpoints where you intend to validate the token
1232 # yourself.
1233 # [OpenID Connect
1234 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
1235 # This type of authorization can be used for many scenarios, including
1236 # calling Cloud Run, or endpoints where you intend to validate the token
1237 # yourself.
1238 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
1239 # to be used for generating OIDC token.
1240 # The service account must be within the same project as the queue. The
1241 # caller must have iam.serviceAccounts.actAs permission for the service
1242 # account.
1243 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. If not specified, the URI
1244 # specified in target will be used.
1245 },
1246 &quot;oauthToken&quot;: { # Contains information needed for generating an # If specified, an
1247 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
1248 # will be generated and attached as an `Authorization` header in the HTTP
1249 # request.
1250 #
1251 # This type of authorization should generally only be used when calling
1252 # Google APIs hosted on *.googleapis.com.
1253 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
1254 # This type of authorization should generally only be used when calling Google
1255 # APIs hosted on *.googleapis.com.
1256 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
1257 # to be used for generating OAuth token.
1258 # The service account must be within the same project as the queue. The
1259 # caller must have iam.serviceAccounts.actAs permission for the service
1260 # account.
1261 &quot;scope&quot;: &quot;A String&quot;, # OAuth scope to be used for generating OAuth access token.
1262 # If not specified, &quot;https://www.googleapis.com/auth/cloud-platform&quot;
1263 # will be used.
1264 },
1265 &quot;url&quot;: &quot;A String&quot;, # Required. The full url path that the request will be sent to.
1266 #
1267 # This string must begin with either &quot;http://&quot; or &quot;https://&quot;. Some examples
1268 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
1269 # encode some characters for safety and compatibility. The maximum allowed
1270 # URL length is 2083 characters after encoding.
1271 #
1272 # The `Location` header response from a redirect response [`300` - `399`]
1273 # may be followed. The redirect is not counted as a separate attempt.
1274 &quot;headers&quot;: { # HTTP request headers.
1275 #
1276 # This map contains the header field names and values.
1277 # Headers can be set when the
1278 # task is created.
1279 #
1280 # These headers represent a subset of the headers that will accompany the
1281 # task&#x27;s HTTP request. Some HTTP request headers will be ignored or replaced.
1282 #
1283 # A partial list of headers that will be ignored or replaced is:
1284 #
1285 # * Host: This will be computed by Cloud Tasks and derived from
1286 # HttpRequest.url.
1287 # * Content-Length: This will be computed by Cloud Tasks.
1288 # * User-Agent: This will be set to `&quot;Google-Cloud-Tasks&quot;`.
1289 # * X-Google-*: Google use only.
1290 # * X-AppEngine-*: Google use only.
1291 #
1292 # `Content-Type` won&#x27;t be set by Cloud Tasks. You can explicitly set
1293 # `Content-Type` to a media type when the
1294 # task is created.
1295 # For example, `Content-Type` can be set to `&quot;application/octet-stream&quot;` or
1296 # `&quot;application/json&quot;`.
1297 #
1298 # Headers which can have multiple values (according to RFC2616) can be
1299 # specified using comma-separated values.
1300 #
1301 # The size of the headers must be less than 80KB.
1302 &quot;a_key&quot;: &quot;A String&quot;,
1303 },
1304 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
1305 #
1306 # A request body is allowed only if the
1307 # HTTP method is POST, PUT, or PATCH. It is an
1308 # error to set body on a task with an incompatible HttpMethod.
1309 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
1310 },
1311 &quot;firstAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
1312 #
1313 # Only dispatch_time will be set.
1314 # The other Attempt information is not retained by Cloud Tasks.
1315 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1316 #
1317 # `schedule_time` will be truncated to the nearest microsecond.
1318 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1319 #
1320 # `response_time` will be truncated to the nearest microsecond.
1321 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1322 #
1323 # `dispatch_time` will be truncated to the nearest microsecond.
1324 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
1325 #
1326 # If `response_time` is unset, then the task has not been attempted or is
1327 # currently running and the `response_status` field is meaningless.
1328 # different programming environments, including REST APIs and RPC APIs. It is
1329 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1330 # three pieces of data: error code, error message, and error details.
1331 #
1332 # You can find out more about this error model and how to work with it in the
1333 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1334 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1335 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1336 # user-facing error message should be localized and sent in the
1337 # google.rpc.Status.details field, or localized by the client.
1338 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1339 # message types for APIs to use.
1340 {
1341 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1342 },
1343 ],
1344 },
1345 },
1346 &quot;dispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
1347 #
1348 # This count includes attempts which have been dispatched but haven&#x27;t
1349 # received a response.
1350 &quot;dispatchDeadline&quot;: &quot;A String&quot;, # The deadline for requests sent to the worker. If the worker does not
1351 # respond by this deadline then the request is cancelled and the attempt
1352 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
1353 # task according to the RetryConfig.
1354 #
1355 # Note that when the request is cancelled, Cloud Tasks will stop listening
1356 # for the response, but whether the worker stops processing depends on the
1357 # worker. For example, if the worker is stuck, it may not react to cancelled
1358 # requests.
1359 #
1360 # The default and maximum values depend on the type of request:
1361 #
1362 # * For HTTP tasks, the default is 10 minutes. The deadline
1363 # must be in the interval [15 seconds, 30 minutes].
1364 #
1365 # * For App Engine tasks, 0 indicates that the
1366 # request has the default deadline. The default deadline depends on the
1367 # [scaling
1368 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
1369 # of the service: 10 minutes for standard apps with automatic scaling, 24
1370 # hours for standard apps with manual and basic scaling, and 60 minutes for
1371 # flex apps. If the request deadline is set, it must be in the interval [15
1372 # seconds, 24 hours 15 seconds]. Regardless of the task&#x27;s
1373 # `dispatch_deadline`, the app handler will not run for longer than than
1374 # the service&#x27;s timeout. We recommend setting the `dispatch_deadline` to
1375 # at most a few seconds more than the app handler&#x27;s timeout. For more
1376 # information see
1377 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
1378 #
1379 # `dispatch_deadline` will be truncated to the nearest millisecond. The
1380 # deadline is an approximate deadline.
1381 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
1382 # been returned.
Bu Sun Kim65020912020-05-20 12:08:20 -07001383 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001384 #
1385 # An App Engine task is a task that has AppEngineHttpRequest set.
1386 #
1387 # The message defines the HTTP request that is sent to an App Engine app when
1388 # the task is dispatched.
1389 #
1390 # Using AppEngineHttpRequest requires
1391 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1392 # Google IAM permission for the project
1393 # and the following scope:
1394 #
1395 # `https://www.googleapis.com/auth/cloud-platform`
1396 #
1397 # The task will be delivered to the App Engine app which belongs to the same
1398 # project as the queue. For more information, see
1399 # [How Requests are
1400 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1401 # and how routing is affected by
1402 # [dispatch
1403 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
1404 # Traffic is encrypted during transport and never leaves Google datacenters.
1405 # Because this traffic is carried over a communication mechanism internal to
1406 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
1407 # The request to the handler, however, will appear to have used the HTTP
1408 # protocol.
1409 #
1410 # The AppEngineRouting used to construct the URL that the task is
1411 # delivered to can be set at the queue-level or task-level:
1412 #
1413 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07001414 # app_engine_routing_override
1415 # is used for all tasks in the queue, no matter what the setting
1416 # is for the
1417 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001418 #
1419 #
1420 # The `url` that the task will be sent to is:
1421 #
1422 # * `url =` host `+`
1423 # relative_uri
1424 #
1425 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
1426 # URIs restricted with
1427 # [`login:
1428 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
1429 # Because tasks are not run as any user, they cannot be dispatched to URIs
1430 # restricted with
1431 # [`login:
1432 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
1433 # Task dispatches also do not follow redirects.
1434 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001435 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001436 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07001437 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001438 # not receive response before the deadline. Failed
1439 # tasks will be retried according to the
1440 # retry configuration. `503` (Service Unavailable) is
1441 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07001442 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
1443 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001444 # Requests) response from an app handler does not cause traffic congestion
1445 # control to throttle the queue.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001446 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
1447 #
1448 # A request body is allowed only if the HTTP method is POST or PUT. It is
1449 # an error to set a body on a task with an incompatible HttpMethod.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001450 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
1451 #
1452 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
1453 # HTTP requests with this http_method, otherwise the task attempt fails with
1454 # error code 405 (Method Not Allowed). See [Writing a push task request
1455 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
1456 # and the App Engine documentation for your runtime on [How Requests are
1457 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001458 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001459 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001460 # If set,
1461 # app_engine_routing_override
1462 # is used for all tasks in the queue, no matter what the setting is for the
1463 # task-level app_engine_routing.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001464 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001465 # Defines routing characteristics specific to App Engine - service, version,
1466 # and instance.
1467 #
1468 # For more information about services, versions, and instances see
1469 # [An Overview of App
1470 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
1471 # [Microservices Architecture on Google App
1472 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
1473 # [App Engine Standard request
1474 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
1475 # and [App Engine Flex request
1476 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1477 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
1478 #
1479 # The host is constructed from the domain name of the app associated with
1480 # the queue&#x27;s project ID (for example &lt;app-id&gt;.appspot.com), and the
1481 # service, version,
1482 # and instance. Tasks which were created using
1483 # the App Engine SDK might have a custom domain name.
1484 #
1485 # For more information, see
1486 # [How Requests are
1487 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
1488 &quot;instance&quot;: &quot;A String&quot;, # App instance.
1489 #
1490 # By default, the task is sent to an instance which is available when
1491 # the task is attempted.
1492 #
1493 # Requests can only be sent to a specific instance if
1494 # [manual scaling is used in App Engine
1495 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
1496 # App Engine Flex does not support instances. For more information, see
1497 # [App Engine Standard request
1498 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1499 # and [App Engine Flex request
1500 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1501 &quot;service&quot;: &quot;A String&quot;, # App service.
1502 #
1503 # By default, the task is sent to the service which is the default
1504 # service when the task is attempted.
1505 #
1506 # For some queues or tasks which were created using the App Engine
1507 # Task Queue API, host is not parsable
1508 # into service,
1509 # version, and
1510 # instance. For example, some tasks
1511 # which were created using the App Engine SDK use a custom domain
1512 # name; custom domains are not parsed by Cloud Tasks. If
1513 # host is not parsable, then
1514 # service,
1515 # version, and
1516 # instance are the empty string.
1517 &quot;version&quot;: &quot;A String&quot;, # App version.
1518 #
1519 # By default, the task is sent to the version which is the default
1520 # version when the task is attempted.
1521 #
1522 # For some queues or tasks which were created using the App Engine
1523 # Task Queue API, host is not parsable
1524 # into service,
1525 # version, and
1526 # instance. For example, some tasks
1527 # which were created using the App Engine SDK use a custom domain
1528 # name; custom domains are not parsed by Cloud Tasks. If
1529 # host is not parsable, then
1530 # service,
1531 # version, and
1532 # instance are the empty string.
1533 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001534 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001535 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001536 # This map contains the header field names and values.
1537 # Headers can be set when the
1538 # task is created.
1539 # Repeated headers are not supported but a header value can contain commas.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001540 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001541 # Cloud Tasks sets some headers to default values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001542 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001543 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07001544 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07001545 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07001546 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -07001547 # modified `User-Agent`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001548 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001549 # If the task has a body, Cloud
1550 # Tasks sets the following headers:
1551 #
1552 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07001553 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -07001554 # setting `Content-Type` to a particular media type when the
1555 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07001556 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07001557 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1558 # output only. It cannot be changed.
1559 #
1560 # The headers below cannot be set or overridden:
1561 #
1562 # * `Host`
1563 # * `X-Google-*`
1564 # * `X-AppEngine-*`
1565 #
1566 # In addition, Cloud Tasks sets some headers when the task is dispatched,
1567 # such as headers containing information about the task; see
1568 # [request
1569 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
1570 # These headers are set only when the task is dispatched, so they are not
1571 # visible when the task is returned in a Cloud Tasks response.
1572 #
1573 # Although there is no specific limit for the maximum number of headers or
1574 # the size, there is a limit on the maximum size of the Task. For more
1575 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07001576 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001577 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001578 &quot;relativeUri&quot;: &quot;A String&quot;, # The relative URI.
Bu Sun Kim65020912020-05-20 12:08:20 -07001579 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001580 # The relative URI must begin with &quot;/&quot; and must be a valid HTTP relative URI.
1581 # It can contain a path and query string arguments.
1582 # If the relative URI is empty, then the root path &quot;/&quot; will be used.
1583 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001584 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001585 }</pre>
1586</div>
1587
1588<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001589 <code class="details" id="list">list(parent, responseView=None, pageSize=None, pageToken=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001590 <pre>Lists the tasks in a queue.
1591
1592By default, only the BASIC view is retrieved
1593due to performance considerations;
1594response_view controls the
1595subset of information which is returned.
1596
1597The tasks may be returned in any order. The ordering may change at any
1598time.
1599
1600Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001601 parent: string, Required. The queue name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001602`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` (required)
1603 responseView: string, The response_view specifies which subset of the Task will be
1604returned.
1605
1606By default response_view is BASIC; not all
1607information is retrieved by default because some data, such as
1608payloads, might be desirable to return only when needed because
1609of its large size or because of the sensitivity of data that it
1610contains.
1611
1612Authorization for FULL requires
1613`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1614permission on the Task resource.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001615 pageSize: integer, Maximum page size.
1616
1617Fewer tasks than requested might be returned, even if more tasks exist; use
1618next_page_token in the response to
1619determine if more tasks exist.
1620
1621The maximum page size is 1000. If unspecified, the page size will be the
1622maximum.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001623 pageToken: string, A token identifying the page of results to return.
1624
1625To request the first page results, page_token must be empty. To
1626request the next page of results, page_token must be the value of
1627next_page_token returned
1628from the previous call to ListTasks
1629method.
1630
1631The page token is valid for only 2 hours.
1632 x__xgafv: string, V1 error format.
1633 Allowed values
1634 1 - v1 error format
1635 2 - v2 error format
1636
1637Returns:
1638 An object of the form:
1639
1640 { # Response message for listing tasks using ListTasks.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001641 &quot;nextPageToken&quot;: &quot;A String&quot;, # A token to retrieve next page of results.
1642 #
1643 # To return the next page of results, call
1644 # ListTasks with this value as the
1645 # page_token.
1646 #
1647 # If the next_page_token is empty, there are no more results.
Bu Sun Kim65020912020-05-20 12:08:20 -07001648 &quot;tasks&quot;: [ # The list of tasks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001649 { # A unit of scheduled work.
Bu Sun Kim65020912020-05-20 12:08:20 -07001650 &quot;responseCount&quot;: 42, # Output only. The number of attempts which have received a response.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001651 &quot;lastAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
1652 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1653 #
1654 # `schedule_time` will be truncated to the nearest microsecond.
1655 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1656 #
1657 # `response_time` will be truncated to the nearest microsecond.
1658 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1659 #
1660 # `dispatch_time` will be truncated to the nearest microsecond.
1661 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
1662 #
1663 # If `response_time` is unset, then the task has not been attempted or is
1664 # currently running and the `response_status` field is meaningless.
1665 # different programming environments, including REST APIs and RPC APIs. It is
1666 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1667 # three pieces of data: error code, error message, and error details.
1668 #
1669 # You can find out more about this error model and how to work with it in the
1670 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1671 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1672 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1673 # user-facing error message should be localized and sent in the
1674 # google.rpc.Status.details field, or localized by the client.
1675 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1676 # message types for APIs to use.
1677 {
1678 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1679 },
1680 ],
1681 },
1682 },
1683 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
1684 #
1685 # `create_time` will be truncated to the nearest second.
1686 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
1687 #
1688 # The task name.
1689 #
1690 # The task name must have the following format:
1691 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1692 #
1693 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1694 # hyphens (-), colons (:), or periods (.).
1695 # For more information, see
1696 # [Identifying
1697 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1698 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
1699 # The list of available locations can be obtained by calling
1700 # ListLocations.
1701 # For more information, see https://cloud.google.com/about/locations/.
1702 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1703 # hyphens (-). The maximum length is 100 characters.
1704 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1705 # hyphens (-), or underscores (_). The maximum length is 500 characters.
1706 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
1707 #
1708 # For App Engine queues, this is when the task will be attempted or retried.
1709 #
1710 # `schedule_time` will be truncated to the nearest microsecond.
1711 &quot;httpRequest&quot;: { # HTTP request. # HTTP request that is sent to the task&#x27;s target.
1712 #
1713 # An HTTP task is a task that has HttpRequest set.
1714 #
1715 # The task will be pushed to the worker as an HTTP request. If the worker
1716 # or the redirected worker acknowledges the task by returning a successful HTTP
1717 # response code ([`200` - `299`]), the task will be removed from the queue. If
1718 # any other HTTP response code is returned or no response is received, the
1719 # task will be retried according to the following:
1720 #
1721 # * User-specified throttling: retry configuration,
1722 # rate limits, and the queue&#x27;s state.
1723 #
1724 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
1725 # temporarily reduce the queue&#x27;s effective rate. User-specified settings
1726 # will not be changed.
1727 #
1728 # System throttling happens because:
1729 #
1730 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
1731 # rate limits will be used. But if the worker returns
1732 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
1733 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
1734 # specified in the `Retry-After` HTTP response header is considered.
1735 #
1736 # * To prevent traffic spikes and to smooth sudden increases in traffic,
1737 # dispatches ramp up slowly when the queue is newly created or idle and
1738 # if large numbers of tasks suddenly become available to dispatch (due to
1739 # spikes in create task rates, the queue being unpaused, or many tasks
1740 # that are scheduled at the same time).
1741 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, an
1742 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
1743 # token will be generated and attached as an `Authorization` header in the
1744 # HTTP request.
1745 #
1746 # This type of authorization can be used for many scenarios, including
1747 # calling Cloud Run, or endpoints where you intend to validate the token
1748 # yourself.
1749 # [OpenID Connect
1750 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
1751 # This type of authorization can be used for many scenarios, including
1752 # calling Cloud Run, or endpoints where you intend to validate the token
1753 # yourself.
1754 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
1755 # to be used for generating OIDC token.
1756 # The service account must be within the same project as the queue. The
1757 # caller must have iam.serviceAccounts.actAs permission for the service
1758 # account.
1759 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. If not specified, the URI
1760 # specified in target will be used.
1761 },
1762 &quot;oauthToken&quot;: { # Contains information needed for generating an # If specified, an
1763 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
1764 # will be generated and attached as an `Authorization` header in the HTTP
1765 # request.
1766 #
1767 # This type of authorization should generally only be used when calling
1768 # Google APIs hosted on *.googleapis.com.
1769 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
1770 # This type of authorization should generally only be used when calling Google
1771 # APIs hosted on *.googleapis.com.
1772 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
1773 # to be used for generating OAuth token.
1774 # The service account must be within the same project as the queue. The
1775 # caller must have iam.serviceAccounts.actAs permission for the service
1776 # account.
1777 &quot;scope&quot;: &quot;A String&quot;, # OAuth scope to be used for generating OAuth access token.
1778 # If not specified, &quot;https://www.googleapis.com/auth/cloud-platform&quot;
1779 # will be used.
1780 },
1781 &quot;url&quot;: &quot;A String&quot;, # Required. The full url path that the request will be sent to.
1782 #
1783 # This string must begin with either &quot;http://&quot; or &quot;https://&quot;. Some examples
1784 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
1785 # encode some characters for safety and compatibility. The maximum allowed
1786 # URL length is 2083 characters after encoding.
1787 #
1788 # The `Location` header response from a redirect response [`300` - `399`]
1789 # may be followed. The redirect is not counted as a separate attempt.
1790 &quot;headers&quot;: { # HTTP request headers.
1791 #
1792 # This map contains the header field names and values.
1793 # Headers can be set when the
1794 # task is created.
1795 #
1796 # These headers represent a subset of the headers that will accompany the
1797 # task&#x27;s HTTP request. Some HTTP request headers will be ignored or replaced.
1798 #
1799 # A partial list of headers that will be ignored or replaced is:
1800 #
1801 # * Host: This will be computed by Cloud Tasks and derived from
1802 # HttpRequest.url.
1803 # * Content-Length: This will be computed by Cloud Tasks.
1804 # * User-Agent: This will be set to `&quot;Google-Cloud-Tasks&quot;`.
1805 # * X-Google-*: Google use only.
1806 # * X-AppEngine-*: Google use only.
1807 #
1808 # `Content-Type` won&#x27;t be set by Cloud Tasks. You can explicitly set
1809 # `Content-Type` to a media type when the
1810 # task is created.
1811 # For example, `Content-Type` can be set to `&quot;application/octet-stream&quot;` or
1812 # `&quot;application/json&quot;`.
1813 #
1814 # Headers which can have multiple values (according to RFC2616) can be
1815 # specified using comma-separated values.
1816 #
1817 # The size of the headers must be less than 80KB.
1818 &quot;a_key&quot;: &quot;A String&quot;,
1819 },
1820 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
1821 #
1822 # A request body is allowed only if the
1823 # HTTP method is POST, PUT, or PATCH. It is an
1824 # error to set body on a task with an incompatible HttpMethod.
1825 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
1826 },
1827 &quot;firstAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
1828 #
1829 # Only dispatch_time will be set.
1830 # The other Attempt information is not retained by Cloud Tasks.
1831 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1832 #
1833 # `schedule_time` will be truncated to the nearest microsecond.
1834 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1835 #
1836 # `response_time` will be truncated to the nearest microsecond.
1837 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1838 #
1839 # `dispatch_time` will be truncated to the nearest microsecond.
1840 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
1841 #
1842 # If `response_time` is unset, then the task has not been attempted or is
1843 # currently running and the `response_status` field is meaningless.
1844 # different programming environments, including REST APIs and RPC APIs. It is
1845 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1846 # three pieces of data: error code, error message, and error details.
1847 #
1848 # You can find out more about this error model and how to work with it in the
1849 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1850 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1851 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1852 # user-facing error message should be localized and sent in the
1853 # google.rpc.Status.details field, or localized by the client.
1854 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1855 # message types for APIs to use.
1856 {
1857 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1858 },
1859 ],
1860 },
1861 },
1862 &quot;dispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
1863 #
1864 # This count includes attempts which have been dispatched but haven&#x27;t
1865 # received a response.
1866 &quot;dispatchDeadline&quot;: &quot;A String&quot;, # The deadline for requests sent to the worker. If the worker does not
1867 # respond by this deadline then the request is cancelled and the attempt
1868 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
1869 # task according to the RetryConfig.
1870 #
1871 # Note that when the request is cancelled, Cloud Tasks will stop listening
1872 # for the response, but whether the worker stops processing depends on the
1873 # worker. For example, if the worker is stuck, it may not react to cancelled
1874 # requests.
1875 #
1876 # The default and maximum values depend on the type of request:
1877 #
1878 # * For HTTP tasks, the default is 10 minutes. The deadline
1879 # must be in the interval [15 seconds, 30 minutes].
1880 #
1881 # * For App Engine tasks, 0 indicates that the
1882 # request has the default deadline. The default deadline depends on the
1883 # [scaling
1884 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
1885 # of the service: 10 minutes for standard apps with automatic scaling, 24
1886 # hours for standard apps with manual and basic scaling, and 60 minutes for
1887 # flex apps. If the request deadline is set, it must be in the interval [15
1888 # seconds, 24 hours 15 seconds]. Regardless of the task&#x27;s
1889 # `dispatch_deadline`, the app handler will not run for longer than than
1890 # the service&#x27;s timeout. We recommend setting the `dispatch_deadline` to
1891 # at most a few seconds more than the app handler&#x27;s timeout. For more
1892 # information see
1893 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
1894 #
1895 # `dispatch_deadline` will be truncated to the nearest millisecond. The
1896 # deadline is an approximate deadline.
1897 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
1898 # been returned.
Bu Sun Kim65020912020-05-20 12:08:20 -07001899 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001900 #
1901 # An App Engine task is a task that has AppEngineHttpRequest set.
1902 #
1903 # The message defines the HTTP request that is sent to an App Engine app when
1904 # the task is dispatched.
1905 #
1906 # Using AppEngineHttpRequest requires
1907 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1908 # Google IAM permission for the project
1909 # and the following scope:
1910 #
1911 # `https://www.googleapis.com/auth/cloud-platform`
1912 #
1913 # The task will be delivered to the App Engine app which belongs to the same
1914 # project as the queue. For more information, see
1915 # [How Requests are
1916 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1917 # and how routing is affected by
1918 # [dispatch
1919 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
1920 # Traffic is encrypted during transport and never leaves Google datacenters.
1921 # Because this traffic is carried over a communication mechanism internal to
1922 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
1923 # The request to the handler, however, will appear to have used the HTTP
1924 # protocol.
1925 #
1926 # The AppEngineRouting used to construct the URL that the task is
1927 # delivered to can be set at the queue-level or task-level:
1928 #
1929 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07001930 # app_engine_routing_override
1931 # is used for all tasks in the queue, no matter what the setting
1932 # is for the
1933 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001934 #
1935 #
1936 # The `url` that the task will be sent to is:
1937 #
1938 # * `url =` host `+`
1939 # relative_uri
1940 #
1941 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
1942 # URIs restricted with
1943 # [`login:
1944 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
1945 # Because tasks are not run as any user, they cannot be dispatched to URIs
1946 # restricted with
1947 # [`login:
1948 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
1949 # Task dispatches also do not follow redirects.
1950 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001951 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001952 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07001953 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001954 # not receive response before the deadline. Failed
1955 # tasks will be retried according to the
1956 # retry configuration. `503` (Service Unavailable) is
1957 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07001958 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
1959 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001960 # Requests) response from an app handler does not cause traffic congestion
1961 # control to throttle the queue.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001962 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
1963 #
1964 # A request body is allowed only if the HTTP method is POST or PUT. It is
1965 # an error to set a body on a task with an incompatible HttpMethod.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001966 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
1967 #
1968 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
1969 # HTTP requests with this http_method, otherwise the task attempt fails with
1970 # error code 405 (Method Not Allowed). See [Writing a push task request
1971 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
1972 # and the App Engine documentation for your runtime on [How Requests are
1973 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001974 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001975 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001976 # If set,
1977 # app_engine_routing_override
1978 # is used for all tasks in the queue, no matter what the setting is for the
1979 # task-level app_engine_routing.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001980 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001981 # Defines routing characteristics specific to App Engine - service, version,
1982 # and instance.
1983 #
1984 # For more information about services, versions, and instances see
1985 # [An Overview of App
1986 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
1987 # [Microservices Architecture on Google App
1988 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
1989 # [App Engine Standard request
1990 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
1991 # and [App Engine Flex request
1992 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1993 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
1994 #
1995 # The host is constructed from the domain name of the app associated with
1996 # the queue&#x27;s project ID (for example &lt;app-id&gt;.appspot.com), and the
1997 # service, version,
1998 # and instance. Tasks which were created using
1999 # the App Engine SDK might have a custom domain name.
2000 #
2001 # For more information, see
2002 # [How Requests are
2003 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
2004 &quot;instance&quot;: &quot;A String&quot;, # App instance.
2005 #
2006 # By default, the task is sent to an instance which is available when
2007 # the task is attempted.
2008 #
2009 # Requests can only be sent to a specific instance if
2010 # [manual scaling is used in App Engine
2011 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
2012 # App Engine Flex does not support instances. For more information, see
2013 # [App Engine Standard request
2014 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2015 # and [App Engine Flex request
2016 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
2017 &quot;service&quot;: &quot;A String&quot;, # App service.
2018 #
2019 # By default, the task is sent to the service which is the default
2020 # service when the task is attempted.
2021 #
2022 # For some queues or tasks which were created using the App Engine
2023 # Task Queue API, host is not parsable
2024 # into service,
2025 # version, and
2026 # instance. For example, some tasks
2027 # which were created using the App Engine SDK use a custom domain
2028 # name; custom domains are not parsed by Cloud Tasks. If
2029 # host is not parsable, then
2030 # service,
2031 # version, and
2032 # instance are the empty string.
2033 &quot;version&quot;: &quot;A String&quot;, # App version.
2034 #
2035 # By default, the task is sent to the version which is the default
2036 # version when the task is attempted.
2037 #
2038 # For some queues or tasks which were created using the App Engine
2039 # Task Queue API, host is not parsable
2040 # into service,
2041 # version, and
2042 # instance. For example, some tasks
2043 # which were created using the App Engine SDK use a custom domain
2044 # name; custom domains are not parsed by Cloud Tasks. If
2045 # host is not parsable, then
2046 # service,
2047 # version, and
2048 # instance are the empty string.
2049 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002050 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002051 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002052 # This map contains the header field names and values.
2053 # Headers can be set when the
2054 # task is created.
2055 # Repeated headers are not supported but a header value can contain commas.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002056 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002057 # Cloud Tasks sets some headers to default values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002058 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002059 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07002060 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07002061 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07002062 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -07002063 # modified `User-Agent`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002064 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002065 # If the task has a body, Cloud
2066 # Tasks sets the following headers:
2067 #
2068 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07002069 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -07002070 # setting `Content-Type` to a particular media type when the
2071 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07002072 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07002073 # * `Content-Length`: This is computed by Cloud Tasks. This value is
2074 # output only. It cannot be changed.
2075 #
2076 # The headers below cannot be set or overridden:
2077 #
2078 # * `Host`
2079 # * `X-Google-*`
2080 # * `X-AppEngine-*`
2081 #
2082 # In addition, Cloud Tasks sets some headers when the task is dispatched,
2083 # such as headers containing information about the task; see
2084 # [request
2085 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
2086 # These headers are set only when the task is dispatched, so they are not
2087 # visible when the task is returned in a Cloud Tasks response.
2088 #
2089 # Although there is no specific limit for the maximum number of headers or
2090 # the size, there is a limit on the maximum size of the Task. For more
2091 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07002092 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002093 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002094 &quot;relativeUri&quot;: &quot;A String&quot;, # The relative URI.
Bu Sun Kim65020912020-05-20 12:08:20 -07002095 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002096 # The relative URI must begin with &quot;/&quot; and must be a valid HTTP relative URI.
2097 # It can contain a path and query string arguments.
2098 # If the relative URI is empty, then the root path &quot;/&quot; will be used.
2099 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002100 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002101 },
2102 ],
2103 }</pre>
2104</div>
2105
2106<div class="method">
2107 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
2108 <pre>Retrieves the next page of results.
2109
2110Args:
2111 previous_request: The request for the previous page. (required)
2112 previous_response: The response from the request for the previous page. (required)
2113
2114Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -07002115 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002116 page. Returns None if there are no more items in the collection.
2117 </pre>
2118</div>
2119
2120<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002121 <code class="details" id="run">run(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002122 <pre>Forces a task to run now.
2123
2124When this method is called, Cloud Tasks will dispatch the task, even if
2125the task is already running, the queue has reached its RateLimits or
2126is PAUSED.
2127
2128This command is meant to be used for manual debugging. For
2129example, RunTask can be used to retry a failed
2130task after a fix has been made or to manually force a task to be
2131dispatched now.
2132
2133The dispatched task is returned. That is, the task that is returned
2134contains the status after the task is dispatched but
2135before the task is received by its target.
2136
Bu Sun Kim65020912020-05-20 12:08:20 -07002137If Cloud Tasks receives a successful response from the task&#x27;s
2138target, then the task will be deleted; otherwise the task&#x27;s
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002139schedule_time will be reset to the time that
2140RunTask was called plus the retry delay specified
Bu Sun Kim65020912020-05-20 12:08:20 -07002141in the queue&#x27;s RetryConfig.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002142
2143RunTask returns
2144NOT_FOUND when it is called on a
2145task that has already succeeded or permanently failed.
2146
2147Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07002148 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002149`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002150 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002151 The object takes the form of:
2152
2153{ # Request message for forcing a task to run now using
2154 # RunTask.
Bu Sun Kim65020912020-05-20 12:08:20 -07002155 &quot;responseView&quot;: &quot;A String&quot;, # The response_view specifies which subset of the Task will be
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002156 # returned.
2157 #
2158 # By default response_view is BASIC; not all
2159 # information is retrieved by default because some data, such as
2160 # payloads, might be desirable to return only when needed because
2161 # of its large size or because of the sensitivity of data that it
2162 # contains.
2163 #
2164 # Authorization for FULL requires
2165 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
2166 # permission on the Task resource.
2167 }
2168
2169 x__xgafv: string, V1 error format.
2170 Allowed values
2171 1 - v1 error format
2172 2 - v2 error format
2173
2174Returns:
2175 An object of the form:
2176
2177 { # A unit of scheduled work.
Bu Sun Kim65020912020-05-20 12:08:20 -07002178 &quot;responseCount&quot;: 42, # Output only. The number of attempts which have received a response.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002179 &quot;lastAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
2180 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
2181 #
2182 # `schedule_time` will be truncated to the nearest microsecond.
2183 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2184 #
2185 # `response_time` will be truncated to the nearest microsecond.
2186 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2187 #
2188 # `dispatch_time` will be truncated to the nearest microsecond.
2189 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
2190 #
2191 # If `response_time` is unset, then the task has not been attempted or is
2192 # currently running and the `response_status` field is meaningless.
2193 # different programming environments, including REST APIs and RPC APIs. It is
2194 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2195 # three pieces of data: error code, error message, and error details.
2196 #
2197 # You can find out more about this error model and how to work with it in the
2198 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2199 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2200 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2201 # user-facing error message should be localized and sent in the
2202 # google.rpc.Status.details field, or localized by the client.
2203 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2204 # message types for APIs to use.
2205 {
2206 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2207 },
2208 ],
2209 },
2210 },
2211 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
2212 #
2213 # `create_time` will be truncated to the nearest second.
2214 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
2215 #
2216 # The task name.
2217 #
2218 # The task name must have the following format:
2219 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
2220 #
2221 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
2222 # hyphens (-), colons (:), or periods (.).
2223 # For more information, see
2224 # [Identifying
2225 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
2226 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
2227 # The list of available locations can be obtained by calling
2228 # ListLocations.
2229 # For more information, see https://cloud.google.com/about/locations/.
2230 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
2231 # hyphens (-). The maximum length is 100 characters.
2232 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
2233 # hyphens (-), or underscores (_). The maximum length is 500 characters.
2234 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
2235 #
2236 # For App Engine queues, this is when the task will be attempted or retried.
2237 #
2238 # `schedule_time` will be truncated to the nearest microsecond.
2239 &quot;httpRequest&quot;: { # HTTP request. # HTTP request that is sent to the task&#x27;s target.
2240 #
2241 # An HTTP task is a task that has HttpRequest set.
2242 #
2243 # The task will be pushed to the worker as an HTTP request. If the worker
2244 # or the redirected worker acknowledges the task by returning a successful HTTP
2245 # response code ([`200` - `299`]), the task will be removed from the queue. If
2246 # any other HTTP response code is returned or no response is received, the
2247 # task will be retried according to the following:
2248 #
2249 # * User-specified throttling: retry configuration,
2250 # rate limits, and the queue&#x27;s state.
2251 #
2252 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
2253 # temporarily reduce the queue&#x27;s effective rate. User-specified settings
2254 # will not be changed.
2255 #
2256 # System throttling happens because:
2257 #
2258 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
2259 # rate limits will be used. But if the worker returns
2260 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
2261 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
2262 # specified in the `Retry-After` HTTP response header is considered.
2263 #
2264 # * To prevent traffic spikes and to smooth sudden increases in traffic,
2265 # dispatches ramp up slowly when the queue is newly created or idle and
2266 # if large numbers of tasks suddenly become available to dispatch (due to
2267 # spikes in create task rates, the queue being unpaused, or many tasks
2268 # that are scheduled at the same time).
2269 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, an
2270 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
2271 # token will be generated and attached as an `Authorization` header in the
2272 # HTTP request.
2273 #
2274 # This type of authorization can be used for many scenarios, including
2275 # calling Cloud Run, or endpoints where you intend to validate the token
2276 # yourself.
2277 # [OpenID Connect
2278 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
2279 # This type of authorization can be used for many scenarios, including
2280 # calling Cloud Run, or endpoints where you intend to validate the token
2281 # yourself.
2282 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
2283 # to be used for generating OIDC token.
2284 # The service account must be within the same project as the queue. The
2285 # caller must have iam.serviceAccounts.actAs permission for the service
2286 # account.
2287 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. If not specified, the URI
2288 # specified in target will be used.
2289 },
2290 &quot;oauthToken&quot;: { # Contains information needed for generating an # If specified, an
2291 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
2292 # will be generated and attached as an `Authorization` header in the HTTP
2293 # request.
2294 #
2295 # This type of authorization should generally only be used when calling
2296 # Google APIs hosted on *.googleapis.com.
2297 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
2298 # This type of authorization should generally only be used when calling Google
2299 # APIs hosted on *.googleapis.com.
2300 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
2301 # to be used for generating OAuth token.
2302 # The service account must be within the same project as the queue. The
2303 # caller must have iam.serviceAccounts.actAs permission for the service
2304 # account.
2305 &quot;scope&quot;: &quot;A String&quot;, # OAuth scope to be used for generating OAuth access token.
2306 # If not specified, &quot;https://www.googleapis.com/auth/cloud-platform&quot;
2307 # will be used.
2308 },
2309 &quot;url&quot;: &quot;A String&quot;, # Required. The full url path that the request will be sent to.
2310 #
2311 # This string must begin with either &quot;http://&quot; or &quot;https://&quot;. Some examples
2312 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
2313 # encode some characters for safety and compatibility. The maximum allowed
2314 # URL length is 2083 characters after encoding.
2315 #
2316 # The `Location` header response from a redirect response [`300` - `399`]
2317 # may be followed. The redirect is not counted as a separate attempt.
2318 &quot;headers&quot;: { # HTTP request headers.
2319 #
2320 # This map contains the header field names and values.
2321 # Headers can be set when the
2322 # task is created.
2323 #
2324 # These headers represent a subset of the headers that will accompany the
2325 # task&#x27;s HTTP request. Some HTTP request headers will be ignored or replaced.
2326 #
2327 # A partial list of headers that will be ignored or replaced is:
2328 #
2329 # * Host: This will be computed by Cloud Tasks and derived from
2330 # HttpRequest.url.
2331 # * Content-Length: This will be computed by Cloud Tasks.
2332 # * User-Agent: This will be set to `&quot;Google-Cloud-Tasks&quot;`.
2333 # * X-Google-*: Google use only.
2334 # * X-AppEngine-*: Google use only.
2335 #
2336 # `Content-Type` won&#x27;t be set by Cloud Tasks. You can explicitly set
2337 # `Content-Type` to a media type when the
2338 # task is created.
2339 # For example, `Content-Type` can be set to `&quot;application/octet-stream&quot;` or
2340 # `&quot;application/json&quot;`.
2341 #
2342 # Headers which can have multiple values (according to RFC2616) can be
2343 # specified using comma-separated values.
2344 #
2345 # The size of the headers must be less than 80KB.
2346 &quot;a_key&quot;: &quot;A String&quot;,
2347 },
2348 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
2349 #
2350 # A request body is allowed only if the
2351 # HTTP method is POST, PUT, or PATCH. It is an
2352 # error to set body on a task with an incompatible HttpMethod.
2353 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
2354 },
2355 &quot;firstAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
2356 #
2357 # Only dispatch_time will be set.
2358 # The other Attempt information is not retained by Cloud Tasks.
2359 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
2360 #
2361 # `schedule_time` will be truncated to the nearest microsecond.
2362 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2363 #
2364 # `response_time` will be truncated to the nearest microsecond.
2365 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2366 #
2367 # `dispatch_time` will be truncated to the nearest microsecond.
2368 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
2369 #
2370 # If `response_time` is unset, then the task has not been attempted or is
2371 # currently running and the `response_status` field is meaningless.
2372 # different programming environments, including REST APIs and RPC APIs. It is
2373 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2374 # three pieces of data: error code, error message, and error details.
2375 #
2376 # You can find out more about this error model and how to work with it in the
2377 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2378 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2379 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2380 # user-facing error message should be localized and sent in the
2381 # google.rpc.Status.details field, or localized by the client.
2382 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2383 # message types for APIs to use.
2384 {
2385 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2386 },
2387 ],
2388 },
2389 },
2390 &quot;dispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
2391 #
2392 # This count includes attempts which have been dispatched but haven&#x27;t
2393 # received a response.
2394 &quot;dispatchDeadline&quot;: &quot;A String&quot;, # The deadline for requests sent to the worker. If the worker does not
2395 # respond by this deadline then the request is cancelled and the attempt
2396 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
2397 # task according to the RetryConfig.
2398 #
2399 # Note that when the request is cancelled, Cloud Tasks will stop listening
2400 # for the response, but whether the worker stops processing depends on the
2401 # worker. For example, if the worker is stuck, it may not react to cancelled
2402 # requests.
2403 #
2404 # The default and maximum values depend on the type of request:
2405 #
2406 # * For HTTP tasks, the default is 10 minutes. The deadline
2407 # must be in the interval [15 seconds, 30 minutes].
2408 #
2409 # * For App Engine tasks, 0 indicates that the
2410 # request has the default deadline. The default deadline depends on the
2411 # [scaling
2412 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
2413 # of the service: 10 minutes for standard apps with automatic scaling, 24
2414 # hours for standard apps with manual and basic scaling, and 60 minutes for
2415 # flex apps. If the request deadline is set, it must be in the interval [15
2416 # seconds, 24 hours 15 seconds]. Regardless of the task&#x27;s
2417 # `dispatch_deadline`, the app handler will not run for longer than than
2418 # the service&#x27;s timeout. We recommend setting the `dispatch_deadline` to
2419 # at most a few seconds more than the app handler&#x27;s timeout. For more
2420 # information see
2421 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
2422 #
2423 # `dispatch_deadline` will be truncated to the nearest millisecond. The
2424 # deadline is an approximate deadline.
2425 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
2426 # been returned.
Bu Sun Kim65020912020-05-20 12:08:20 -07002427 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002428 #
2429 # An App Engine task is a task that has AppEngineHttpRequest set.
2430 #
2431 # The message defines the HTTP request that is sent to an App Engine app when
2432 # the task is dispatched.
2433 #
2434 # Using AppEngineHttpRequest requires
2435 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
2436 # Google IAM permission for the project
2437 # and the following scope:
2438 #
2439 # `https://www.googleapis.com/auth/cloud-platform`
2440 #
2441 # The task will be delivered to the App Engine app which belongs to the same
2442 # project as the queue. For more information, see
2443 # [How Requests are
2444 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2445 # and how routing is affected by
2446 # [dispatch
2447 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
2448 # Traffic is encrypted during transport and never leaves Google datacenters.
2449 # Because this traffic is carried over a communication mechanism internal to
2450 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
2451 # The request to the handler, however, will appear to have used the HTTP
2452 # protocol.
2453 #
2454 # The AppEngineRouting used to construct the URL that the task is
2455 # delivered to can be set at the queue-level or task-level:
2456 #
2457 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07002458 # app_engine_routing_override
2459 # is used for all tasks in the queue, no matter what the setting
2460 # is for the
2461 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002462 #
2463 #
2464 # The `url` that the task will be sent to is:
2465 #
2466 # * `url =` host `+`
2467 # relative_uri
2468 #
2469 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
2470 # URIs restricted with
2471 # [`login:
2472 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
2473 # Because tasks are not run as any user, they cannot be dispatched to URIs
2474 # restricted with
2475 # [`login:
2476 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
2477 # Task dispatches also do not follow redirects.
2478 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002479 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002480 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07002481 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002482 # not receive response before the deadline. Failed
2483 # tasks will be retried according to the
2484 # retry configuration. `503` (Service Unavailable) is
2485 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07002486 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
2487 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002488 # Requests) response from an app handler does not cause traffic congestion
2489 # control to throttle the queue.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002490 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
2491 #
2492 # A request body is allowed only if the HTTP method is POST or PUT. It is
2493 # an error to set a body on a task with an incompatible HttpMethod.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002494 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
2495 #
2496 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
2497 # HTTP requests with this http_method, otherwise the task attempt fails with
2498 # error code 405 (Method Not Allowed). See [Writing a push task request
2499 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
2500 # and the App Engine documentation for your runtime on [How Requests are
2501 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002502 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002503 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002504 # If set,
2505 # app_engine_routing_override
2506 # is used for all tasks in the queue, no matter what the setting is for the
2507 # task-level app_engine_routing.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002508 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002509 # Defines routing characteristics specific to App Engine - service, version,
2510 # and instance.
2511 #
2512 # For more information about services, versions, and instances see
2513 # [An Overview of App
2514 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
2515 # [Microservices Architecture on Google App
2516 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
2517 # [App Engine Standard request
2518 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
2519 # and [App Engine Flex request
2520 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
2521 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
2522 #
2523 # The host is constructed from the domain name of the app associated with
2524 # the queue&#x27;s project ID (for example &lt;app-id&gt;.appspot.com), and the
2525 # service, version,
2526 # and instance. Tasks which were created using
2527 # the App Engine SDK might have a custom domain name.
2528 #
2529 # For more information, see
2530 # [How Requests are
2531 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
2532 &quot;instance&quot;: &quot;A String&quot;, # App instance.
2533 #
2534 # By default, the task is sent to an instance which is available when
2535 # the task is attempted.
2536 #
2537 # Requests can only be sent to a specific instance if
2538 # [manual scaling is used in App Engine
2539 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
2540 # App Engine Flex does not support instances. For more information, see
2541 # [App Engine Standard request
2542 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2543 # and [App Engine Flex request
2544 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
2545 &quot;service&quot;: &quot;A String&quot;, # App service.
2546 #
2547 # By default, the task is sent to the service which is the default
2548 # service when the task is attempted.
2549 #
2550 # For some queues or tasks which were created using the App Engine
2551 # Task Queue API, host is not parsable
2552 # into service,
2553 # version, and
2554 # instance. For example, some tasks
2555 # which were created using the App Engine SDK use a custom domain
2556 # name; custom domains are not parsed by Cloud Tasks. If
2557 # host is not parsable, then
2558 # service,
2559 # version, and
2560 # instance are the empty string.
2561 &quot;version&quot;: &quot;A String&quot;, # App version.
2562 #
2563 # By default, the task is sent to the version which is the default
2564 # version when the task is attempted.
2565 #
2566 # For some queues or tasks which were created using the App Engine
2567 # Task Queue API, host is not parsable
2568 # into service,
2569 # version, and
2570 # instance. For example, some tasks
2571 # which were created using the App Engine SDK use a custom domain
2572 # name; custom domains are not parsed by Cloud Tasks. If
2573 # host is not parsable, then
2574 # service,
2575 # version, and
2576 # instance are the empty string.
2577 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002578 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002579 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002580 # This map contains the header field names and values.
2581 # Headers can be set when the
2582 # task is created.
2583 # Repeated headers are not supported but a header value can contain commas.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002584 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002585 # Cloud Tasks sets some headers to default values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002586 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002587 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07002588 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07002589 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07002590 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -07002591 # modified `User-Agent`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002592 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002593 # If the task has a body, Cloud
2594 # Tasks sets the following headers:
2595 #
2596 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07002597 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -07002598 # setting `Content-Type` to a particular media type when the
2599 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07002600 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07002601 # * `Content-Length`: This is computed by Cloud Tasks. This value is
2602 # output only. It cannot be changed.
2603 #
2604 # The headers below cannot be set or overridden:
2605 #
2606 # * `Host`
2607 # * `X-Google-*`
2608 # * `X-AppEngine-*`
2609 #
2610 # In addition, Cloud Tasks sets some headers when the task is dispatched,
2611 # such as headers containing information about the task; see
2612 # [request
2613 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
2614 # These headers are set only when the task is dispatched, so they are not
2615 # visible when the task is returned in a Cloud Tasks response.
2616 #
2617 # Although there is no specific limit for the maximum number of headers or
2618 # the size, there is a limit on the maximum size of the Task. For more
2619 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07002620 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002621 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002622 &quot;relativeUri&quot;: &quot;A String&quot;, # The relative URI.
Bu Sun Kim65020912020-05-20 12:08:20 -07002623 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002624 # The relative URI must begin with &quot;/&quot; and must be a valid HTTP relative URI.
2625 # It can contain a path and query string arguments.
2626 # If the relative URI is empty, then the root path &quot;/&quot; will be used.
2627 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002628 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002629 }</pre>
2630</div>
2631
2632</body></html>