blob: 512dfb4dd4f9a95b013280dea56b8ccf9e0c04e9 [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="cloudtasks_v2beta3.html">Cloud Tasks API</a> . <a href="cloudtasks_v2beta3.projects.html">projects</a> . <a href="cloudtasks_v2beta3.projects.locations.html">locations</a> . <a href="cloudtasks_v2beta3.projects.locations.queues.html">queues</a> . <a href="cloudtasks_v2beta3.projects.locations.queues.tasks.html">tasks</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Creates a task and adds it to a queue.</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
82<p class="firstline">Deletes a task.</p>
83<p class="toc_element">
84 <code><a href="#get">get(name, responseView=None, x__xgafv=None)</a></code></p>
85<p class="firstline">Gets a task.</p>
86<p class="toc_element">
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.
158 "httpRequest": { # HTTP request. # HTTP request that is sent to the task's target.
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
Dan O'Mearadd494642020-05-01 07:42:23 -0700164 # response code ([`200` - `299`]), the task will be removed from the queue. If
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700165 # 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 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700177 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700178 # 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 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700183 # * To prevent traffic spikes and to smooth sudden increases in traffic,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700184 # 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.
Dan O'Mearadd494642020-05-01 07:42:23 -0700193 "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 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700223 "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 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700272 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700273 },
274 "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 #
304 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -0700305 # app_engine_routing_override
306 # is used for all tasks in the queue, no matter what the setting
307 # is for the
308 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700309 #
310 #
311 # The `url` that the task will be sent to is:
312 #
313 # * `url =` host `+`
314 # relative_uri
315 #
316 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
317 # URIs restricted with
318 # [`login:
319 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
320 # Because tasks are not run as any user, they cannot be dispatched to URIs
321 # restricted with
322 # [`login:
323 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
324 # Task dispatches also do not follow redirects.
325 #
326 # The task attempt has succeeded if the app's request handler returns an HTTP
327 # response code in the range [`200` - `299`]. The task attempt has failed if
328 # the app's handler returns a non-2xx response code or Cloud Tasks does
329 # not receive response before the deadline. Failed
330 # tasks will be retried according to the
331 # retry configuration. `503` (Service Unavailable) is
332 # considered an App Engine system error instead of an application error and
333 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
334 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
335 # Requests) response from an app handler does not cause traffic congestion
336 # control to throttle the queue.
337 "body": "A String", # HTTP request body.
338 #
339 # A request body is allowed only if the HTTP method is POST or PUT. It is
340 # an error to set a body on a task with an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -0700341 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700342 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700343 # The app's request handler for the task's target URL must be able to handle
344 # HTTP requests with this http_method, otherwise the task attempt fails with
345 # error code 405 (Method Not Allowed). See [Writing a push task request
346 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
347 # and the App Engine documentation for your runtime on [How Requests are
348 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700349 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
350 #
351 # If set,
352 # app_engine_routing_override
353 # is used for all tasks in the queue, no matter what the setting is for the
354 # task-level app_engine_routing.
355 #
356 # Defines routing characteristics specific to App Engine - service, version,
357 # and instance.
358 #
359 # For more information about services, versions, and instances see
360 # [An Overview of App
361 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
362 # [Microservices Architecture on Google App
363 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
364 # [App Engine Standard request
365 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
366 # and [App Engine Flex request
367 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
368 "instance": "A String", # App instance.
369 #
370 # By default, the task is sent to an instance which is available when
371 # the task is attempted.
372 #
373 # Requests can only be sent to a specific instance if
374 # [manual scaling is used in App Engine
375 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
376 # App Engine Flex does not support instances. For more information, see
377 # [App Engine Standard request
378 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
379 # and [App Engine Flex request
380 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
381 "host": "A String", # Output only. The host that the task is sent to.
382 #
383 # The host is constructed from the domain name of the app associated with
Dan O'Mearadd494642020-05-01 07:42:23 -0700384 # the queue's project ID (for example &lt;app-id&gt;.appspot.com), and the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700385 # service, version,
386 # and instance. Tasks which were created using
387 # the App Engine SDK might have a custom domain name.
388 #
389 # For more information, see
390 # [How Requests are
391 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
392 "version": "A String", # App version.
393 #
394 # By default, the task is sent to the version which is the default
395 # version when the task is attempted.
396 #
397 # For some queues or tasks which were created using the App Engine
398 # Task Queue API, host is not parsable
399 # into service,
400 # version, and
401 # instance. For example, some tasks
402 # which were created using the App Engine SDK use a custom domain
403 # name; custom domains are not parsed by Cloud Tasks. If
404 # host is not parsable, then
405 # service,
406 # version, and
407 # instance are the empty string.
408 "service": "A String", # App service.
409 #
410 # By default, the task is sent to the service which is the default
411 # service when the task is attempted.
412 #
413 # For some queues or tasks which were created using the App Engine
414 # Task Queue API, host is not parsable
415 # into service,
416 # version, and
417 # instance. For example, some tasks
418 # which were created using the App Engine SDK use a custom domain
419 # name; custom domains are not parsed by Cloud Tasks. If
420 # host is not parsable, then
421 # service,
422 # version, and
423 # instance are the empty string.
424 },
425 "relativeUri": "A String", # The relative URI.
426 #
427 # The relative URI must begin with "/" and must be a valid HTTP relative URI.
428 # It can contain a path and query string arguments.
429 # If the relative URI is empty, then the root path "/" will be used.
430 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -0700431 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700432 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700433 # This map contains the header field names and values.
434 # Headers can be set when the
435 # task is created.
436 # Repeated headers are not supported but a header value can contain commas.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700437 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700438 # Cloud Tasks sets some headers to default values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700439 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700440 # * `User-Agent`: By default, this header is
441 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
442 # This header can be modified, but Cloud Tasks will append
443 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
444 # modified `User-Agent`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700445 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700446 # If the task has a body, Cloud
447 # Tasks sets the following headers:
448 #
449 # * `Content-Type`: By default, the `Content-Type` header is set to
450 # `"application/octet-stream"`. The default can be overridden by explicitly
451 # setting `Content-Type` to a particular media type when the
452 # task is created.
453 # For example, `Content-Type` can be set to `"application/json"`.
454 # * `Content-Length`: This is computed by Cloud Tasks. This value is
455 # output only. It cannot be changed.
456 #
457 # The headers below cannot be set or overridden:
458 #
459 # * `Host`
460 # * `X-Google-*`
461 # * `X-AppEngine-*`
462 #
463 # In addition, Cloud Tasks sets some headers when the task is dispatched,
464 # such as headers containing information about the task; see
465 # [request
466 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
467 # These headers are set only when the task is dispatched, so they are not
468 # visible when the task is returned in a Cloud Tasks response.
469 #
470 # Although there is no specific limit for the maximum number of headers or
471 # the size, there is a limit on the maximum size of the Task. For more
472 # information, see the CreateTask documentation.
473 "a_key": "A String",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700474 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700475 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700476 "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt.
477 #
478 # Only dispatch_time will be set.
479 # The other Attempt information is not retained by Cloud Tasks.
480 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
481 #
482 # `schedule_time` will be truncated to the nearest microsecond.
483 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
484 #
485 # If `response_time` is unset, then the task has not been attempted or is
486 # currently running and the `response_status` field is meaningless.
487 # different programming environments, including REST APIs and RPC APIs. It is
488 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
489 # three pieces of data: error code, error message, and error details.
490 #
491 # You can find out more about this error model and how to work with it in the
492 # [API Design Guide](https://cloud.google.com/apis/design/errors).
493 "message": "A String", # A developer-facing error message, which should be in English. Any
494 # user-facing error message should be localized and sent in the
495 # google.rpc.Status.details field, or localized by the client.
496 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
497 "details": [ # A list of messages that carry the error details. There is a common set of
498 # message types for APIs to use.
499 {
500 "a_key": "", # Properties of the object. Contains field @type with type URL.
501 },
502 ],
503 },
504 "responseTime": "A String", # Output only. The time that this attempt response was received.
505 #
506 # `response_time` will be truncated to the nearest microsecond.
507 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
508 #
509 # `dispatch_time` will be truncated to the nearest microsecond.
510 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700511 "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt.
512 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
513 #
514 # `schedule_time` will be truncated to the nearest microsecond.
515 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
516 #
517 # If `response_time` is unset, then the task has not been attempted or is
518 # currently running and the `response_status` field is meaningless.
519 # different programming environments, including REST APIs and RPC APIs. It is
520 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
521 # three pieces of data: error code, error message, and error details.
522 #
523 # You can find out more about this error model and how to work with it in the
524 # [API Design Guide](https://cloud.google.com/apis/design/errors).
525 "message": "A String", # A developer-facing error message, which should be in English. Any
526 # user-facing error message should be localized and sent in the
527 # google.rpc.Status.details field, or localized by the client.
528 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
529 "details": [ # A list of messages that carry the error details. There is a common set of
530 # message types for APIs to use.
531 {
532 "a_key": "", # Properties of the object. Contains field @type with type URL.
533 },
534 ],
535 },
536 "responseTime": "A String", # Output only. The time that this attempt response was received.
537 #
538 # `response_time` will be truncated to the nearest microsecond.
539 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
540 #
541 # `dispatch_time` will be truncated to the nearest microsecond.
542 },
543 "name": "A String", # Optionally caller-specified in CreateTask.
544 #
545 # The task name.
546 #
547 # The task name must have the following format:
548 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
549 #
550 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
551 # hyphens (-), colons (:), or periods (.).
552 # For more information, see
553 # [Identifying
554 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
555 # * `LOCATION_ID` is the canonical ID for the task's location.
556 # The list of available locations can be obtained by calling
557 # ListLocations.
558 # For more information, see https://cloud.google.com/about/locations/.
559 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
560 # hyphens (-). The maximum length is 100 characters.
561 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
562 # hyphens (-), or underscores (_). The maximum length is 500 characters.
563 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
564 #
565 # For App Engine queues, this is when the task will be attempted or retried.
566 #
567 # `schedule_time` will be truncated to the nearest microsecond.
568 "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not
569 # respond by this deadline then the request is cancelled and the attempt
570 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
571 # task according to the RetryConfig.
572 #
573 # Note that when the request is cancelled, Cloud Tasks will stop listing for
574 # the response, but whether the worker stops processing depends on the
575 # worker. For example, if the worker is stuck, it may not react to cancelled
576 # requests.
577 #
578 # The default and maximum values depend on the type of request:
579 #
580 # * For HTTP tasks, the default is 10 minutes. The deadline
581 # must be in the interval [15 seconds, 30 minutes].
582 #
583 # * For App Engine tasks, 0 indicates that the
584 # request has the default deadline. The default deadline depends on the
585 # [scaling
586 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
587 # of the service: 10 minutes for standard apps with automatic scaling, 24
588 # hours for standard apps with manual and basic scaling, and 60 minutes for
589 # flex apps. If the request deadline is set, it must be in the interval [15
590 # seconds, 24 hours 15 seconds]. Regardless of the task's
591 # `dispatch_deadline`, the app handler will not run for longer than than
592 # the service's timeout. We recommend setting the `dispatch_deadline` to
593 # at most a few seconds more than the app handler's timeout. For more
594 # information see
595 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
596 #
597 # `dispatch_deadline` will be truncated to the nearest millisecond. The
598 # deadline is an approximate deadline.
599 "view": "A String", # Output only. The view specifies which subset of the Task has
600 # been returned.
601 "createTime": "A String", # Output only. The time that the task was created.
602 #
603 # `create_time` will be truncated to the nearest second.
604 "dispatchCount": 42, # Output only. The number of attempts dispatched.
605 #
606 # This count includes attempts which have been dispatched but haven't
607 # received a response.
608 "responseCount": 42, # Output only. The number of attempts which have received a response.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700609 },
610 }
611
612 x__xgafv: string, V1 error format.
613 Allowed values
614 1 - v1 error format
615 2 - v2 error format
616
617Returns:
618 An object of the form:
619
620 { # A unit of scheduled work.
621 "httpRequest": { # HTTP request. # HTTP request that is sent to the task's target.
622 #
623 # An HTTP task is a task that has HttpRequest set.
624 #
625 # The task will be pushed to the worker as an HTTP request. If the worker
626 # or the redirected worker acknowledges the task by returning a successful HTTP
Dan O'Mearadd494642020-05-01 07:42:23 -0700627 # response code ([`200` - `299`]), the task will be removed from the queue. If
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700628 # any other HTTP response code is returned or no response is received, the
629 # task will be retried according to the following:
630 #
631 # * User-specified throttling: retry configuration,
632 # rate limits, and the queue's state.
633 #
634 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
635 # temporarily reduce the queue's effective rate. User-specified settings
636 # will not be changed.
637 #
638 # System throttling happens because:
639 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700640 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700641 # rate limits will be used. But if the worker returns
642 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
643 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
644 # specified in the `Retry-After` HTTP response header is considered.
645 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700646 # * To prevent traffic spikes and to smooth sudden increases in traffic,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700647 # dispatches ramp up slowly when the queue is newly created or idle and
648 # if large numbers of tasks suddenly become available to dispatch (due to
649 # spikes in create task rates, the queue being unpaused, or many tasks
650 # that are scheduled at the same time).
651 "body": "A String", # HTTP request body.
652 #
653 # A request body is allowed only if the
654 # HTTP method is POST, PUT, or PATCH. It is an
655 # error to set body on a task with an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -0700656 "headers": { # HTTP request headers.
657 #
658 # This map contains the header field names and values.
659 # Headers can be set when the
660 # task is created.
661 #
662 # These headers represent a subset of the headers that will accompany the
663 # task's HTTP request. Some HTTP request headers will be ignored or replaced.
664 #
665 # A partial list of headers that will be ignored or replaced is:
666 #
667 # * Host: This will be computed by Cloud Tasks and derived from
668 # HttpRequest.url.
669 # * Content-Length: This will be computed by Cloud Tasks.
670 # * User-Agent: This will be set to `"Google-Cloud-Tasks"`.
671 # * X-Google-*: Google use only.
672 # * X-AppEngine-*: Google use only.
673 #
674 # `Content-Type` won't be set by Cloud Tasks. You can explicitly set
675 # `Content-Type` to a media type when the
676 # task is created.
677 # For example, `Content-Type` can be set to `"application/octet-stream"` or
678 # `"application/json"`.
679 #
680 # Headers which can have multiple values (according to RFC2616) can be
681 # specified using comma-separated values.
682 #
683 # The size of the headers must be less than 80KB.
684 "a_key": "A String",
685 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700686 "url": "A String", # Required. The full url path that the request will be sent to.
687 #
688 # This string must begin with either "http://" or "https://". Some examples
689 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
690 # encode some characters for safety and compatibility. The maximum allowed
691 # URL length is 2083 characters after encoding.
692 #
693 # The `Location` header response from a redirect response [`300` - `399`]
694 # may be followed. The redirect is not counted as a separate attempt.
695 "oidcToken": { # Contains information needed for generating an # If specified, an
696 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
697 # token will be generated and attached as an `Authorization` header in the
698 # HTTP request.
699 #
700 # This type of authorization can be used for many scenarios, including
701 # calling Cloud Run, or endpoints where you intend to validate the token
702 # yourself.
703 # [OpenID Connect
704 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
705 # This type of authorization can be used for many scenarios, including
706 # calling Cloud Run, or endpoints where you intend to validate the token
707 # yourself.
708 "audience": "A String", # Audience to be used when generating OIDC token. If not specified, the URI
709 # specified in target will be used.
710 "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
711 # to be used for generating OIDC token.
712 # The service account must be within the same project as the queue. The
713 # caller must have iam.serviceAccounts.actAs permission for the service
714 # account.
715 },
716 "oauthToken": { # Contains information needed for generating an # If specified, an
717 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
718 # will be generated and attached as an `Authorization` header in the HTTP
719 # request.
720 #
721 # This type of authorization should generally only be used when calling
722 # Google APIs hosted on *.googleapis.com.
723 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
724 # This type of authorization should generally only be used when calling Google
725 # APIs hosted on *.googleapis.com.
726 "scope": "A String", # OAuth scope to be used for generating OAuth access token.
727 # If not specified, "https://www.googleapis.com/auth/cloud-platform"
728 # will be used.
729 "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
730 # to be used for generating OAuth token.
731 # The service account must be within the same project as the queue. The
732 # caller must have iam.serviceAccounts.actAs permission for the service
733 # account.
734 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700735 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700736 },
737 "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
738 #
739 # An App Engine task is a task that has AppEngineHttpRequest set.
740 #
741 # The message defines the HTTP request that is sent to an App Engine app when
742 # the task is dispatched.
743 #
744 # Using AppEngineHttpRequest requires
745 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
746 # Google IAM permission for the project
747 # and the following scope:
748 #
749 # `https://www.googleapis.com/auth/cloud-platform`
750 #
751 # The task will be delivered to the App Engine app which belongs to the same
752 # project as the queue. For more information, see
753 # [How Requests are
754 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
755 # and how routing is affected by
756 # [dispatch
757 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
758 # Traffic is encrypted during transport and never leaves Google datacenters.
759 # Because this traffic is carried over a communication mechanism internal to
760 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
761 # The request to the handler, however, will appear to have used the HTTP
762 # protocol.
763 #
764 # The AppEngineRouting used to construct the URL that the task is
765 # delivered to can be set at the queue-level or task-level:
766 #
767 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -0700768 # app_engine_routing_override
769 # is used for all tasks in the queue, no matter what the setting
770 # is for the
771 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700772 #
773 #
774 # The `url` that the task will be sent to is:
775 #
776 # * `url =` host `+`
777 # relative_uri
778 #
779 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
780 # URIs restricted with
781 # [`login:
782 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
783 # Because tasks are not run as any user, they cannot be dispatched to URIs
784 # restricted with
785 # [`login:
786 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
787 # Task dispatches also do not follow redirects.
788 #
789 # The task attempt has succeeded if the app's request handler returns an HTTP
790 # response code in the range [`200` - `299`]. The task attempt has failed if
791 # the app's handler returns a non-2xx response code or Cloud Tasks does
792 # not receive response before the deadline. Failed
793 # tasks will be retried according to the
794 # retry configuration. `503` (Service Unavailable) is
795 # considered an App Engine system error instead of an application error and
796 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
797 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
798 # Requests) response from an app handler does not cause traffic congestion
799 # control to throttle the queue.
800 "body": "A String", # HTTP request body.
801 #
802 # A request body is allowed only if the HTTP method is POST or PUT. It is
803 # an error to set a body on a task with an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -0700804 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700805 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700806 # The app's request handler for the task's target URL must be able to handle
807 # HTTP requests with this http_method, otherwise the task attempt fails with
808 # error code 405 (Method Not Allowed). See [Writing a push task request
809 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
810 # and the App Engine documentation for your runtime on [How Requests are
811 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700812 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
813 #
814 # If set,
815 # app_engine_routing_override
816 # is used for all tasks in the queue, no matter what the setting is for the
817 # task-level app_engine_routing.
818 #
819 # Defines routing characteristics specific to App Engine - service, version,
820 # and instance.
821 #
822 # For more information about services, versions, and instances see
823 # [An Overview of App
824 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
825 # [Microservices Architecture on Google App
826 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
827 # [App Engine Standard request
828 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
829 # and [App Engine Flex request
830 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
831 "instance": "A String", # App instance.
832 #
833 # By default, the task is sent to an instance which is available when
834 # the task is attempted.
835 #
836 # Requests can only be sent to a specific instance if
837 # [manual scaling is used in App Engine
838 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
839 # App Engine Flex does not support instances. For more information, see
840 # [App Engine Standard request
841 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
842 # and [App Engine Flex request
843 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
844 "host": "A String", # Output only. The host that the task is sent to.
845 #
846 # The host is constructed from the domain name of the app associated with
Dan O'Mearadd494642020-05-01 07:42:23 -0700847 # the queue's project ID (for example &lt;app-id&gt;.appspot.com), and the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700848 # service, version,
849 # and instance. Tasks which were created using
850 # the App Engine SDK might have a custom domain name.
851 #
852 # For more information, see
853 # [How Requests are
854 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
855 "version": "A String", # App version.
856 #
857 # By default, the task is sent to the version which is the default
858 # version when the task is attempted.
859 #
860 # For some queues or tasks which were created using the App Engine
861 # Task Queue API, host is not parsable
862 # into service,
863 # version, and
864 # instance. For example, some tasks
865 # which were created using the App Engine SDK use a custom domain
866 # name; custom domains are not parsed by Cloud Tasks. If
867 # host is not parsable, then
868 # service,
869 # version, and
870 # instance are the empty string.
871 "service": "A String", # App service.
872 #
873 # By default, the task is sent to the service which is the default
874 # service when the task is attempted.
875 #
876 # For some queues or tasks which were created using the App Engine
877 # Task Queue API, host is not parsable
878 # into service,
879 # version, and
880 # instance. For example, some tasks
881 # which were created using the App Engine SDK use a custom domain
882 # name; custom domains are not parsed by Cloud Tasks. If
883 # host is not parsable, then
884 # service,
885 # version, and
886 # instance are the empty string.
887 },
888 "relativeUri": "A String", # The relative URI.
889 #
890 # The relative URI must begin with "/" and must be a valid HTTP relative URI.
891 # It can contain a path and query string arguments.
892 # If the relative URI is empty, then the root path "/" will be used.
893 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -0700894 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700895 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700896 # This map contains the header field names and values.
897 # Headers can be set when the
898 # task is created.
899 # Repeated headers are not supported but a header value can contain commas.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700900 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700901 # Cloud Tasks sets some headers to default values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700902 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700903 # * `User-Agent`: By default, this header is
904 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
905 # This header can be modified, but Cloud Tasks will append
906 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
907 # modified `User-Agent`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700908 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700909 # If the task has a body, Cloud
910 # Tasks sets the following headers:
911 #
912 # * `Content-Type`: By default, the `Content-Type` header is set to
913 # `"application/octet-stream"`. The default can be overridden by explicitly
914 # setting `Content-Type` to a particular media type when the
915 # task is created.
916 # For example, `Content-Type` can be set to `"application/json"`.
917 # * `Content-Length`: This is computed by Cloud Tasks. This value is
918 # output only. It cannot be changed.
919 #
920 # The headers below cannot be set or overridden:
921 #
922 # * `Host`
923 # * `X-Google-*`
924 # * `X-AppEngine-*`
925 #
926 # In addition, Cloud Tasks sets some headers when the task is dispatched,
927 # such as headers containing information about the task; see
928 # [request
929 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
930 # These headers are set only when the task is dispatched, so they are not
931 # visible when the task is returned in a Cloud Tasks response.
932 #
933 # Although there is no specific limit for the maximum number of headers or
934 # the size, there is a limit on the maximum size of the Task. For more
935 # information, see the CreateTask documentation.
936 "a_key": "A String",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700937 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700938 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700939 "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt.
940 #
941 # Only dispatch_time will be set.
942 # The other Attempt information is not retained by Cloud Tasks.
943 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
944 #
945 # `schedule_time` will be truncated to the nearest microsecond.
946 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
947 #
948 # If `response_time` is unset, then the task has not been attempted or is
949 # currently running and the `response_status` field is meaningless.
950 # different programming environments, including REST APIs and RPC APIs. It is
951 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
952 # three pieces of data: error code, error message, and error details.
953 #
954 # You can find out more about this error model and how to work with it in the
955 # [API Design Guide](https://cloud.google.com/apis/design/errors).
956 "message": "A String", # A developer-facing error message, which should be in English. Any
957 # user-facing error message should be localized and sent in the
958 # google.rpc.Status.details field, or localized by the client.
959 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
960 "details": [ # A list of messages that carry the error details. There is a common set of
961 # message types for APIs to use.
962 {
963 "a_key": "", # Properties of the object. Contains field @type with type URL.
964 },
965 ],
966 },
967 "responseTime": "A String", # Output only. The time that this attempt response was received.
968 #
969 # `response_time` will be truncated to the nearest microsecond.
970 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
971 #
972 # `dispatch_time` will be truncated to the nearest microsecond.
973 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700974 "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt.
975 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
976 #
977 # `schedule_time` will be truncated to the nearest microsecond.
978 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
979 #
980 # If `response_time` is unset, then the task has not been attempted or is
981 # currently running and the `response_status` field is meaningless.
982 # different programming environments, including REST APIs and RPC APIs. It is
983 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
984 # three pieces of data: error code, error message, and error details.
985 #
986 # You can find out more about this error model and how to work with it in the
987 # [API Design Guide](https://cloud.google.com/apis/design/errors).
988 "message": "A String", # A developer-facing error message, which should be in English. Any
989 # user-facing error message should be localized and sent in the
990 # google.rpc.Status.details field, or localized by the client.
991 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
992 "details": [ # A list of messages that carry the error details. There is a common set of
993 # message types for APIs to use.
994 {
995 "a_key": "", # Properties of the object. Contains field @type with type URL.
996 },
997 ],
998 },
999 "responseTime": "A String", # Output only. The time that this attempt response was received.
1000 #
1001 # `response_time` will be truncated to the nearest microsecond.
1002 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
1003 #
1004 # `dispatch_time` will be truncated to the nearest microsecond.
1005 },
1006 "name": "A String", # Optionally caller-specified in CreateTask.
1007 #
1008 # The task name.
1009 #
1010 # The task name must have the following format:
1011 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1012 #
1013 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1014 # hyphens (-), colons (:), or periods (.).
1015 # For more information, see
1016 # [Identifying
1017 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1018 # * `LOCATION_ID` is the canonical ID for the task's location.
1019 # The list of available locations can be obtained by calling
1020 # ListLocations.
1021 # For more information, see https://cloud.google.com/about/locations/.
1022 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1023 # hyphens (-). The maximum length is 100 characters.
1024 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1025 # hyphens (-), or underscores (_). The maximum length is 500 characters.
1026 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
1027 #
1028 # For App Engine queues, this is when the task will be attempted or retried.
1029 #
1030 # `schedule_time` will be truncated to the nearest microsecond.
1031 "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not
1032 # respond by this deadline then the request is cancelled and the attempt
1033 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
1034 # task according to the RetryConfig.
1035 #
1036 # Note that when the request is cancelled, Cloud Tasks will stop listing for
1037 # the response, but whether the worker stops processing depends on the
1038 # worker. For example, if the worker is stuck, it may not react to cancelled
1039 # requests.
1040 #
1041 # The default and maximum values depend on the type of request:
1042 #
1043 # * For HTTP tasks, the default is 10 minutes. The deadline
1044 # must be in the interval [15 seconds, 30 minutes].
1045 #
1046 # * For App Engine tasks, 0 indicates that the
1047 # request has the default deadline. The default deadline depends on the
1048 # [scaling
1049 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
1050 # of the service: 10 minutes for standard apps with automatic scaling, 24
1051 # hours for standard apps with manual and basic scaling, and 60 minutes for
1052 # flex apps. If the request deadline is set, it must be in the interval [15
1053 # seconds, 24 hours 15 seconds]. Regardless of the task's
1054 # `dispatch_deadline`, the app handler will not run for longer than than
1055 # the service's timeout. We recommend setting the `dispatch_deadline` to
1056 # at most a few seconds more than the app handler's timeout. For more
1057 # information see
1058 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
1059 #
1060 # `dispatch_deadline` will be truncated to the nearest millisecond. The
1061 # deadline is an approximate deadline.
1062 "view": "A String", # Output only. The view specifies which subset of the Task has
1063 # been returned.
1064 "createTime": "A String", # Output only. The time that the task was created.
1065 #
1066 # `create_time` will be truncated to the nearest second.
1067 "dispatchCount": 42, # Output only. The number of attempts dispatched.
1068 #
1069 # This count includes attempts which have been dispatched but haven't
1070 # received a response.
1071 "responseCount": 42, # Output only. The number of attempts which have received a response.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001072 }</pre>
1073</div>
1074
1075<div class="method">
1076 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
1077 <pre>Deletes a task.
1078
1079A task can be deleted if it is scheduled or dispatched. A task
1080cannot be deleted if it has executed successfully or permanently
1081failed.
1082
1083Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001084 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001085`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
1086 x__xgafv: string, V1 error format.
1087 Allowed values
1088 1 - v1 error format
1089 2 - v2 error format
1090
1091Returns:
1092 An object of the form:
1093
1094 { # A generic empty message that you can re-use to avoid defining duplicated
1095 # empty messages in your APIs. A typical example is to use it as the request
1096 # or the response type of an API method. For instance:
1097 #
1098 # service Foo {
1099 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
1100 # }
1101 #
1102 # The JSON representation for `Empty` is empty JSON object `{}`.
1103 }</pre>
1104</div>
1105
1106<div class="method">
1107 <code class="details" id="get">get(name, responseView=None, x__xgafv=None)</code>
1108 <pre>Gets a task.
1109
1110Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001111 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001112`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
1113 responseView: string, The response_view specifies which subset of the Task will be
1114returned.
1115
1116By default response_view is BASIC; not all
1117information is retrieved by default because some data, such as
1118payloads, might be desirable to return only when needed because
1119of its large size or because of the sensitivity of data that it
1120contains.
1121
1122Authorization for FULL requires
1123`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1124permission on the Task resource.
1125 x__xgafv: string, V1 error format.
1126 Allowed values
1127 1 - v1 error format
1128 2 - v2 error format
1129
1130Returns:
1131 An object of the form:
1132
1133 { # A unit of scheduled work.
1134 "httpRequest": { # HTTP request. # HTTP request that is sent to the task's target.
1135 #
1136 # An HTTP task is a task that has HttpRequest set.
1137 #
1138 # The task will be pushed to the worker as an HTTP request. If the worker
1139 # or the redirected worker acknowledges the task by returning a successful HTTP
Dan O'Mearadd494642020-05-01 07:42:23 -07001140 # response code ([`200` - `299`]), the task will be removed from the queue. If
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001141 # any other HTTP response code is returned or no response is received, the
1142 # task will be retried according to the following:
1143 #
1144 # * User-specified throttling: retry configuration,
1145 # rate limits, and the queue's state.
1146 #
1147 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
1148 # temporarily reduce the queue's effective rate. User-specified settings
1149 # will not be changed.
1150 #
1151 # System throttling happens because:
1152 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001153 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001154 # rate limits will be used. But if the worker returns
1155 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
1156 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
1157 # specified in the `Retry-After` HTTP response header is considered.
1158 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001159 # * To prevent traffic spikes and to smooth sudden increases in traffic,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001160 # dispatches ramp up slowly when the queue is newly created or idle and
1161 # if large numbers of tasks suddenly become available to dispatch (due to
1162 # spikes in create task rates, the queue being unpaused, or many tasks
1163 # that are scheduled at the same time).
1164 "body": "A String", # HTTP request body.
1165 #
1166 # A request body is allowed only if the
1167 # HTTP method is POST, PUT, or PATCH. It is an
1168 # error to set body on a task with an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07001169 "headers": { # HTTP request headers.
1170 #
1171 # This map contains the header field names and values.
1172 # Headers can be set when the
1173 # task is created.
1174 #
1175 # These headers represent a subset of the headers that will accompany the
1176 # task's HTTP request. Some HTTP request headers will be ignored or replaced.
1177 #
1178 # A partial list of headers that will be ignored or replaced is:
1179 #
1180 # * Host: This will be computed by Cloud Tasks and derived from
1181 # HttpRequest.url.
1182 # * Content-Length: This will be computed by Cloud Tasks.
1183 # * User-Agent: This will be set to `"Google-Cloud-Tasks"`.
1184 # * X-Google-*: Google use only.
1185 # * X-AppEngine-*: Google use only.
1186 #
1187 # `Content-Type` won't be set by Cloud Tasks. You can explicitly set
1188 # `Content-Type` to a media type when the
1189 # task is created.
1190 # For example, `Content-Type` can be set to `"application/octet-stream"` or
1191 # `"application/json"`.
1192 #
1193 # Headers which can have multiple values (according to RFC2616) can be
1194 # specified using comma-separated values.
1195 #
1196 # The size of the headers must be less than 80KB.
1197 "a_key": "A String",
1198 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001199 "url": "A String", # Required. The full url path that the request will be sent to.
1200 #
1201 # This string must begin with either "http://" or "https://". Some examples
1202 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
1203 # encode some characters for safety and compatibility. The maximum allowed
1204 # URL length is 2083 characters after encoding.
1205 #
1206 # The `Location` header response from a redirect response [`300` - `399`]
1207 # may be followed. The redirect is not counted as a separate attempt.
1208 "oidcToken": { # Contains information needed for generating an # If specified, an
1209 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
1210 # token will be generated and attached as an `Authorization` header in the
1211 # HTTP request.
1212 #
1213 # This type of authorization can be used for many scenarios, including
1214 # calling Cloud Run, or endpoints where you intend to validate the token
1215 # yourself.
1216 # [OpenID Connect
1217 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
1218 # This type of authorization can be used for many scenarios, including
1219 # calling Cloud Run, or endpoints where you intend to validate the token
1220 # yourself.
1221 "audience": "A String", # Audience to be used when generating OIDC token. If not specified, the URI
1222 # specified in target will be used.
1223 "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
1224 # to be used for generating OIDC token.
1225 # The service account must be within the same project as the queue. The
1226 # caller must have iam.serviceAccounts.actAs permission for the service
1227 # account.
1228 },
1229 "oauthToken": { # Contains information needed for generating an # If specified, an
1230 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
1231 # will be generated and attached as an `Authorization` header in the HTTP
1232 # request.
1233 #
1234 # This type of authorization should generally only be used when calling
1235 # Google APIs hosted on *.googleapis.com.
1236 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
1237 # This type of authorization should generally only be used when calling Google
1238 # APIs hosted on *.googleapis.com.
1239 "scope": "A String", # OAuth scope to be used for generating OAuth access token.
1240 # If not specified, "https://www.googleapis.com/auth/cloud-platform"
1241 # will be used.
1242 "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
1243 # to be used for generating OAuth token.
1244 # The service account must be within the same project as the queue. The
1245 # caller must have iam.serviceAccounts.actAs permission for the service
1246 # account.
1247 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001248 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001249 },
1250 "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
1251 #
1252 # An App Engine task is a task that has AppEngineHttpRequest set.
1253 #
1254 # The message defines the HTTP request that is sent to an App Engine app when
1255 # the task is dispatched.
1256 #
1257 # Using AppEngineHttpRequest requires
1258 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1259 # Google IAM permission for the project
1260 # and the following scope:
1261 #
1262 # `https://www.googleapis.com/auth/cloud-platform`
1263 #
1264 # The task will be delivered to the App Engine app which belongs to the same
1265 # project as the queue. For more information, see
1266 # [How Requests are
1267 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1268 # and how routing is affected by
1269 # [dispatch
1270 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
1271 # Traffic is encrypted during transport and never leaves Google datacenters.
1272 # Because this traffic is carried over a communication mechanism internal to
1273 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
1274 # The request to the handler, however, will appear to have used the HTTP
1275 # protocol.
1276 #
1277 # The AppEngineRouting used to construct the URL that the task is
1278 # delivered to can be set at the queue-level or task-level:
1279 #
1280 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07001281 # app_engine_routing_override
1282 # is used for all tasks in the queue, no matter what the setting
1283 # is for the
1284 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001285 #
1286 #
1287 # The `url` that the task will be sent to is:
1288 #
1289 # * `url =` host `+`
1290 # relative_uri
1291 #
1292 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
1293 # URIs restricted with
1294 # [`login:
1295 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
1296 # Because tasks are not run as any user, they cannot be dispatched to URIs
1297 # restricted with
1298 # [`login:
1299 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
1300 # Task dispatches also do not follow redirects.
1301 #
1302 # The task attempt has succeeded if the app's request handler returns an HTTP
1303 # response code in the range [`200` - `299`]. The task attempt has failed if
1304 # the app's handler returns a non-2xx response code or Cloud Tasks does
1305 # not receive response before the deadline. Failed
1306 # tasks will be retried according to the
1307 # retry configuration. `503` (Service Unavailable) is
1308 # considered an App Engine system error instead of an application error and
1309 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
1310 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
1311 # Requests) response from an app handler does not cause traffic congestion
1312 # control to throttle the queue.
1313 "body": "A String", # HTTP request body.
1314 #
1315 # A request body is allowed only if the HTTP method is POST or PUT. It is
1316 # an error to set a body on a task with an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07001317 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001318 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001319 # The app's request handler for the task's target URL must be able to handle
1320 # HTTP requests with this http_method, otherwise the task attempt fails with
1321 # error code 405 (Method Not Allowed). See [Writing a push task request
1322 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
1323 # and the App Engine documentation for your runtime on [How Requests are
1324 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001325 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
1326 #
1327 # If set,
1328 # app_engine_routing_override
1329 # is used for all tasks in the queue, no matter what the setting is for the
1330 # task-level app_engine_routing.
1331 #
1332 # Defines routing characteristics specific to App Engine - service, version,
1333 # and instance.
1334 #
1335 # For more information about services, versions, and instances see
1336 # [An Overview of App
1337 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
1338 # [Microservices Architecture on Google App
1339 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
1340 # [App Engine Standard request
1341 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
1342 # and [App Engine Flex request
1343 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1344 "instance": "A String", # App instance.
1345 #
1346 # By default, the task is sent to an instance which is available when
1347 # the task is attempted.
1348 #
1349 # Requests can only be sent to a specific instance if
1350 # [manual scaling is used in App Engine
1351 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
1352 # App Engine Flex does not support instances. For more information, see
1353 # [App Engine Standard request
1354 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1355 # and [App Engine Flex request
1356 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1357 "host": "A String", # Output only. The host that the task is sent to.
1358 #
1359 # The host is constructed from the domain name of the app associated with
Dan O'Mearadd494642020-05-01 07:42:23 -07001360 # the queue's project ID (for example &lt;app-id&gt;.appspot.com), and the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001361 # service, version,
1362 # and instance. Tasks which were created using
1363 # the App Engine SDK might have a custom domain name.
1364 #
1365 # For more information, see
1366 # [How Requests are
1367 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
1368 "version": "A String", # App version.
1369 #
1370 # By default, the task is sent to the version which is the default
1371 # version when the task is attempted.
1372 #
1373 # For some queues or tasks which were created using the App Engine
1374 # Task Queue API, host is not parsable
1375 # into service,
1376 # version, and
1377 # instance. For example, some tasks
1378 # which were created using the App Engine SDK use a custom domain
1379 # name; custom domains are not parsed by Cloud Tasks. If
1380 # host is not parsable, then
1381 # service,
1382 # version, and
1383 # instance are the empty string.
1384 "service": "A String", # App service.
1385 #
1386 # By default, the task is sent to the service which is the default
1387 # service when the task is attempted.
1388 #
1389 # For some queues or tasks which were created using the App Engine
1390 # Task Queue API, host is not parsable
1391 # into service,
1392 # version, and
1393 # instance. For example, some tasks
1394 # which were created using the App Engine SDK use a custom domain
1395 # name; custom domains are not parsed by Cloud Tasks. If
1396 # host is not parsable, then
1397 # service,
1398 # version, and
1399 # instance are the empty string.
1400 },
1401 "relativeUri": "A String", # The relative URI.
1402 #
1403 # The relative URI must begin with "/" and must be a valid HTTP relative URI.
1404 # It can contain a path and query string arguments.
1405 # If the relative URI is empty, then the root path "/" will be used.
1406 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -07001407 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001408 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001409 # This map contains the header field names and values.
1410 # Headers can be set when the
1411 # task is created.
1412 # Repeated headers are not supported but a header value can contain commas.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001413 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001414 # Cloud Tasks sets some headers to default values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001415 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001416 # * `User-Agent`: By default, this header is
1417 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
1418 # This header can be modified, but Cloud Tasks will append
1419 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
1420 # modified `User-Agent`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001421 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001422 # If the task has a body, Cloud
1423 # Tasks sets the following headers:
1424 #
1425 # * `Content-Type`: By default, the `Content-Type` header is set to
1426 # `"application/octet-stream"`. The default can be overridden by explicitly
1427 # setting `Content-Type` to a particular media type when the
1428 # task is created.
1429 # For example, `Content-Type` can be set to `"application/json"`.
1430 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1431 # output only. It cannot be changed.
1432 #
1433 # The headers below cannot be set or overridden:
1434 #
1435 # * `Host`
1436 # * `X-Google-*`
1437 # * `X-AppEngine-*`
1438 #
1439 # In addition, Cloud Tasks sets some headers when the task is dispatched,
1440 # such as headers containing information about the task; see
1441 # [request
1442 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
1443 # These headers are set only when the task is dispatched, so they are not
1444 # visible when the task is returned in a Cloud Tasks response.
1445 #
1446 # Although there is no specific limit for the maximum number of headers or
1447 # the size, there is a limit on the maximum size of the Task. For more
1448 # information, see the CreateTask documentation.
1449 "a_key": "A String",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001450 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001451 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001452 "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt.
1453 #
1454 # Only dispatch_time will be set.
1455 # The other Attempt information is not retained by Cloud Tasks.
1456 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
1457 #
1458 # `schedule_time` will be truncated to the nearest microsecond.
1459 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
1460 #
1461 # If `response_time` is unset, then the task has not been attempted or is
1462 # currently running and the `response_status` field is meaningless.
1463 # different programming environments, including REST APIs and RPC APIs. It is
1464 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1465 # three pieces of data: error code, error message, and error details.
1466 #
1467 # You can find out more about this error model and how to work with it in the
1468 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1469 "message": "A String", # A developer-facing error message, which should be in English. Any
1470 # user-facing error message should be localized and sent in the
1471 # google.rpc.Status.details field, or localized by the client.
1472 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
1473 "details": [ # A list of messages that carry the error details. There is a common set of
1474 # message types for APIs to use.
1475 {
1476 "a_key": "", # Properties of the object. Contains field @type with type URL.
1477 },
1478 ],
1479 },
1480 "responseTime": "A String", # Output only. The time that this attempt response was received.
1481 #
1482 # `response_time` will be truncated to the nearest microsecond.
1483 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
1484 #
1485 # `dispatch_time` will be truncated to the nearest microsecond.
1486 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001487 "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt.
1488 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
1489 #
1490 # `schedule_time` will be truncated to the nearest microsecond.
1491 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
1492 #
1493 # If `response_time` is unset, then the task has not been attempted or is
1494 # currently running and the `response_status` field is meaningless.
1495 # different programming environments, including REST APIs and RPC APIs. It is
1496 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1497 # three pieces of data: error code, error message, and error details.
1498 #
1499 # You can find out more about this error model and how to work with it in the
1500 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1501 "message": "A String", # A developer-facing error message, which should be in English. Any
1502 # user-facing error message should be localized and sent in the
1503 # google.rpc.Status.details field, or localized by the client.
1504 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
1505 "details": [ # A list of messages that carry the error details. There is a common set of
1506 # message types for APIs to use.
1507 {
1508 "a_key": "", # Properties of the object. Contains field @type with type URL.
1509 },
1510 ],
1511 },
1512 "responseTime": "A String", # Output only. The time that this attempt response was received.
1513 #
1514 # `response_time` will be truncated to the nearest microsecond.
1515 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
1516 #
1517 # `dispatch_time` will be truncated to the nearest microsecond.
1518 },
1519 "name": "A String", # Optionally caller-specified in CreateTask.
1520 #
1521 # The task name.
1522 #
1523 # The task name must have the following format:
1524 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1525 #
1526 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1527 # hyphens (-), colons (:), or periods (.).
1528 # For more information, see
1529 # [Identifying
1530 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1531 # * `LOCATION_ID` is the canonical ID for the task's location.
1532 # The list of available locations can be obtained by calling
1533 # ListLocations.
1534 # For more information, see https://cloud.google.com/about/locations/.
1535 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1536 # hyphens (-). The maximum length is 100 characters.
1537 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1538 # hyphens (-), or underscores (_). The maximum length is 500 characters.
1539 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
1540 #
1541 # For App Engine queues, this is when the task will be attempted or retried.
1542 #
1543 # `schedule_time` will be truncated to the nearest microsecond.
1544 "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not
1545 # respond by this deadline then the request is cancelled and the attempt
1546 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
1547 # task according to the RetryConfig.
1548 #
1549 # Note that when the request is cancelled, Cloud Tasks will stop listing for
1550 # the response, but whether the worker stops processing depends on the
1551 # worker. For example, if the worker is stuck, it may not react to cancelled
1552 # requests.
1553 #
1554 # The default and maximum values depend on the type of request:
1555 #
1556 # * For HTTP tasks, the default is 10 minutes. The deadline
1557 # must be in the interval [15 seconds, 30 minutes].
1558 #
1559 # * For App Engine tasks, 0 indicates that the
1560 # request has the default deadline. The default deadline depends on the
1561 # [scaling
1562 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
1563 # of the service: 10 minutes for standard apps with automatic scaling, 24
1564 # hours for standard apps with manual and basic scaling, and 60 minutes for
1565 # flex apps. If the request deadline is set, it must be in the interval [15
1566 # seconds, 24 hours 15 seconds]. Regardless of the task's
1567 # `dispatch_deadline`, the app handler will not run for longer than than
1568 # the service's timeout. We recommend setting the `dispatch_deadline` to
1569 # at most a few seconds more than the app handler's timeout. For more
1570 # information see
1571 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
1572 #
1573 # `dispatch_deadline` will be truncated to the nearest millisecond. The
1574 # deadline is an approximate deadline.
1575 "view": "A String", # Output only. The view specifies which subset of the Task has
1576 # been returned.
1577 "createTime": "A String", # Output only. The time that the task was created.
1578 #
1579 # `create_time` will be truncated to the nearest second.
1580 "dispatchCount": 42, # Output only. The number of attempts dispatched.
1581 #
1582 # This count includes attempts which have been dispatched but haven't
1583 # received a response.
1584 "responseCount": 42, # Output only. The number of attempts which have received a response.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001585 }</pre>
1586</div>
1587
1588<div class="method">
1589 <code class="details" id="list">list(parent, responseView=None, pageSize=None, pageToken=None, x__xgafv=None)</code>
1590 <pre>Lists the tasks in a queue.
1591
1592By default, only the BASIC view is retrieved
1593due to performance considerations;
1594response_view controls the
1595subset of information which is returned.
1596
1597The tasks may be returned in any order. The ordering may change at any
1598time.
1599
1600Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001601 parent: string, Required. The queue name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001602`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` (required)
1603 responseView: string, The response_view specifies which subset of the Task will be
1604returned.
1605
1606By default response_view is BASIC; not all
1607information is retrieved by default because some data, such as
1608payloads, might be desirable to return only when needed because
1609of its large size or because of the sensitivity of data that it
1610contains.
1611
1612Authorization for FULL requires
1613`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1614permission on the Task resource.
1615 pageSize: integer, Maximum page size.
1616
1617Fewer tasks than requested might be returned, even if more tasks exist; use
1618next_page_token in the response to
1619determine if more tasks exist.
1620
1621The maximum page size is 1000. If unspecified, the page size will be the
1622maximum.
1623 pageToken: string, A token identifying the page of results to return.
1624
1625To request the first page results, page_token must be empty. To
1626request the next page of results, page_token must be the value of
1627next_page_token returned
1628from the previous call to ListTasks
1629method.
1630
1631The page token is valid for only 2 hours.
1632 x__xgafv: string, V1 error format.
1633 Allowed values
1634 1 - v1 error format
1635 2 - v2 error format
1636
1637Returns:
1638 An object of the form:
1639
1640 { # Response message for listing tasks using ListTasks.
1641 "nextPageToken": "A String", # A token to retrieve next page of results.
1642 #
1643 # To return the next page of results, call
1644 # ListTasks with this value as the
1645 # page_token.
1646 #
1647 # If the next_page_token is empty, there are no more results.
1648 "tasks": [ # The list of tasks.
1649 { # A unit of scheduled work.
1650 "httpRequest": { # HTTP request. # HTTP request that is sent to the task's target.
1651 #
1652 # An HTTP task is a task that has HttpRequest set.
1653 #
1654 # The task will be pushed to the worker as an HTTP request. If the worker
1655 # or the redirected worker acknowledges the task by returning a successful HTTP
Dan O'Mearadd494642020-05-01 07:42:23 -07001656 # response code ([`200` - `299`]), the task will be removed from the queue. If
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001657 # any other HTTP response code is returned or no response is received, the
1658 # task will be retried according to the following:
1659 #
1660 # * User-specified throttling: retry configuration,
1661 # rate limits, and the queue's state.
1662 #
1663 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
1664 # temporarily reduce the queue's effective rate. User-specified settings
1665 # will not be changed.
1666 #
1667 # System throttling happens because:
1668 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001669 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001670 # rate limits will be used. But if the worker returns
1671 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
1672 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
1673 # specified in the `Retry-After` HTTP response header is considered.
1674 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001675 # * To prevent traffic spikes and to smooth sudden increases in traffic,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001676 # dispatches ramp up slowly when the queue is newly created or idle and
1677 # if large numbers of tasks suddenly become available to dispatch (due to
1678 # spikes in create task rates, the queue being unpaused, or many tasks
1679 # that are scheduled at the same time).
1680 "body": "A String", # HTTP request body.
1681 #
1682 # A request body is allowed only if the
1683 # HTTP method is POST, PUT, or PATCH. It is an
1684 # error to set body on a task with an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07001685 "headers": { # HTTP request headers.
1686 #
1687 # This map contains the header field names and values.
1688 # Headers can be set when the
1689 # task is created.
1690 #
1691 # These headers represent a subset of the headers that will accompany the
1692 # task's HTTP request. Some HTTP request headers will be ignored or replaced.
1693 #
1694 # A partial list of headers that will be ignored or replaced is:
1695 #
1696 # * Host: This will be computed by Cloud Tasks and derived from
1697 # HttpRequest.url.
1698 # * Content-Length: This will be computed by Cloud Tasks.
1699 # * User-Agent: This will be set to `"Google-Cloud-Tasks"`.
1700 # * X-Google-*: Google use only.
1701 # * X-AppEngine-*: Google use only.
1702 #
1703 # `Content-Type` won't be set by Cloud Tasks. You can explicitly set
1704 # `Content-Type` to a media type when the
1705 # task is created.
1706 # For example, `Content-Type` can be set to `"application/octet-stream"` or
1707 # `"application/json"`.
1708 #
1709 # Headers which can have multiple values (according to RFC2616) can be
1710 # specified using comma-separated values.
1711 #
1712 # The size of the headers must be less than 80KB.
1713 "a_key": "A String",
1714 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001715 "url": "A String", # Required. The full url path that the request will be sent to.
1716 #
1717 # This string must begin with either "http://" or "https://". Some examples
1718 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
1719 # encode some characters for safety and compatibility. The maximum allowed
1720 # URL length is 2083 characters after encoding.
1721 #
1722 # The `Location` header response from a redirect response [`300` - `399`]
1723 # may be followed. The redirect is not counted as a separate attempt.
1724 "oidcToken": { # Contains information needed for generating an # If specified, an
1725 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
1726 # token will be generated and attached as an `Authorization` header in the
1727 # HTTP request.
1728 #
1729 # This type of authorization can be used for many scenarios, including
1730 # calling Cloud Run, or endpoints where you intend to validate the token
1731 # yourself.
1732 # [OpenID Connect
1733 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
1734 # This type of authorization can be used for many scenarios, including
1735 # calling Cloud Run, or endpoints where you intend to validate the token
1736 # yourself.
1737 "audience": "A String", # Audience to be used when generating OIDC token. If not specified, the URI
1738 # specified in target will be used.
1739 "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
1740 # to be used for generating OIDC token.
1741 # The service account must be within the same project as the queue. The
1742 # caller must have iam.serviceAccounts.actAs permission for the service
1743 # account.
1744 },
1745 "oauthToken": { # Contains information needed for generating an # If specified, an
1746 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
1747 # will be generated and attached as an `Authorization` header in the HTTP
1748 # request.
1749 #
1750 # This type of authorization should generally only be used when calling
1751 # Google APIs hosted on *.googleapis.com.
1752 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
1753 # This type of authorization should generally only be used when calling Google
1754 # APIs hosted on *.googleapis.com.
1755 "scope": "A String", # OAuth scope to be used for generating OAuth access token.
1756 # If not specified, "https://www.googleapis.com/auth/cloud-platform"
1757 # will be used.
1758 "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
1759 # to be used for generating OAuth token.
1760 # The service account must be within the same project as the queue. The
1761 # caller must have iam.serviceAccounts.actAs permission for the service
1762 # account.
1763 },
Dan O'Mearadd494642020-05-01 07:42:23 -07001764 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001765 },
1766 "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
1767 #
1768 # An App Engine task is a task that has AppEngineHttpRequest set.
1769 #
1770 # The message defines the HTTP request that is sent to an App Engine app when
1771 # the task is dispatched.
1772 #
1773 # Using AppEngineHttpRequest requires
1774 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1775 # Google IAM permission for the project
1776 # and the following scope:
1777 #
1778 # `https://www.googleapis.com/auth/cloud-platform`
1779 #
1780 # The task will be delivered to the App Engine app which belongs to the same
1781 # project as the queue. For more information, see
1782 # [How Requests are
1783 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1784 # and how routing is affected by
1785 # [dispatch
1786 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
1787 # Traffic is encrypted during transport and never leaves Google datacenters.
1788 # Because this traffic is carried over a communication mechanism internal to
1789 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
1790 # The request to the handler, however, will appear to have used the HTTP
1791 # protocol.
1792 #
1793 # The AppEngineRouting used to construct the URL that the task is
1794 # delivered to can be set at the queue-level or task-level:
1795 #
1796 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07001797 # app_engine_routing_override
1798 # is used for all tasks in the queue, no matter what the setting
1799 # is for the
1800 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001801 #
1802 #
1803 # The `url` that the task will be sent to is:
1804 #
1805 # * `url =` host `+`
1806 # relative_uri
1807 #
1808 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
1809 # URIs restricted with
1810 # [`login:
1811 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
1812 # Because tasks are not run as any user, they cannot be dispatched to URIs
1813 # restricted with
1814 # [`login:
1815 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
1816 # Task dispatches also do not follow redirects.
1817 #
1818 # The task attempt has succeeded if the app's request handler returns an HTTP
1819 # response code in the range [`200` - `299`]. The task attempt has failed if
1820 # the app's handler returns a non-2xx response code or Cloud Tasks does
1821 # not receive response before the deadline. Failed
1822 # tasks will be retried according to the
1823 # retry configuration. `503` (Service Unavailable) is
1824 # considered an App Engine system error instead of an application error and
1825 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
1826 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
1827 # Requests) response from an app handler does not cause traffic congestion
1828 # control to throttle the queue.
1829 "body": "A String", # HTTP request body.
1830 #
1831 # A request body is allowed only if the HTTP method is POST or PUT. It is
1832 # an error to set a body on a task with an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07001833 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001834 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001835 # The app's request handler for the task's target URL must be able to handle
1836 # HTTP requests with this http_method, otherwise the task attempt fails with
1837 # error code 405 (Method Not Allowed). See [Writing a push task request
1838 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
1839 # and the App Engine documentation for your runtime on [How Requests are
1840 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001841 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
1842 #
1843 # If set,
1844 # app_engine_routing_override
1845 # is used for all tasks in the queue, no matter what the setting is for the
1846 # task-level app_engine_routing.
1847 #
1848 # Defines routing characteristics specific to App Engine - service, version,
1849 # and instance.
1850 #
1851 # For more information about services, versions, and instances see
1852 # [An Overview of App
1853 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
1854 # [Microservices Architecture on Google App
1855 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
1856 # [App Engine Standard request
1857 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
1858 # and [App Engine Flex request
1859 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1860 "instance": "A String", # App instance.
1861 #
1862 # By default, the task is sent to an instance which is available when
1863 # the task is attempted.
1864 #
1865 # Requests can only be sent to a specific instance if
1866 # [manual scaling is used in App Engine
1867 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
1868 # App Engine Flex does not support instances. For more information, see
1869 # [App Engine Standard request
1870 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1871 # and [App Engine Flex request
1872 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1873 "host": "A String", # Output only. The host that the task is sent to.
1874 #
1875 # The host is constructed from the domain name of the app associated with
Dan O'Mearadd494642020-05-01 07:42:23 -07001876 # the queue's project ID (for example &lt;app-id&gt;.appspot.com), and the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001877 # service, version,
1878 # and instance. Tasks which were created using
1879 # the App Engine SDK might have a custom domain name.
1880 #
1881 # For more information, see
1882 # [How Requests are
1883 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
1884 "version": "A String", # App version.
1885 #
1886 # By default, the task is sent to the version which is the default
1887 # version when the task is attempted.
1888 #
1889 # For some queues or tasks which were created using the App Engine
1890 # Task Queue API, host is not parsable
1891 # into service,
1892 # version, and
1893 # instance. For example, some tasks
1894 # which were created using the App Engine SDK use a custom domain
1895 # name; custom domains are not parsed by Cloud Tasks. If
1896 # host is not parsable, then
1897 # service,
1898 # version, and
1899 # instance are the empty string.
1900 "service": "A String", # App service.
1901 #
1902 # By default, the task is sent to the service which is the default
1903 # service when the task is attempted.
1904 #
1905 # For some queues or tasks which were created using the App Engine
1906 # Task Queue API, host is not parsable
1907 # into service,
1908 # version, and
1909 # instance. For example, some tasks
1910 # which were created using the App Engine SDK use a custom domain
1911 # name; custom domains are not parsed by Cloud Tasks. If
1912 # host is not parsable, then
1913 # service,
1914 # version, and
1915 # instance are the empty string.
1916 },
1917 "relativeUri": "A String", # The relative URI.
1918 #
1919 # The relative URI must begin with "/" and must be a valid HTTP relative URI.
1920 # It can contain a path and query string arguments.
1921 # If the relative URI is empty, then the root path "/" will be used.
1922 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -07001923 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001924 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001925 # This map contains the header field names and values.
1926 # Headers can be set when the
1927 # task is created.
1928 # Repeated headers are not supported but a header value can contain commas.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001929 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001930 # Cloud Tasks sets some headers to default values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001931 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001932 # * `User-Agent`: By default, this header is
1933 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
1934 # This header can be modified, but Cloud Tasks will append
1935 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
1936 # modified `User-Agent`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001937 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001938 # If the task has a body, Cloud
1939 # Tasks sets the following headers:
1940 #
1941 # * `Content-Type`: By default, the `Content-Type` header is set to
1942 # `"application/octet-stream"`. The default can be overridden by explicitly
1943 # setting `Content-Type` to a particular media type when the
1944 # task is created.
1945 # For example, `Content-Type` can be set to `"application/json"`.
1946 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1947 # output only. It cannot be changed.
1948 #
1949 # The headers below cannot be set or overridden:
1950 #
1951 # * `Host`
1952 # * `X-Google-*`
1953 # * `X-AppEngine-*`
1954 #
1955 # In addition, Cloud Tasks sets some headers when the task is dispatched,
1956 # such as headers containing information about the task; see
1957 # [request
1958 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
1959 # These headers are set only when the task is dispatched, so they are not
1960 # visible when the task is returned in a Cloud Tasks response.
1961 #
1962 # Although there is no specific limit for the maximum number of headers or
1963 # the size, there is a limit on the maximum size of the Task. For more
1964 # information, see the CreateTask documentation.
1965 "a_key": "A String",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001966 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001967 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001968 "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt.
1969 #
1970 # Only dispatch_time will be set.
1971 # The other Attempt information is not retained by Cloud Tasks.
1972 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
1973 #
1974 # `schedule_time` will be truncated to the nearest microsecond.
1975 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
1976 #
1977 # If `response_time` is unset, then the task has not been attempted or is
1978 # currently running and the `response_status` field is meaningless.
1979 # different programming environments, including REST APIs and RPC APIs. It is
1980 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1981 # three pieces of data: error code, error message, and error details.
1982 #
1983 # You can find out more about this error model and how to work with it in the
1984 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1985 "message": "A String", # A developer-facing error message, which should be in English. Any
1986 # user-facing error message should be localized and sent in the
1987 # google.rpc.Status.details field, or localized by the client.
1988 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
1989 "details": [ # A list of messages that carry the error details. There is a common set of
1990 # message types for APIs to use.
1991 {
1992 "a_key": "", # Properties of the object. Contains field @type with type URL.
1993 },
1994 ],
1995 },
1996 "responseTime": "A String", # Output only. The time that this attempt response was received.
1997 #
1998 # `response_time` will be truncated to the nearest microsecond.
1999 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
2000 #
2001 # `dispatch_time` will be truncated to the nearest microsecond.
2002 },
Dan O'Mearadd494642020-05-01 07:42:23 -07002003 "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt.
2004 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
2005 #
2006 # `schedule_time` will be truncated to the nearest microsecond.
2007 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
2008 #
2009 # If `response_time` is unset, then the task has not been attempted or is
2010 # currently running and the `response_status` field is meaningless.
2011 # different programming environments, including REST APIs and RPC APIs. It is
2012 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2013 # three pieces of data: error code, error message, and error details.
2014 #
2015 # You can find out more about this error model and how to work with it in the
2016 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2017 "message": "A String", # A developer-facing error message, which should be in English. Any
2018 # user-facing error message should be localized and sent in the
2019 # google.rpc.Status.details field, or localized by the client.
2020 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
2021 "details": [ # A list of messages that carry the error details. There is a common set of
2022 # message types for APIs to use.
2023 {
2024 "a_key": "", # Properties of the object. Contains field @type with type URL.
2025 },
2026 ],
2027 },
2028 "responseTime": "A String", # Output only. The time that this attempt response was received.
2029 #
2030 # `response_time` will be truncated to the nearest microsecond.
2031 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
2032 #
2033 # `dispatch_time` will be truncated to the nearest microsecond.
2034 },
2035 "name": "A String", # Optionally caller-specified in CreateTask.
2036 #
2037 # The task name.
2038 #
2039 # The task name must have the following format:
2040 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
2041 #
2042 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
2043 # hyphens (-), colons (:), or periods (.).
2044 # For more information, see
2045 # [Identifying
2046 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
2047 # * `LOCATION_ID` is the canonical ID for the task's location.
2048 # The list of available locations can be obtained by calling
2049 # ListLocations.
2050 # For more information, see https://cloud.google.com/about/locations/.
2051 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
2052 # hyphens (-). The maximum length is 100 characters.
2053 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
2054 # hyphens (-), or underscores (_). The maximum length is 500 characters.
2055 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
2056 #
2057 # For App Engine queues, this is when the task will be attempted or retried.
2058 #
2059 # `schedule_time` will be truncated to the nearest microsecond.
2060 "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not
2061 # respond by this deadline then the request is cancelled and the attempt
2062 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
2063 # task according to the RetryConfig.
2064 #
2065 # Note that when the request is cancelled, Cloud Tasks will stop listing for
2066 # the response, but whether the worker stops processing depends on the
2067 # worker. For example, if the worker is stuck, it may not react to cancelled
2068 # requests.
2069 #
2070 # The default and maximum values depend on the type of request:
2071 #
2072 # * For HTTP tasks, the default is 10 minutes. The deadline
2073 # must be in the interval [15 seconds, 30 minutes].
2074 #
2075 # * For App Engine tasks, 0 indicates that the
2076 # request has the default deadline. The default deadline depends on the
2077 # [scaling
2078 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
2079 # of the service: 10 minutes for standard apps with automatic scaling, 24
2080 # hours for standard apps with manual and basic scaling, and 60 minutes for
2081 # flex apps. If the request deadline is set, it must be in the interval [15
2082 # seconds, 24 hours 15 seconds]. Regardless of the task's
2083 # `dispatch_deadline`, the app handler will not run for longer than than
2084 # the service's timeout. We recommend setting the `dispatch_deadline` to
2085 # at most a few seconds more than the app handler's timeout. For more
2086 # information see
2087 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
2088 #
2089 # `dispatch_deadline` will be truncated to the nearest millisecond. The
2090 # deadline is an approximate deadline.
2091 "view": "A String", # Output only. The view specifies which subset of the Task has
2092 # been returned.
2093 "createTime": "A String", # Output only. The time that the task was created.
2094 #
2095 # `create_time` will be truncated to the nearest second.
2096 "dispatchCount": 42, # Output only. The number of attempts dispatched.
2097 #
2098 # This count includes attempts which have been dispatched but haven't
2099 # received a response.
2100 "responseCount": 42, # Output only. The number of attempts which have received a response.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002101 },
2102 ],
2103 }</pre>
2104</div>
2105
2106<div class="method">
2107 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
2108 <pre>Retrieves the next page of results.
2109
2110Args:
2111 previous_request: The request for the previous page. (required)
2112 previous_response: The response from the request for the previous page. (required)
2113
2114Returns:
2115 A request object that you can call 'execute()' on to request the next
2116 page. Returns None if there are no more items in the collection.
2117 </pre>
2118</div>
2119
2120<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002121 <code class="details" id="run">run(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002122 <pre>Forces a task to run now.
2123
2124When this method is called, Cloud Tasks will dispatch the task, even if
2125the task is already running, the queue has reached its RateLimits or
2126is PAUSED.
2127
2128This command is meant to be used for manual debugging. For
2129example, RunTask can be used to retry a failed
2130task after a fix has been made or to manually force a task to be
2131dispatched now.
2132
2133The dispatched task is returned. That is, the task that is returned
2134contains the status after the task is dispatched but
2135before the task is received by its target.
2136
2137If Cloud Tasks receives a successful response from the task's
2138target, then the task will be deleted; otherwise the task's
2139schedule_time will be reset to the time that
2140RunTask was called plus the retry delay specified
2141in the queue's RetryConfig.
2142
2143RunTask returns
2144NOT_FOUND when it is called on a
2145task that has already succeeded or permanently failed.
2146
2147Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07002148 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002149`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002150 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002151 The object takes the form of:
2152
2153{ # Request message for forcing a task to run now using
2154 # RunTask.
2155 "responseView": "A String", # The response_view specifies which subset of the Task will be
2156 # returned.
2157 #
2158 # By default response_view is BASIC; not all
2159 # information is retrieved by default because some data, such as
2160 # payloads, might be desirable to return only when needed because
2161 # of its large size or because of the sensitivity of data that it
2162 # contains.
2163 #
2164 # Authorization for FULL requires
2165 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
2166 # permission on the Task resource.
2167 }
2168
2169 x__xgafv: string, V1 error format.
2170 Allowed values
2171 1 - v1 error format
2172 2 - v2 error format
2173
2174Returns:
2175 An object of the form:
2176
2177 { # A unit of scheduled work.
2178 "httpRequest": { # HTTP request. # HTTP request that is sent to the task's target.
2179 #
2180 # An HTTP task is a task that has HttpRequest set.
2181 #
2182 # The task will be pushed to the worker as an HTTP request. If the worker
2183 # or the redirected worker acknowledges the task by returning a successful HTTP
Dan O'Mearadd494642020-05-01 07:42:23 -07002184 # response code ([`200` - `299`]), the task will be removed from the queue. If
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002185 # any other HTTP response code is returned or no response is received, the
2186 # task will be retried according to the following:
2187 #
2188 # * User-specified throttling: retry configuration,
2189 # rate limits, and the queue's state.
2190 #
2191 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
2192 # temporarily reduce the queue's effective rate. User-specified settings
2193 # will not be changed.
2194 #
2195 # System throttling happens because:
2196 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002197 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002198 # rate limits will be used. But if the worker returns
2199 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
2200 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
2201 # specified in the `Retry-After` HTTP response header is considered.
2202 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002203 # * To prevent traffic spikes and to smooth sudden increases in traffic,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002204 # dispatches ramp up slowly when the queue is newly created or idle and
2205 # if large numbers of tasks suddenly become available to dispatch (due to
2206 # spikes in create task rates, the queue being unpaused, or many tasks
2207 # that are scheduled at the same time).
2208 "body": "A String", # HTTP request body.
2209 #
2210 # A request body is allowed only if the
2211 # HTTP method is POST, PUT, or PATCH. It is an
2212 # error to set body on a task with an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07002213 "headers": { # HTTP request headers.
2214 #
2215 # This map contains the header field names and values.
2216 # Headers can be set when the
2217 # task is created.
2218 #
2219 # These headers represent a subset of the headers that will accompany the
2220 # task's HTTP request. Some HTTP request headers will be ignored or replaced.
2221 #
2222 # A partial list of headers that will be ignored or replaced is:
2223 #
2224 # * Host: This will be computed by Cloud Tasks and derived from
2225 # HttpRequest.url.
2226 # * Content-Length: This will be computed by Cloud Tasks.
2227 # * User-Agent: This will be set to `"Google-Cloud-Tasks"`.
2228 # * X-Google-*: Google use only.
2229 # * X-AppEngine-*: Google use only.
2230 #
2231 # `Content-Type` won't be set by Cloud Tasks. You can explicitly set
2232 # `Content-Type` to a media type when the
2233 # task is created.
2234 # For example, `Content-Type` can be set to `"application/octet-stream"` or
2235 # `"application/json"`.
2236 #
2237 # Headers which can have multiple values (according to RFC2616) can be
2238 # specified using comma-separated values.
2239 #
2240 # The size of the headers must be less than 80KB.
2241 "a_key": "A String",
2242 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002243 "url": "A String", # Required. The full url path that the request will be sent to.
2244 #
2245 # This string must begin with either "http://" or "https://". Some examples
2246 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
2247 # encode some characters for safety and compatibility. The maximum allowed
2248 # URL length is 2083 characters after encoding.
2249 #
2250 # The `Location` header response from a redirect response [`300` - `399`]
2251 # may be followed. The redirect is not counted as a separate attempt.
2252 "oidcToken": { # Contains information needed for generating an # If specified, an
2253 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
2254 # token will be generated and attached as an `Authorization` header in the
2255 # HTTP request.
2256 #
2257 # This type of authorization can be used for many scenarios, including
2258 # calling Cloud Run, or endpoints where you intend to validate the token
2259 # yourself.
2260 # [OpenID Connect
2261 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
2262 # This type of authorization can be used for many scenarios, including
2263 # calling Cloud Run, or endpoints where you intend to validate the token
2264 # yourself.
2265 "audience": "A String", # Audience to be used when generating OIDC token. If not specified, the URI
2266 # specified in target will be used.
2267 "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
2268 # to be used for generating OIDC token.
2269 # The service account must be within the same project as the queue. The
2270 # caller must have iam.serviceAccounts.actAs permission for the service
2271 # account.
2272 },
2273 "oauthToken": { # Contains information needed for generating an # If specified, an
2274 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
2275 # will be generated and attached as an `Authorization` header in the HTTP
2276 # request.
2277 #
2278 # This type of authorization should generally only be used when calling
2279 # Google APIs hosted on *.googleapis.com.
2280 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
2281 # This type of authorization should generally only be used when calling Google
2282 # APIs hosted on *.googleapis.com.
2283 "scope": "A String", # OAuth scope to be used for generating OAuth access token.
2284 # If not specified, "https://www.googleapis.com/auth/cloud-platform"
2285 # will be used.
2286 "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
2287 # to be used for generating OAuth token.
2288 # The service account must be within the same project as the queue. The
2289 # caller must have iam.serviceAccounts.actAs permission for the service
2290 # account.
2291 },
Dan O'Mearadd494642020-05-01 07:42:23 -07002292 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002293 },
2294 "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
2295 #
2296 # An App Engine task is a task that has AppEngineHttpRequest set.
2297 #
2298 # The message defines the HTTP request that is sent to an App Engine app when
2299 # the task is dispatched.
2300 #
2301 # Using AppEngineHttpRequest requires
2302 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
2303 # Google IAM permission for the project
2304 # and the following scope:
2305 #
2306 # `https://www.googleapis.com/auth/cloud-platform`
2307 #
2308 # The task will be delivered to the App Engine app which belongs to the same
2309 # project as the queue. For more information, see
2310 # [How Requests are
2311 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2312 # and how routing is affected by
2313 # [dispatch
2314 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
2315 # Traffic is encrypted during transport and never leaves Google datacenters.
2316 # Because this traffic is carried over a communication mechanism internal to
2317 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
2318 # The request to the handler, however, will appear to have used the HTTP
2319 # protocol.
2320 #
2321 # The AppEngineRouting used to construct the URL that the task is
2322 # delivered to can be set at the queue-level or task-level:
2323 #
2324 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07002325 # app_engine_routing_override
2326 # is used for all tasks in the queue, no matter what the setting
2327 # is for the
2328 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002329 #
2330 #
2331 # The `url` that the task will be sent to is:
2332 #
2333 # * `url =` host `+`
2334 # relative_uri
2335 #
2336 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
2337 # URIs restricted with
2338 # [`login:
2339 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
2340 # Because tasks are not run as any user, they cannot be dispatched to URIs
2341 # restricted with
2342 # [`login:
2343 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
2344 # Task dispatches also do not follow redirects.
2345 #
2346 # The task attempt has succeeded if the app's request handler returns an HTTP
2347 # response code in the range [`200` - `299`]. The task attempt has failed if
2348 # the app's handler returns a non-2xx response code or Cloud Tasks does
2349 # not receive response before the deadline. Failed
2350 # tasks will be retried according to the
2351 # retry configuration. `503` (Service Unavailable) is
2352 # considered an App Engine system error instead of an application error and
2353 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
2354 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
2355 # Requests) response from an app handler does not cause traffic congestion
2356 # control to throttle the queue.
2357 "body": "A String", # HTTP request body.
2358 #
2359 # A request body is allowed only if the HTTP method is POST or PUT. It is
2360 # an error to set a body on a task with an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07002361 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002362 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002363 # The app's request handler for the task's target URL must be able to handle
2364 # HTTP requests with this http_method, otherwise the task attempt fails with
2365 # error code 405 (Method Not Allowed). See [Writing a push task request
2366 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
2367 # and the App Engine documentation for your runtime on [How Requests are
2368 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002369 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
2370 #
2371 # If set,
2372 # app_engine_routing_override
2373 # is used for all tasks in the queue, no matter what the setting is for the
2374 # task-level app_engine_routing.
2375 #
2376 # Defines routing characteristics specific to App Engine - service, version,
2377 # and instance.
2378 #
2379 # For more information about services, versions, and instances see
2380 # [An Overview of App
2381 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
2382 # [Microservices Architecture on Google App
2383 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
2384 # [App Engine Standard request
2385 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
2386 # and [App Engine Flex request
2387 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
2388 "instance": "A String", # App instance.
2389 #
2390 # By default, the task is sent to an instance which is available when
2391 # the task is attempted.
2392 #
2393 # Requests can only be sent to a specific instance if
2394 # [manual scaling is used in App Engine
2395 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
2396 # App Engine Flex does not support instances. For more information, see
2397 # [App Engine Standard request
2398 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2399 # and [App Engine Flex request
2400 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
2401 "host": "A String", # Output only. The host that the task is sent to.
2402 #
2403 # The host is constructed from the domain name of the app associated with
Dan O'Mearadd494642020-05-01 07:42:23 -07002404 # the queue's project ID (for example &lt;app-id&gt;.appspot.com), and the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002405 # service, version,
2406 # and instance. Tasks which were created using
2407 # the App Engine SDK might have a custom domain name.
2408 #
2409 # For more information, see
2410 # [How Requests are
2411 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
2412 "version": "A String", # App version.
2413 #
2414 # By default, the task is sent to the version which is the default
2415 # version when the task is attempted.
2416 #
2417 # For some queues or tasks which were created using the App Engine
2418 # Task Queue API, host is not parsable
2419 # into service,
2420 # version, and
2421 # instance. For example, some tasks
2422 # which were created using the App Engine SDK use a custom domain
2423 # name; custom domains are not parsed by Cloud Tasks. If
2424 # host is not parsable, then
2425 # service,
2426 # version, and
2427 # instance are the empty string.
2428 "service": "A String", # App service.
2429 #
2430 # By default, the task is sent to the service which is the default
2431 # service when the task is attempted.
2432 #
2433 # For some queues or tasks which were created using the App Engine
2434 # Task Queue API, host is not parsable
2435 # into service,
2436 # version, and
2437 # instance. For example, some tasks
2438 # which were created using the App Engine SDK use a custom domain
2439 # name; custom domains are not parsed by Cloud Tasks. If
2440 # host is not parsable, then
2441 # service,
2442 # version, and
2443 # instance are the empty string.
2444 },
2445 "relativeUri": "A String", # The relative URI.
2446 #
2447 # The relative URI must begin with "/" and must be a valid HTTP relative URI.
2448 # It can contain a path and query string arguments.
2449 # If the relative URI is empty, then the root path "/" will be used.
2450 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -07002451 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002452 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002453 # This map contains the header field names and values.
2454 # Headers can be set when the
2455 # task is created.
2456 # Repeated headers are not supported but a header value can contain commas.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002457 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002458 # Cloud Tasks sets some headers to default values:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002459 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002460 # * `User-Agent`: By default, this header is
2461 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
2462 # This header can be modified, but Cloud Tasks will append
2463 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
2464 # modified `User-Agent`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002465 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002466 # If the task has a body, Cloud
2467 # Tasks sets the following headers:
2468 #
2469 # * `Content-Type`: By default, the `Content-Type` header is set to
2470 # `"application/octet-stream"`. The default can be overridden by explicitly
2471 # setting `Content-Type` to a particular media type when the
2472 # task is created.
2473 # For example, `Content-Type` can be set to `"application/json"`.
2474 # * `Content-Length`: This is computed by Cloud Tasks. This value is
2475 # output only. It cannot be changed.
2476 #
2477 # The headers below cannot be set or overridden:
2478 #
2479 # * `Host`
2480 # * `X-Google-*`
2481 # * `X-AppEngine-*`
2482 #
2483 # In addition, Cloud Tasks sets some headers when the task is dispatched,
2484 # such as headers containing information about the task; see
2485 # [request
2486 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
2487 # These headers are set only when the task is dispatched, so they are not
2488 # visible when the task is returned in a Cloud Tasks response.
2489 #
2490 # Although there is no specific limit for the maximum number of headers or
2491 # the size, there is a limit on the maximum size of the Task. For more
2492 # information, see the CreateTask documentation.
2493 "a_key": "A String",
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002494 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002495 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002496 "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt.
2497 #
2498 # Only dispatch_time will be set.
2499 # The other Attempt information is not retained by Cloud Tasks.
2500 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
2501 #
2502 # `schedule_time` will be truncated to the nearest microsecond.
2503 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
2504 #
2505 # If `response_time` is unset, then the task has not been attempted or is
2506 # currently running and the `response_status` field is meaningless.
2507 # different programming environments, including REST APIs and RPC APIs. It is
2508 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2509 # three pieces of data: error code, error message, and error details.
2510 #
2511 # You can find out more about this error model and how to work with it in the
2512 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2513 "message": "A String", # A developer-facing error message, which should be in English. Any
2514 # user-facing error message should be localized and sent in the
2515 # google.rpc.Status.details field, or localized by the client.
2516 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
2517 "details": [ # A list of messages that carry the error details. There is a common set of
2518 # message types for APIs to use.
2519 {
2520 "a_key": "", # Properties of the object. Contains field @type with type URL.
2521 },
2522 ],
2523 },
2524 "responseTime": "A String", # Output only. The time that this attempt response was received.
2525 #
2526 # `response_time` will be truncated to the nearest microsecond.
2527 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
2528 #
2529 # `dispatch_time` will be truncated to the nearest microsecond.
2530 },
Dan O'Mearadd494642020-05-01 07:42:23 -07002531 "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt.
2532 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
2533 #
2534 # `schedule_time` will be truncated to the nearest microsecond.
2535 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
2536 #
2537 # If `response_time` is unset, then the task has not been attempted or is
2538 # currently running and the `response_status` field is meaningless.
2539 # different programming environments, including REST APIs and RPC APIs. It is
2540 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2541 # three pieces of data: error code, error message, and error details.
2542 #
2543 # You can find out more about this error model and how to work with it in the
2544 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2545 "message": "A String", # A developer-facing error message, which should be in English. Any
2546 # user-facing error message should be localized and sent in the
2547 # google.rpc.Status.details field, or localized by the client.
2548 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
2549 "details": [ # A list of messages that carry the error details. There is a common set of
2550 # message types for APIs to use.
2551 {
2552 "a_key": "", # Properties of the object. Contains field @type with type URL.
2553 },
2554 ],
2555 },
2556 "responseTime": "A String", # Output only. The time that this attempt response was received.
2557 #
2558 # `response_time` will be truncated to the nearest microsecond.
2559 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
2560 #
2561 # `dispatch_time` will be truncated to the nearest microsecond.
2562 },
2563 "name": "A String", # Optionally caller-specified in CreateTask.
2564 #
2565 # The task name.
2566 #
2567 # The task name must have the following format:
2568 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
2569 #
2570 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
2571 # hyphens (-), colons (:), or periods (.).
2572 # For more information, see
2573 # [Identifying
2574 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
2575 # * `LOCATION_ID` is the canonical ID for the task's location.
2576 # The list of available locations can be obtained by calling
2577 # ListLocations.
2578 # For more information, see https://cloud.google.com/about/locations/.
2579 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
2580 # hyphens (-). The maximum length is 100 characters.
2581 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
2582 # hyphens (-), or underscores (_). The maximum length is 500 characters.
2583 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
2584 #
2585 # For App Engine queues, this is when the task will be attempted or retried.
2586 #
2587 # `schedule_time` will be truncated to the nearest microsecond.
2588 "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not
2589 # respond by this deadline then the request is cancelled and the attempt
2590 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
2591 # task according to the RetryConfig.
2592 #
2593 # Note that when the request is cancelled, Cloud Tasks will stop listing for
2594 # the response, but whether the worker stops processing depends on the
2595 # worker. For example, if the worker is stuck, it may not react to cancelled
2596 # requests.
2597 #
2598 # The default and maximum values depend on the type of request:
2599 #
2600 # * For HTTP tasks, the default is 10 minutes. The deadline
2601 # must be in the interval [15 seconds, 30 minutes].
2602 #
2603 # * For App Engine tasks, 0 indicates that the
2604 # request has the default deadline. The default deadline depends on the
2605 # [scaling
2606 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
2607 # of the service: 10 minutes for standard apps with automatic scaling, 24
2608 # hours for standard apps with manual and basic scaling, and 60 minutes for
2609 # flex apps. If the request deadline is set, it must be in the interval [15
2610 # seconds, 24 hours 15 seconds]. Regardless of the task's
2611 # `dispatch_deadline`, the app handler will not run for longer than than
2612 # the service's timeout. We recommend setting the `dispatch_deadline` to
2613 # at most a few seconds more than the app handler's timeout. For more
2614 # information see
2615 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
2616 #
2617 # `dispatch_deadline` will be truncated to the nearest millisecond. The
2618 # deadline is an approximate deadline.
2619 "view": "A String", # Output only. The view specifies which subset of the Task has
2620 # been returned.
2621 "createTime": "A String", # Output only. The time that the task was created.
2622 #
2623 # `create_time` will be truncated to the nearest second.
2624 "dispatchCount": 42, # Output only. The number of attempts dispatched.
2625 #
2626 # This count includes attempts which have been dispatched but haven't
2627 # received a response.
2628 "responseCount": 42, # Output only. The number of attempts which have received a response.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002629 }</pre>
2630</div>
2631
2632</body></html>