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