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