blob: 12c04215b494dfb1b0ed5f9763058658092e18a6 [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_v2beta2.html">Cloud Tasks API</a> . <a href="cloudtasks_v2beta2.projects.html">projects</a> . <a href="cloudtasks_v2beta2.projects.locations.html">locations</a> . <a href="cloudtasks_v2beta2.projects.locations.queues.html">queues</a> . <a href="cloudtasks_v2beta2.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="#acknowledge">acknowledge(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Acknowledges a pull task.</p>
80<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070081 <code><a href="#cancelLease">cancelLease(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070082<p class="firstline">Cancel a pull task's lease.</p>
83<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070084 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070085<p class="firstline">Creates a task and adds it to a queue.</p>
86<p class="toc_element">
87 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
88<p class="firstline">Deletes a task.</p>
89<p class="toc_element">
90 <code><a href="#get">get(name, responseView=None, x__xgafv=None)</a></code></p>
91<p class="firstline">Gets a task.</p>
92<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#lease">lease(parent, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Leases tasks from a pull queue for</p>
95<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#list">list(parent, responseView=None, pageToken=None, x__xgafv=None, pageSize=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070097<p class="firstline">Lists the tasks in a queue.</p>
98<p class="toc_element">
99 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
100<p class="firstline">Retrieves the next page of results.</p>
101<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700102 <code><a href="#renewLease">renewLease(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700103<p class="firstline">Renew the current lease of a pull task.</p>
104<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 <code><a href="#run">run(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700106<p class="firstline">Forces a task to run now.</p>
107<h3>Method Details</h3>
108<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700109 <code class="details" id="acknowledge">acknowledge(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700110 <pre>Acknowledges a pull task.
111
112The worker, that is, the entity that
113leased this task must call this method
114to indicate that the work associated with the task has finished.
115
116The worker must acknowledge a task within the
117lease_duration or the lease
118will expire and the task will become available to be leased
119again. After the task is acknowledged, it will not be returned
120by a later LeaseTasks,
121GetTask, or
122ListTasks.
123
124Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700125 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700126`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700127 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700128 The object takes the form of:
129
130{ # Request message for acknowledging a task using
131 # AcknowledgeTask.
Dan O'Mearadd494642020-05-01 07:42:23 -0700132 "scheduleTime": "A String", # Required. The task's current schedule time, available in the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700133 # schedule_time returned by
134 # LeaseTasks response or
135 # RenewLease response. This restriction is
136 # to ensure that your worker currently holds the lease.
137 }
138
139 x__xgafv: string, V1 error format.
140 Allowed values
141 1 - v1 error format
142 2 - v2 error format
143
144Returns:
145 An object of the form:
146
147 { # A generic empty message that you can re-use to avoid defining duplicated
148 # empty messages in your APIs. A typical example is to use it as the request
149 # or the response type of an API method. For instance:
150 #
151 # service Foo {
152 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
153 # }
154 #
155 # The JSON representation for `Empty` is empty JSON object `{}`.
156 }</pre>
157</div>
158
159<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700160 <code class="details" id="cancelLease">cancelLease(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700161 <pre>Cancel a pull task's lease.
162
163The worker can use this method to cancel a task's lease by
164setting its schedule_time to now. This will
165make the task available to be leased to the next caller of
166LeaseTasks.
167
168Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700169 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700170`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700171 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700172 The object takes the form of:
173
174{ # Request message for canceling a lease using
175 # CancelLease.
Dan O'Mearadd494642020-05-01 07:42:23 -0700176 "scheduleTime": "A String", # Required. The task's current schedule time, available in the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700177 # schedule_time returned by
178 # LeaseTasks response or
179 # RenewLease response. This restriction is
180 # to ensure that your worker currently holds the lease.
181 "responseView": "A String", # The response_view specifies which subset of the Task will be
182 # returned.
183 #
184 # By default response_view is BASIC; not all
185 # information is retrieved by default because some data, such as
186 # payloads, might be desirable to return only when needed because
187 # of its large size or because of the sensitivity of data that it
188 # contains.
189 #
190 # Authorization for FULL requires
191 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
192 # permission on the Task resource.
193 }
194
195 x__xgafv: string, V1 error format.
196 Allowed values
197 1 - v1 error format
198 2 - v2 error format
199
200Returns:
201 An object of the form:
202
203 { # A unit of scheduled work.
204 "status": { # Status of the task. # Output only. The task status.
205 "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt.
206 #
207 # This field is not calculated for pull tasks.
208 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
209 #
210 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -0700211 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
212 #
213 # `dispatch_time` will be truncated to the nearest microsecond.
214 "responseTime": "A String", # Output only. The time that this attempt response was received.
215 #
216 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700217 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
218 #
219 # If the task has not been attempted or the task is currently running
220 # then the response status is unset.
221 # different programming environments, including REST APIs and RPC APIs. It is
222 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
223 # three pieces of data: error code, error message, and error details.
224 #
225 # You can find out more about this error model and how to work with it in the
226 # [API Design Guide](https://cloud.google.com/apis/design/errors).
227 "message": "A String", # A developer-facing error message, which should be in English. Any
228 # user-facing error message should be localized and sent in the
229 # google.rpc.Status.details field, or localized by the client.
230 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
231 "details": [ # A list of messages that carry the error details. There is a common set of
232 # message types for APIs to use.
233 {
234 "a_key": "", # Properties of the object. Contains field @type with type URL.
235 },
236 ],
237 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700238 },
239 "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt.
240 #
241 # Only dispatch_time will be set.
242 # The other AttemptStatus information is not retained by Cloud Tasks.
243 #
244 # This field is not calculated for pull tasks.
245 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
246 #
247 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -0700248 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
249 #
250 # `dispatch_time` will be truncated to the nearest microsecond.
251 "responseTime": "A String", # Output only. The time that this attempt response was received.
252 #
253 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700254 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
255 #
256 # If the task has not been attempted or the task is currently running
257 # then the response status is unset.
258 # different programming environments, including REST APIs and RPC APIs. It is
259 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
260 # three pieces of data: error code, error message, and error details.
261 #
262 # You can find out more about this error model and how to work with it in the
263 # [API Design Guide](https://cloud.google.com/apis/design/errors).
264 "message": "A String", # A developer-facing error message, which should be in English. Any
265 # user-facing error message should be localized and sent in the
266 # google.rpc.Status.details field, or localized by the client.
267 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
268 "details": [ # A list of messages that carry the error details. There is a common set of
269 # message types for APIs to use.
270 {
271 "a_key": "", # Properties of the object. Contains field @type with type URL.
272 },
273 ],
274 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700275 },
276 "attemptDispatchCount": 42, # Output only. The number of attempts dispatched.
277 #
278 # This count includes attempts which have been dispatched but haven't
279 # received a response.
280 "attemptResponseCount": 42, # Output only. The number of attempts which have received a response.
281 #
282 # This field is not calculated for pull tasks.
283 },
284 "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
285 # set only if pull_target is set on the queue.
286 #
287 # A pull task is a task that has PullMessage set.
288 # LeaseTasks to process the task.
289 #
290 # This proto can only be used for tasks in a queue which has
291 # pull_target set.
292 "tag": "A String", # The task's tag.
293 #
294 # Tags allow similar tasks to be processed in a batch. If you label
295 # tasks with a tag, your worker can
296 # lease tasks with the same tag using
297 # filter. For example, if you want to
298 # aggregate the events associated with a specific user once a day,
299 # you could tag tasks with the user ID.
300 #
301 # The task's tag can only be set when the
302 # task is created.
303 #
304 # The tag must be less than 500 characters.
305 #
306 # SDK compatibility: Although the SDK allows tags to be either
307 # string or
308 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
309 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
310 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
311 "payload": "A String", # A data payload consumed by the worker to execute the task.
312 },
313 "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can
314 # be set only if
315 # app_engine_http_target is set
316 # on the queue.
317 #
318 # An App Engine task is a task that has AppEngineHttpRequest set.
319 #
320 # The message defines the HTTP request that is sent to an App Engine app when
321 # the task is dispatched.
322 #
323 # This proto can only be used for tasks in a queue which has
324 # app_engine_http_target set.
325 #
326 # Using AppEngineHttpRequest requires
327 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
328 # Google IAM permission for the project
329 # and the following scope:
330 #
331 # `https://www.googleapis.com/auth/cloud-platform`
332 #
333 # The task will be delivered to the App Engine app which belongs to the same
334 # project as the queue. For more information, see
335 # [How Requests are
336 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
337 # and how routing is affected by
338 # [dispatch
339 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
340 # Traffic is encrypted during transport and never leaves Google datacenters.
341 # Because this traffic is carried over a communication mechanism internal to
342 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
343 # The request to the handler, however, will appear to have used the HTTP
344 # protocol.
345 #
346 # The AppEngineRouting used to construct the URL that the task is
347 # delivered to can be set at the queue-level or task-level:
348 #
349 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -0700350 # app_engine_routing_override
351 # is used for all tasks in the queue, no matter what the setting
352 # is for the
353 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700354 #
355 #
356 # The `url` that the task will be sent to is:
357 #
358 # * `url =` host `+`
359 # relative_url
360 #
361 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
362 # URIs restricted with
363 # [`login:
364 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
365 # Because tasks are not run as any user, they cannot be dispatched to URIs
366 # restricted with
367 # [`login:
368 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
369 # Task dispatches also do not follow redirects.
370 #
371 # The task attempt has succeeded if the app's request handler returns an HTTP
372 # response code in the range [`200` - `299`]. The task attempt has failed if
373 # the app's handler returns a non-2xx response code or Cloud Tasks does
374 # not receive response before the deadline. Failed
375 # tasks will be retried according to the
376 # retry configuration. `503` (Service Unavailable) is
377 # considered an App Engine system error instead of an application error and
378 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
379 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
380 # Requests) response from an app handler does not cause traffic congestion
381 # control to throttle the queue.
382 "relativeUrl": "A String", # The relative URL.
383 #
384 # The relative URL must begin with "/" and must be a valid HTTP relative URL.
385 # It can contain a path and query string arguments.
386 # If the relative URL is empty, then the root path "/" will be used.
387 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -0700388 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700389 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700390 # This map contains the header field names and values.
391 # Headers can be set when the
392 # task is created.
393 # Repeated headers are not supported but a header value can contain commas.
394 #
395 # Cloud Tasks sets some headers to default values:
396 #
397 # * `User-Agent`: By default, this header is
398 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
399 # This header can be modified, but Cloud Tasks will append
400 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
401 # modified `User-Agent`.
402 #
403 # If the task has a payload, Cloud
404 # Tasks sets the following headers:
405 #
406 # * `Content-Type`: By default, the `Content-Type` header is set to
407 # `"application/octet-stream"`. The default can be overridden by explicitly
408 # setting `Content-Type` to a particular media type when the
409 # task is created.
410 # For example, `Content-Type` can be set to `"application/json"`.
411 # * `Content-Length`: This is computed by Cloud Tasks. This value is
412 # output only. It cannot be changed.
413 #
414 # The headers below cannot be set or overridden:
415 #
416 # * `Host`
417 # * `X-Google-*`
418 # * `X-AppEngine-*`
419 #
420 # In addition, Cloud Tasks sets some headers when the task is dispatched,
421 # such as headers containing information about the task; see
422 # [request
423 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
424 # These headers are set only when the task is dispatched, so they are not
425 # visible when the task is returned in a Cloud Tasks response.
426 #
427 # Although there is no specific limit for the maximum number of headers or
428 # the size, there is a limit on the maximum size of the Task. For more
429 # information, see the CreateTask documentation.
430 "a_key": "A String",
431 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700432 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
433 #
434 # If set,
435 # app_engine_routing_override
436 # is used for all tasks in the queue, no matter what the setting is for the
437 # task-level app_engine_routing.
438 #
439 # Defines routing characteristics specific to App Engine - service, version,
440 # and instance.
441 #
442 # For more information about services, versions, and instances see
443 # [An Overview of App
444 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
445 # [Microservices Architecture on Google App
446 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
447 # [App Engine Standard request
448 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
449 # and [App Engine Flex request
450 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
451 "instance": "A String", # App instance.
452 #
453 # By default, the task is sent to an instance which is available when
454 # the task is attempted.
455 #
456 # Requests can only be sent to a specific instance if
457 # [manual scaling is used in App Engine
458 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
459 # App Engine Flex does not support instances. For more information, see
460 # [App Engine Standard request
461 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
462 # and [App Engine Flex request
463 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
464 "host": "A String", # Output only. The host that the task is sent to.
465 #
466 # For more information, see
467 # [How Requests are
468 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
469 #
470 # The host is constructed as:
471 #
472 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700473 # * `host = [application_domain_name]`&lt;/br&gt;
474 # `| [service] + '.' + [application_domain_name]`&lt;/br&gt;
475 # `| [version] + '.' + [application_domain_name]`&lt;/br&gt;
476 # `| [version_dot_service]+ '.' + [application_domain_name]`&lt;/br&gt;
477 # `| [instance] + '.' + [application_domain_name]`&lt;/br&gt;
478 # `| [instance_dot_service] + '.' + [application_domain_name]`&lt;/br&gt;
479 # `| [instance_dot_version] + '.' + [application_domain_name]`&lt;/br&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700480 # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
481 #
482 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -0700483 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700484 # queue's project ID. Some tasks which were created using the App Engine
485 # SDK use a custom domain name.
486 #
487 # * `service =` service
488 #
489 # * `version =` version
490 #
491 # * `version_dot_service =`
492 # version `+ '.' +`
493 # service
494 #
495 # * `instance =` instance
496 #
497 # * `instance_dot_service =`
498 # instance `+ '.' +`
499 # service
500 #
501 # * `instance_dot_version =`
502 # instance `+ '.' +`
503 # version
504 #
505 # * `instance_dot_version_dot_service =`
506 # instance `+ '.' +`
507 # version `+ '.' +`
508 # service
509 #
510 # If service is empty, then the task will be sent
511 # to the service which is the default service when the task is attempted.
512 #
513 # If version is empty, then the task will be sent
514 # to the version which is the default version when the task is attempted.
515 #
516 # If instance is empty, then the task
517 # will be sent to an instance which is available when the task is
518 # attempted.
519 #
520 # If service,
521 # version, or
522 # instance is invalid, then the task
523 # will be sent to the default version of the default service when
524 # the task is attempted.
525 "version": "A String", # App version.
526 #
527 # By default, the task is sent to the version which is the default
528 # version when the task is attempted.
529 #
530 # For some queues or tasks which were created using the App Engine
531 # Task Queue API, host is not parsable
532 # into service,
533 # version, and
534 # instance. For example, some tasks
535 # which were created using the App Engine SDK use a custom domain
536 # name; custom domains are not parsed by Cloud Tasks. If
537 # host is not parsable, then
538 # service,
539 # version, and
540 # instance are the empty string.
541 "service": "A String", # App service.
542 #
543 # By default, the task is sent to the service which is the default
544 # service when the task is attempted.
545 #
546 # For some queues or tasks which were created using the App Engine
547 # Task Queue API, host is not parsable
548 # into service,
549 # version, and
550 # instance. For example, some tasks
551 # which were created using the App Engine SDK use a custom domain
552 # name; custom domains are not parsed by Cloud Tasks. If
553 # host is not parsable, then
554 # service,
555 # version, and
556 # instance are the empty string.
557 },
558 "payload": "A String", # Payload.
559 #
560 # The payload will be sent as the HTTP message body. A message
561 # body, and thus a payload, is allowed only if the HTTP method is
562 # POST or PUT. It is an error to set a data payload on a task with
563 # an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -0700564 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700565 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700566 # The app's request handler for the task's target URL must be able to handle
567 # HTTP requests with this http_method, otherwise the task attempt fails with
568 # error code 405 (Method Not Allowed). See [Writing a push task request
569 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
570 # and the App Engine documentation for your runtime on [How Requests are
571 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700572 },
573 "name": "A String", # Optionally caller-specified in CreateTask.
574 #
575 # The task name.
576 #
577 # The task name must have the following format:
578 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
579 #
580 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
581 # hyphens (-), colons (:), or periods (.).
582 # For more information, see
583 # [Identifying
584 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
585 # * `LOCATION_ID` is the canonical ID for the task's location.
586 # The list of available locations can be obtained by calling
587 # ListLocations.
588 # For more information, see https://cloud.google.com/about/locations/.
589 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
590 # hyphens (-). The maximum length is 100 characters.
591 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
592 # hyphens (-), or underscores (_). The maximum length is 500 characters.
593 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
594 #
595 # For App Engine queues, this is when the task will be attempted or retried.
596 #
597 # For pull queues, this is the time when the task is available to
598 # be leased; if a task is currently leased, this is the time when
599 # the current lease expires, that is, the time that the task was
600 # leased plus the lease_duration.
601 #
602 # `schedule_time` will be truncated to the nearest microsecond.
603 "createTime": "A String", # Output only. The time that the task was created.
604 #
605 # `create_time` will be truncated to the nearest second.
606 "view": "A String", # Output only. The view specifies which subset of the Task has
607 # been returned.
608 }</pre>
609</div>
610
611<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700612 <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700613 <pre>Creates a task and adds it to a queue.
614
615Tasks cannot be updated after creation; there is no UpdateTask command.
616
617* For App Engine queues, the maximum task size is
618 100KB.
619* For pull queues, the maximum task size is 1MB.
620
621Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700622 parent: string, Required. The queue name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700623`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
624
625The queue must already exist. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700626 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700627 The object takes the form of:
628
629{ # Request message for CreateTask.
630 "responseView": "A String", # The response_view specifies which subset of the Task will be
631 # returned.
632 #
633 # By default response_view is BASIC; not all
634 # information is retrieved by default because some data, such as
635 # payloads, might be desirable to return only when needed because
636 # of its large size or because of the sensitivity of data that it
637 # contains.
638 #
639 # Authorization for FULL requires
640 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
641 # permission on the Task resource.
Dan O'Mearadd494642020-05-01 07:42:23 -0700642 "task": { # A unit of scheduled work. # Required. The task to add.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700643 #
644 # Task names have the following format:
645 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
646 # The user can optionally specify a task name. If a
647 # name is not specified then the system will generate a random
648 # unique task id, which will be set in the task returned in the
649 # response.
650 #
651 # If schedule_time is not set or is in the
652 # past then Cloud Tasks will set it to the current time.
653 #
654 # Task De-duplication:
655 #
656 # Explicitly specifying a task ID enables task de-duplication. If
657 # a task's ID is identical to that of an existing task or a task
658 # that was deleted or completed recently then the call will fail
659 # with ALREADY_EXISTS.
660 # If the task's queue was created using Cloud Tasks, then another task with
661 # the same name can't be created for ~1hour after the original task was
662 # deleted or completed. If the task's queue was created using queue.yaml or
663 # queue.xml, then another task with the same name can't be created
664 # for ~9days after the original task was deleted or completed.
665 #
666 # Because there is an extra lookup cost to identify duplicate task
667 # names, these CreateTask calls have significantly
668 # increased latency. Using hashed strings for the task id or for
669 # the prefix of the task id is recommended. Choosing task ids that
670 # are sequential or have sequential prefixes, for example using a
671 # timestamp, causes an increase in latency and error rates in all
672 # task commands. The infrastructure relies on an approximately
673 # uniform distribution of task ids to store and serve tasks
674 # efficiently.
675 "status": { # Status of the task. # Output only. The task status.
676 "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt.
677 #
678 # This field is not calculated for pull tasks.
679 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
680 #
681 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -0700682 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
683 #
684 # `dispatch_time` will be truncated to the nearest microsecond.
685 "responseTime": "A String", # Output only. The time that this attempt response was received.
686 #
687 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700688 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
689 #
690 # If the task has not been attempted or the task is currently running
691 # then the response status is unset.
692 # different programming environments, including REST APIs and RPC APIs. It is
693 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
694 # three pieces of data: error code, error message, and error details.
695 #
696 # You can find out more about this error model and how to work with it in the
697 # [API Design Guide](https://cloud.google.com/apis/design/errors).
698 "message": "A String", # A developer-facing error message, which should be in English. Any
699 # user-facing error message should be localized and sent in the
700 # google.rpc.Status.details field, or localized by the client.
701 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
702 "details": [ # A list of messages that carry the error details. There is a common set of
703 # message types for APIs to use.
704 {
705 "a_key": "", # Properties of the object. Contains field @type with type URL.
706 },
707 ],
708 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700709 },
710 "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt.
711 #
712 # Only dispatch_time will be set.
713 # The other AttemptStatus information is not retained by Cloud Tasks.
714 #
715 # This field is not calculated for pull tasks.
716 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
717 #
718 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -0700719 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
720 #
721 # `dispatch_time` will be truncated to the nearest microsecond.
722 "responseTime": "A String", # Output only. The time that this attempt response was received.
723 #
724 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700725 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
726 #
727 # If the task has not been attempted or the task is currently running
728 # then the response status is unset.
729 # different programming environments, including REST APIs and RPC APIs. It is
730 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
731 # three pieces of data: error code, error message, and error details.
732 #
733 # You can find out more about this error model and how to work with it in the
734 # [API Design Guide](https://cloud.google.com/apis/design/errors).
735 "message": "A String", # A developer-facing error message, which should be in English. Any
736 # user-facing error message should be localized and sent in the
737 # google.rpc.Status.details field, or localized by the client.
738 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
739 "details": [ # A list of messages that carry the error details. There is a common set of
740 # message types for APIs to use.
741 {
742 "a_key": "", # Properties of the object. Contains field @type with type URL.
743 },
744 ],
745 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700746 },
747 "attemptDispatchCount": 42, # Output only. The number of attempts dispatched.
748 #
749 # This count includes attempts which have been dispatched but haven't
750 # received a response.
751 "attemptResponseCount": 42, # Output only. The number of attempts which have received a response.
752 #
753 # This field is not calculated for pull tasks.
754 },
755 "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
756 # set only if pull_target is set on the queue.
757 #
758 # A pull task is a task that has PullMessage set.
759 # LeaseTasks to process the task.
760 #
761 # This proto can only be used for tasks in a queue which has
762 # pull_target set.
763 "tag": "A String", # The task's tag.
764 #
765 # Tags allow similar tasks to be processed in a batch. If you label
766 # tasks with a tag, your worker can
767 # lease tasks with the same tag using
768 # filter. For example, if you want to
769 # aggregate the events associated with a specific user once a day,
770 # you could tag tasks with the user ID.
771 #
772 # The task's tag can only be set when the
773 # task is created.
774 #
775 # The tag must be less than 500 characters.
776 #
777 # SDK compatibility: Although the SDK allows tags to be either
778 # string or
779 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
780 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
781 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
782 "payload": "A String", # A data payload consumed by the worker to execute the task.
783 },
784 "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can
785 # be set only if
786 # app_engine_http_target is set
787 # on the queue.
788 #
789 # An App Engine task is a task that has AppEngineHttpRequest set.
790 #
791 # The message defines the HTTP request that is sent to an App Engine app when
792 # the task is dispatched.
793 #
794 # This proto can only be used for tasks in a queue which has
795 # app_engine_http_target set.
796 #
797 # Using AppEngineHttpRequest requires
798 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
799 # Google IAM permission for the project
800 # and the following scope:
801 #
802 # `https://www.googleapis.com/auth/cloud-platform`
803 #
804 # The task will be delivered to the App Engine app which belongs to the same
805 # project as the queue. For more information, see
806 # [How Requests are
807 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
808 # and how routing is affected by
809 # [dispatch
810 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
811 # Traffic is encrypted during transport and never leaves Google datacenters.
812 # Because this traffic is carried over a communication mechanism internal to
813 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
814 # The request to the handler, however, will appear to have used the HTTP
815 # protocol.
816 #
817 # The AppEngineRouting used to construct the URL that the task is
818 # delivered to can be set at the queue-level or task-level:
819 #
820 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -0700821 # app_engine_routing_override
822 # is used for all tasks in the queue, no matter what the setting
823 # is for the
824 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700825 #
826 #
827 # The `url` that the task will be sent to is:
828 #
829 # * `url =` host `+`
830 # relative_url
831 #
832 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
833 # URIs restricted with
834 # [`login:
835 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
836 # Because tasks are not run as any user, they cannot be dispatched to URIs
837 # restricted with
838 # [`login:
839 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
840 # Task dispatches also do not follow redirects.
841 #
842 # The task attempt has succeeded if the app's request handler returns an HTTP
843 # response code in the range [`200` - `299`]. The task attempt has failed if
844 # the app's handler returns a non-2xx response code or Cloud Tasks does
845 # not receive response before the deadline. Failed
846 # tasks will be retried according to the
847 # retry configuration. `503` (Service Unavailable) is
848 # considered an App Engine system error instead of an application error and
849 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
850 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
851 # Requests) response from an app handler does not cause traffic congestion
852 # control to throttle the queue.
853 "relativeUrl": "A String", # The relative URL.
854 #
855 # The relative URL must begin with "/" and must be a valid HTTP relative URL.
856 # It can contain a path and query string arguments.
857 # If the relative URL is empty, then the root path "/" will be used.
858 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -0700859 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700860 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700861 # This map contains the header field names and values.
862 # Headers can be set when the
863 # task is created.
864 # Repeated headers are not supported but a header value can contain commas.
865 #
866 # Cloud Tasks sets some headers to default values:
867 #
868 # * `User-Agent`: By default, this header is
869 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
870 # This header can be modified, but Cloud Tasks will append
871 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
872 # modified `User-Agent`.
873 #
874 # If the task has a payload, Cloud
875 # Tasks sets the following headers:
876 #
877 # * `Content-Type`: By default, the `Content-Type` header is set to
878 # `"application/octet-stream"`. The default can be overridden by explicitly
879 # setting `Content-Type` to a particular media type when the
880 # task is created.
881 # For example, `Content-Type` can be set to `"application/json"`.
882 # * `Content-Length`: This is computed by Cloud Tasks. This value is
883 # output only. It cannot be changed.
884 #
885 # The headers below cannot be set or overridden:
886 #
887 # * `Host`
888 # * `X-Google-*`
889 # * `X-AppEngine-*`
890 #
891 # In addition, Cloud Tasks sets some headers when the task is dispatched,
892 # such as headers containing information about the task; see
893 # [request
894 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
895 # These headers are set only when the task is dispatched, so they are not
896 # visible when the task is returned in a Cloud Tasks response.
897 #
898 # Although there is no specific limit for the maximum number of headers or
899 # the size, there is a limit on the maximum size of the Task. For more
900 # information, see the CreateTask documentation.
901 "a_key": "A String",
902 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700903 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
904 #
905 # If set,
906 # app_engine_routing_override
907 # is used for all tasks in the queue, no matter what the setting is for the
908 # task-level app_engine_routing.
909 #
910 # Defines routing characteristics specific to App Engine - service, version,
911 # and instance.
912 #
913 # For more information about services, versions, and instances see
914 # [An Overview of App
915 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
916 # [Microservices Architecture on Google App
917 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
918 # [App Engine Standard request
919 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
920 # and [App Engine Flex request
921 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
922 "instance": "A String", # App instance.
923 #
924 # By default, the task is sent to an instance which is available when
925 # the task is attempted.
926 #
927 # Requests can only be sent to a specific instance if
928 # [manual scaling is used in App Engine
929 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
930 # App Engine Flex does not support instances. For more information, see
931 # [App Engine Standard request
932 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
933 # and [App Engine Flex request
934 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
935 "host": "A String", # Output only. The host that the task is sent to.
936 #
937 # For more information, see
938 # [How Requests are
939 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
940 #
941 # The host is constructed as:
942 #
943 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700944 # * `host = [application_domain_name]`&lt;/br&gt;
945 # `| [service] + '.' + [application_domain_name]`&lt;/br&gt;
946 # `| [version] + '.' + [application_domain_name]`&lt;/br&gt;
947 # `| [version_dot_service]+ '.' + [application_domain_name]`&lt;/br&gt;
948 # `| [instance] + '.' + [application_domain_name]`&lt;/br&gt;
949 # `| [instance_dot_service] + '.' + [application_domain_name]`&lt;/br&gt;
950 # `| [instance_dot_version] + '.' + [application_domain_name]`&lt;/br&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700951 # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
952 #
953 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -0700954 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700955 # queue's project ID. Some tasks which were created using the App Engine
956 # SDK use a custom domain name.
957 #
958 # * `service =` service
959 #
960 # * `version =` version
961 #
962 # * `version_dot_service =`
963 # version `+ '.' +`
964 # service
965 #
966 # * `instance =` instance
967 #
968 # * `instance_dot_service =`
969 # instance `+ '.' +`
970 # service
971 #
972 # * `instance_dot_version =`
973 # instance `+ '.' +`
974 # version
975 #
976 # * `instance_dot_version_dot_service =`
977 # instance `+ '.' +`
978 # version `+ '.' +`
979 # service
980 #
981 # If service is empty, then the task will be sent
982 # to the service which is the default service when the task is attempted.
983 #
984 # If version is empty, then the task will be sent
985 # to the version which is the default version when the task is attempted.
986 #
987 # If instance is empty, then the task
988 # will be sent to an instance which is available when the task is
989 # attempted.
990 #
991 # If service,
992 # version, or
993 # instance is invalid, then the task
994 # will be sent to the default version of the default service when
995 # the task is attempted.
996 "version": "A String", # App version.
997 #
998 # By default, the task is sent to the version which is the default
999 # version when the task is attempted.
1000 #
1001 # For some queues or tasks which were created using the App Engine
1002 # Task Queue API, host is not parsable
1003 # into service,
1004 # version, and
1005 # instance. For example, some tasks
1006 # which were created using the App Engine SDK use a custom domain
1007 # name; custom domains are not parsed by Cloud Tasks. If
1008 # host is not parsable, then
1009 # service,
1010 # version, and
1011 # instance are the empty string.
1012 "service": "A String", # App service.
1013 #
1014 # By default, the task is sent to the service which is the default
1015 # service when the task is attempted.
1016 #
1017 # For some queues or tasks which were created using the App Engine
1018 # Task Queue API, host is not parsable
1019 # into service,
1020 # version, and
1021 # instance. For example, some tasks
1022 # which were created using the App Engine SDK use a custom domain
1023 # name; custom domains are not parsed by Cloud Tasks. If
1024 # host is not parsable, then
1025 # service,
1026 # version, and
1027 # instance are the empty string.
1028 },
1029 "payload": "A String", # Payload.
1030 #
1031 # The payload will be sent as the HTTP message body. A message
1032 # body, and thus a payload, is allowed only if the HTTP method is
1033 # POST or PUT. It is an error to set a data payload on a task with
1034 # an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07001035 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001036 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001037 # The app's request handler for the task's target URL must be able to handle
1038 # HTTP requests with this http_method, otherwise the task attempt fails with
1039 # error code 405 (Method Not Allowed). See [Writing a push task request
1040 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
1041 # and the App Engine documentation for your runtime on [How Requests are
1042 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001043 },
1044 "name": "A String", # Optionally caller-specified in CreateTask.
1045 #
1046 # The task name.
1047 #
1048 # The task name must have the following format:
1049 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1050 #
1051 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1052 # hyphens (-), colons (:), or periods (.).
1053 # For more information, see
1054 # [Identifying
1055 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1056 # * `LOCATION_ID` is the canonical ID for the task's location.
1057 # The list of available locations can be obtained by calling
1058 # ListLocations.
1059 # For more information, see https://cloud.google.com/about/locations/.
1060 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1061 # hyphens (-). The maximum length is 100 characters.
1062 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1063 # hyphens (-), or underscores (_). The maximum length is 500 characters.
1064 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
1065 #
1066 # For App Engine queues, this is when the task will be attempted or retried.
1067 #
1068 # For pull queues, this is the time when the task is available to
1069 # be leased; if a task is currently leased, this is the time when
1070 # the current lease expires, that is, the time that the task was
1071 # leased plus the lease_duration.
1072 #
1073 # `schedule_time` will be truncated to the nearest microsecond.
1074 "createTime": "A String", # Output only. The time that the task was created.
1075 #
1076 # `create_time` will be truncated to the nearest second.
1077 "view": "A String", # Output only. The view specifies which subset of the Task has
1078 # been returned.
1079 },
1080 }
1081
1082 x__xgafv: string, V1 error format.
1083 Allowed values
1084 1 - v1 error format
1085 2 - v2 error format
1086
1087Returns:
1088 An object of the form:
1089
1090 { # A unit of scheduled work.
1091 "status": { # Status of the task. # Output only. The task status.
1092 "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt.
1093 #
1094 # This field is not calculated for pull tasks.
1095 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
1096 #
1097 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07001098 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
1099 #
1100 # `dispatch_time` will be truncated to the nearest microsecond.
1101 "responseTime": "A String", # Output only. The time that this attempt response was received.
1102 #
1103 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001104 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
1105 #
1106 # If the task has not been attempted or the task is currently running
1107 # then the response status is unset.
1108 # different programming environments, including REST APIs and RPC APIs. It is
1109 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1110 # three pieces of data: error code, error message, and error details.
1111 #
1112 # You can find out more about this error model and how to work with it in the
1113 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1114 "message": "A String", # A developer-facing error message, which should be in English. Any
1115 # user-facing error message should be localized and sent in the
1116 # google.rpc.Status.details field, or localized by the client.
1117 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
1118 "details": [ # A list of messages that carry the error details. There is a common set of
1119 # message types for APIs to use.
1120 {
1121 "a_key": "", # Properties of the object. Contains field @type with type URL.
1122 },
1123 ],
1124 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001125 },
1126 "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt.
1127 #
1128 # Only dispatch_time will be set.
1129 # The other AttemptStatus information is not retained by Cloud Tasks.
1130 #
1131 # This field is not calculated for pull tasks.
1132 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
1133 #
1134 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07001135 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
1136 #
1137 # `dispatch_time` will be truncated to the nearest microsecond.
1138 "responseTime": "A String", # Output only. The time that this attempt response was received.
1139 #
1140 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001141 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
1142 #
1143 # If the task has not been attempted or the task is currently running
1144 # then the response status is unset.
1145 # different programming environments, including REST APIs and RPC APIs. It is
1146 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1147 # three pieces of data: error code, error message, and error details.
1148 #
1149 # You can find out more about this error model and how to work with it in the
1150 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1151 "message": "A String", # A developer-facing error message, which should be in English. Any
1152 # user-facing error message should be localized and sent in the
1153 # google.rpc.Status.details field, or localized by the client.
1154 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
1155 "details": [ # A list of messages that carry the error details. There is a common set of
1156 # message types for APIs to use.
1157 {
1158 "a_key": "", # Properties of the object. Contains field @type with type URL.
1159 },
1160 ],
1161 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001162 },
1163 "attemptDispatchCount": 42, # Output only. The number of attempts dispatched.
1164 #
1165 # This count includes attempts which have been dispatched but haven't
1166 # received a response.
1167 "attemptResponseCount": 42, # Output only. The number of attempts which have received a response.
1168 #
1169 # This field is not calculated for pull tasks.
1170 },
1171 "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
1172 # set only if pull_target is set on the queue.
1173 #
1174 # A pull task is a task that has PullMessage set.
1175 # LeaseTasks to process the task.
1176 #
1177 # This proto can only be used for tasks in a queue which has
1178 # pull_target set.
1179 "tag": "A String", # The task's tag.
1180 #
1181 # Tags allow similar tasks to be processed in a batch. If you label
1182 # tasks with a tag, your worker can
1183 # lease tasks with the same tag using
1184 # filter. For example, if you want to
1185 # aggregate the events associated with a specific user once a day,
1186 # you could tag tasks with the user ID.
1187 #
1188 # The task's tag can only be set when the
1189 # task is created.
1190 #
1191 # The tag must be less than 500 characters.
1192 #
1193 # SDK compatibility: Although the SDK allows tags to be either
1194 # string or
1195 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
1196 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
1197 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
1198 "payload": "A String", # A data payload consumed by the worker to execute the task.
1199 },
1200 "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can
1201 # be set only if
1202 # app_engine_http_target is set
1203 # on the queue.
1204 #
1205 # An App Engine task is a task that has AppEngineHttpRequest set.
1206 #
1207 # The message defines the HTTP request that is sent to an App Engine app when
1208 # the task is dispatched.
1209 #
1210 # This proto can only be used for tasks in a queue which has
1211 # app_engine_http_target set.
1212 #
1213 # Using AppEngineHttpRequest requires
1214 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1215 # Google IAM permission for the project
1216 # and the following scope:
1217 #
1218 # `https://www.googleapis.com/auth/cloud-platform`
1219 #
1220 # The task will be delivered to the App Engine app which belongs to the same
1221 # project as the queue. For more information, see
1222 # [How Requests are
1223 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1224 # and how routing is affected by
1225 # [dispatch
1226 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
1227 # Traffic is encrypted during transport and never leaves Google datacenters.
1228 # Because this traffic is carried over a communication mechanism internal to
1229 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
1230 # The request to the handler, however, will appear to have used the HTTP
1231 # protocol.
1232 #
1233 # The AppEngineRouting used to construct the URL that the task is
1234 # delivered to can be set at the queue-level or task-level:
1235 #
1236 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07001237 # app_engine_routing_override
1238 # is used for all tasks in the queue, no matter what the setting
1239 # is for the
1240 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001241 #
1242 #
1243 # The `url` that the task will be sent to is:
1244 #
1245 # * `url =` host `+`
1246 # relative_url
1247 #
1248 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
1249 # URIs restricted with
1250 # [`login:
1251 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
1252 # Because tasks are not run as any user, they cannot be dispatched to URIs
1253 # restricted with
1254 # [`login:
1255 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
1256 # Task dispatches also do not follow redirects.
1257 #
1258 # The task attempt has succeeded if the app's request handler returns an HTTP
1259 # response code in the range [`200` - `299`]. The task attempt has failed if
1260 # the app's handler returns a non-2xx response code or Cloud Tasks does
1261 # not receive response before the deadline. Failed
1262 # tasks will be retried according to the
1263 # retry configuration. `503` (Service Unavailable) is
1264 # considered an App Engine system error instead of an application error and
1265 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
1266 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
1267 # Requests) response from an app handler does not cause traffic congestion
1268 # control to throttle the queue.
1269 "relativeUrl": "A String", # The relative URL.
1270 #
1271 # The relative URL must begin with "/" and must be a valid HTTP relative URL.
1272 # It can contain a path and query string arguments.
1273 # If the relative URL is empty, then the root path "/" will be used.
1274 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -07001275 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001276 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001277 # This map contains the header field names and values.
1278 # Headers can be set when the
1279 # task is created.
1280 # Repeated headers are not supported but a header value can contain commas.
1281 #
1282 # Cloud Tasks sets some headers to default values:
1283 #
1284 # * `User-Agent`: By default, this header is
1285 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
1286 # This header can be modified, but Cloud Tasks will append
1287 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
1288 # modified `User-Agent`.
1289 #
1290 # If the task has a payload, Cloud
1291 # Tasks sets the following headers:
1292 #
1293 # * `Content-Type`: By default, the `Content-Type` header is set to
1294 # `"application/octet-stream"`. The default can be overridden by explicitly
1295 # setting `Content-Type` to a particular media type when the
1296 # task is created.
1297 # For example, `Content-Type` can be set to `"application/json"`.
1298 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1299 # output only. It cannot be changed.
1300 #
1301 # The headers below cannot be set or overridden:
1302 #
1303 # * `Host`
1304 # * `X-Google-*`
1305 # * `X-AppEngine-*`
1306 #
1307 # In addition, Cloud Tasks sets some headers when the task is dispatched,
1308 # such as headers containing information about the task; see
1309 # [request
1310 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
1311 # These headers are set only when the task is dispatched, so they are not
1312 # visible when the task is returned in a Cloud Tasks response.
1313 #
1314 # Although there is no specific limit for the maximum number of headers or
1315 # the size, there is a limit on the maximum size of the Task. For more
1316 # information, see the CreateTask documentation.
1317 "a_key": "A String",
1318 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001319 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
1320 #
1321 # If set,
1322 # app_engine_routing_override
1323 # is used for all tasks in the queue, no matter what the setting is for the
1324 # task-level app_engine_routing.
1325 #
1326 # Defines routing characteristics specific to App Engine - service, version,
1327 # and instance.
1328 #
1329 # For more information about services, versions, and instances see
1330 # [An Overview of App
1331 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
1332 # [Microservices Architecture on Google App
1333 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
1334 # [App Engine Standard request
1335 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
1336 # and [App Engine Flex request
1337 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1338 "instance": "A String", # App instance.
1339 #
1340 # By default, the task is sent to an instance which is available when
1341 # the task is attempted.
1342 #
1343 # Requests can only be sent to a specific instance if
1344 # [manual scaling is used in App Engine
1345 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
1346 # App Engine Flex does not support instances. For more information, see
1347 # [App Engine Standard request
1348 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1349 # and [App Engine Flex request
1350 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1351 "host": "A String", # Output only. The host that the task is sent to.
1352 #
1353 # For more information, see
1354 # [How Requests are
1355 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
1356 #
1357 # The host is constructed as:
1358 #
1359 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001360 # * `host = [application_domain_name]`&lt;/br&gt;
1361 # `| [service] + '.' + [application_domain_name]`&lt;/br&gt;
1362 # `| [version] + '.' + [application_domain_name]`&lt;/br&gt;
1363 # `| [version_dot_service]+ '.' + [application_domain_name]`&lt;/br&gt;
1364 # `| [instance] + '.' + [application_domain_name]`&lt;/br&gt;
1365 # `| [instance_dot_service] + '.' + [application_domain_name]`&lt;/br&gt;
1366 # `| [instance_dot_version] + '.' + [application_domain_name]`&lt;/br&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001367 # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
1368 #
1369 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07001370 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001371 # queue's project ID. Some tasks which were created using the App Engine
1372 # SDK use a custom domain name.
1373 #
1374 # * `service =` service
1375 #
1376 # * `version =` version
1377 #
1378 # * `version_dot_service =`
1379 # version `+ '.' +`
1380 # service
1381 #
1382 # * `instance =` instance
1383 #
1384 # * `instance_dot_service =`
1385 # instance `+ '.' +`
1386 # service
1387 #
1388 # * `instance_dot_version =`
1389 # instance `+ '.' +`
1390 # version
1391 #
1392 # * `instance_dot_version_dot_service =`
1393 # instance `+ '.' +`
1394 # version `+ '.' +`
1395 # service
1396 #
1397 # If service is empty, then the task will be sent
1398 # to the service which is the default service when the task is attempted.
1399 #
1400 # If version is empty, then the task will be sent
1401 # to the version which is the default version when the task is attempted.
1402 #
1403 # If instance is empty, then the task
1404 # will be sent to an instance which is available when the task is
1405 # attempted.
1406 #
1407 # If service,
1408 # version, or
1409 # instance is invalid, then the task
1410 # will be sent to the default version of the default service when
1411 # the task is attempted.
1412 "version": "A String", # App version.
1413 #
1414 # By default, the task is sent to the version which is the default
1415 # version when the task is attempted.
1416 #
1417 # For some queues or tasks which were created using the App Engine
1418 # Task Queue API, host is not parsable
1419 # into service,
1420 # version, and
1421 # instance. For example, some tasks
1422 # which were created using the App Engine SDK use a custom domain
1423 # name; custom domains are not parsed by Cloud Tasks. If
1424 # host is not parsable, then
1425 # service,
1426 # version, and
1427 # instance are the empty string.
1428 "service": "A String", # App service.
1429 #
1430 # By default, the task is sent to the service which is the default
1431 # service when the task is attempted.
1432 #
1433 # For some queues or tasks which were created using the App Engine
1434 # Task Queue API, host is not parsable
1435 # into service,
1436 # version, and
1437 # instance. For example, some tasks
1438 # which were created using the App Engine SDK use a custom domain
1439 # name; custom domains are not parsed by Cloud Tasks. If
1440 # host is not parsable, then
1441 # service,
1442 # version, and
1443 # instance are the empty string.
1444 },
1445 "payload": "A String", # Payload.
1446 #
1447 # The payload will be sent as the HTTP message body. A message
1448 # body, and thus a payload, is allowed only if the HTTP method is
1449 # POST or PUT. It is an error to set a data payload on a task with
1450 # an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07001451 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001452 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001453 # The app's request handler for the task's target URL must be able to handle
1454 # HTTP requests with this http_method, otherwise the task attempt fails with
1455 # error code 405 (Method Not Allowed). See [Writing a push task request
1456 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
1457 # and the App Engine documentation for your runtime on [How Requests are
1458 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001459 },
1460 "name": "A String", # Optionally caller-specified in CreateTask.
1461 #
1462 # The task name.
1463 #
1464 # The task name must have the following format:
1465 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1466 #
1467 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1468 # hyphens (-), colons (:), or periods (.).
1469 # For more information, see
1470 # [Identifying
1471 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1472 # * `LOCATION_ID` is the canonical ID for the task's location.
1473 # The list of available locations can be obtained by calling
1474 # ListLocations.
1475 # For more information, see https://cloud.google.com/about/locations/.
1476 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1477 # hyphens (-). The maximum length is 100 characters.
1478 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1479 # hyphens (-), or underscores (_). The maximum length is 500 characters.
1480 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
1481 #
1482 # For App Engine queues, this is when the task will be attempted or retried.
1483 #
1484 # For pull queues, this is the time when the task is available to
1485 # be leased; if a task is currently leased, this is the time when
1486 # the current lease expires, that is, the time that the task was
1487 # leased plus the lease_duration.
1488 #
1489 # `schedule_time` will be truncated to the nearest microsecond.
1490 "createTime": "A String", # Output only. The time that the task was created.
1491 #
1492 # `create_time` will be truncated to the nearest second.
1493 "view": "A String", # Output only. The view specifies which subset of the Task has
1494 # been returned.
1495 }</pre>
1496</div>
1497
1498<div class="method">
1499 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
1500 <pre>Deletes a task.
1501
1502A task can be deleted if it is scheduled or dispatched. A task
1503cannot be deleted if it has completed successfully or permanently
1504failed.
1505
1506Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001507 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001508`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
1509 x__xgafv: string, V1 error format.
1510 Allowed values
1511 1 - v1 error format
1512 2 - v2 error format
1513
1514Returns:
1515 An object of the form:
1516
1517 { # A generic empty message that you can re-use to avoid defining duplicated
1518 # empty messages in your APIs. A typical example is to use it as the request
1519 # or the response type of an API method. For instance:
1520 #
1521 # service Foo {
1522 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
1523 # }
1524 #
1525 # The JSON representation for `Empty` is empty JSON object `{}`.
1526 }</pre>
1527</div>
1528
1529<div class="method">
1530 <code class="details" id="get">get(name, responseView=None, x__xgafv=None)</code>
1531 <pre>Gets a task.
1532
1533Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001534 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001535`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
1536 responseView: string, The response_view specifies which subset of the Task will be
1537returned.
1538
1539By default response_view is BASIC; not all
1540information is retrieved by default because some data, such as
1541payloads, might be desirable to return only when needed because
1542of its large size or because of the sensitivity of data that it
1543contains.
1544
1545Authorization for FULL requires
1546`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1547permission on the Task resource.
1548 x__xgafv: string, V1 error format.
1549 Allowed values
1550 1 - v1 error format
1551 2 - v2 error format
1552
1553Returns:
1554 An object of the form:
1555
1556 { # A unit of scheduled work.
1557 "status": { # Status of the task. # Output only. The task status.
1558 "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt.
1559 #
1560 # This field is not calculated for pull tasks.
1561 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
1562 #
1563 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07001564 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
1565 #
1566 # `dispatch_time` will be truncated to the nearest microsecond.
1567 "responseTime": "A String", # Output only. The time that this attempt response was received.
1568 #
1569 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001570 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
1571 #
1572 # If the task has not been attempted or the task is currently running
1573 # then the response status is unset.
1574 # different programming environments, including REST APIs and RPC APIs. It is
1575 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1576 # three pieces of data: error code, error message, and error details.
1577 #
1578 # You can find out more about this error model and how to work with it in the
1579 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1580 "message": "A String", # A developer-facing error message, which should be in English. Any
1581 # user-facing error message should be localized and sent in the
1582 # google.rpc.Status.details field, or localized by the client.
1583 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
1584 "details": [ # A list of messages that carry the error details. There is a common set of
1585 # message types for APIs to use.
1586 {
1587 "a_key": "", # Properties of the object. Contains field @type with type URL.
1588 },
1589 ],
1590 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001591 },
1592 "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt.
1593 #
1594 # Only dispatch_time will be set.
1595 # The other AttemptStatus information is not retained by Cloud Tasks.
1596 #
1597 # This field is not calculated for pull tasks.
1598 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
1599 #
1600 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07001601 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
1602 #
1603 # `dispatch_time` will be truncated to the nearest microsecond.
1604 "responseTime": "A String", # Output only. The time that this attempt response was received.
1605 #
1606 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001607 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
1608 #
1609 # If the task has not been attempted or the task is currently running
1610 # then the response status is unset.
1611 # different programming environments, including REST APIs and RPC APIs. It is
1612 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1613 # three pieces of data: error code, error message, and error details.
1614 #
1615 # You can find out more about this error model and how to work with it in the
1616 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1617 "message": "A String", # A developer-facing error message, which should be in English. Any
1618 # user-facing error message should be localized and sent in the
1619 # google.rpc.Status.details field, or localized by the client.
1620 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
1621 "details": [ # A list of messages that carry the error details. There is a common set of
1622 # message types for APIs to use.
1623 {
1624 "a_key": "", # Properties of the object. Contains field @type with type URL.
1625 },
1626 ],
1627 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001628 },
1629 "attemptDispatchCount": 42, # Output only. The number of attempts dispatched.
1630 #
1631 # This count includes attempts which have been dispatched but haven't
1632 # received a response.
1633 "attemptResponseCount": 42, # Output only. The number of attempts which have received a response.
1634 #
1635 # This field is not calculated for pull tasks.
1636 },
1637 "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
1638 # set only if pull_target is set on the queue.
1639 #
1640 # A pull task is a task that has PullMessage set.
1641 # LeaseTasks to process the task.
1642 #
1643 # This proto can only be used for tasks in a queue which has
1644 # pull_target set.
1645 "tag": "A String", # The task's tag.
1646 #
1647 # Tags allow similar tasks to be processed in a batch. If you label
1648 # tasks with a tag, your worker can
1649 # lease tasks with the same tag using
1650 # filter. For example, if you want to
1651 # aggregate the events associated with a specific user once a day,
1652 # you could tag tasks with the user ID.
1653 #
1654 # The task's tag can only be set when the
1655 # task is created.
1656 #
1657 # The tag must be less than 500 characters.
1658 #
1659 # SDK compatibility: Although the SDK allows tags to be either
1660 # string or
1661 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
1662 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
1663 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
1664 "payload": "A String", # A data payload consumed by the worker to execute the task.
1665 },
1666 "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can
1667 # be set only if
1668 # app_engine_http_target is set
1669 # on the queue.
1670 #
1671 # An App Engine task is a task that has AppEngineHttpRequest set.
1672 #
1673 # The message defines the HTTP request that is sent to an App Engine app when
1674 # the task is dispatched.
1675 #
1676 # This proto can only be used for tasks in a queue which has
1677 # app_engine_http_target set.
1678 #
1679 # Using AppEngineHttpRequest requires
1680 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1681 # Google IAM permission for the project
1682 # and the following scope:
1683 #
1684 # `https://www.googleapis.com/auth/cloud-platform`
1685 #
1686 # The task will be delivered to the App Engine app which belongs to the same
1687 # project as the queue. For more information, see
1688 # [How Requests are
1689 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1690 # and how routing is affected by
1691 # [dispatch
1692 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
1693 # Traffic is encrypted during transport and never leaves Google datacenters.
1694 # Because this traffic is carried over a communication mechanism internal to
1695 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
1696 # The request to the handler, however, will appear to have used the HTTP
1697 # protocol.
1698 #
1699 # The AppEngineRouting used to construct the URL that the task is
1700 # delivered to can be set at the queue-level or task-level:
1701 #
1702 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07001703 # app_engine_routing_override
1704 # is used for all tasks in the queue, no matter what the setting
1705 # is for the
1706 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001707 #
1708 #
1709 # The `url` that the task will be sent to is:
1710 #
1711 # * `url =` host `+`
1712 # relative_url
1713 #
1714 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
1715 # URIs restricted with
1716 # [`login:
1717 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
1718 # Because tasks are not run as any user, they cannot be dispatched to URIs
1719 # restricted with
1720 # [`login:
1721 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
1722 # Task dispatches also do not follow redirects.
1723 #
1724 # The task attempt has succeeded if the app's request handler returns an HTTP
1725 # response code in the range [`200` - `299`]. The task attempt has failed if
1726 # the app's handler returns a non-2xx response code or Cloud Tasks does
1727 # not receive response before the deadline. Failed
1728 # tasks will be retried according to the
1729 # retry configuration. `503` (Service Unavailable) is
1730 # considered an App Engine system error instead of an application error and
1731 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
1732 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
1733 # Requests) response from an app handler does not cause traffic congestion
1734 # control to throttle the queue.
1735 "relativeUrl": "A String", # The relative URL.
1736 #
1737 # The relative URL must begin with "/" and must be a valid HTTP relative URL.
1738 # It can contain a path and query string arguments.
1739 # If the relative URL is empty, then the root path "/" will be used.
1740 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -07001741 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001742 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001743 # This map contains the header field names and values.
1744 # Headers can be set when the
1745 # task is created.
1746 # Repeated headers are not supported but a header value can contain commas.
1747 #
1748 # Cloud Tasks sets some headers to default values:
1749 #
1750 # * `User-Agent`: By default, this header is
1751 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
1752 # This header can be modified, but Cloud Tasks will append
1753 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
1754 # modified `User-Agent`.
1755 #
1756 # If the task has a payload, Cloud
1757 # Tasks sets the following headers:
1758 #
1759 # * `Content-Type`: By default, the `Content-Type` header is set to
1760 # `"application/octet-stream"`. The default can be overridden by explicitly
1761 # setting `Content-Type` to a particular media type when the
1762 # task is created.
1763 # For example, `Content-Type` can be set to `"application/json"`.
1764 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1765 # output only. It cannot be changed.
1766 #
1767 # The headers below cannot be set or overridden:
1768 #
1769 # * `Host`
1770 # * `X-Google-*`
1771 # * `X-AppEngine-*`
1772 #
1773 # In addition, Cloud Tasks sets some headers when the task is dispatched,
1774 # such as headers containing information about the task; see
1775 # [request
1776 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
1777 # These headers are set only when the task is dispatched, so they are not
1778 # visible when the task is returned in a Cloud Tasks response.
1779 #
1780 # Although there is no specific limit for the maximum number of headers or
1781 # the size, there is a limit on the maximum size of the Task. For more
1782 # information, see the CreateTask documentation.
1783 "a_key": "A String",
1784 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001785 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
1786 #
1787 # If set,
1788 # app_engine_routing_override
1789 # is used for all tasks in the queue, no matter what the setting is for the
1790 # task-level app_engine_routing.
1791 #
1792 # Defines routing characteristics specific to App Engine - service, version,
1793 # and instance.
1794 #
1795 # For more information about services, versions, and instances see
1796 # [An Overview of App
1797 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
1798 # [Microservices Architecture on Google App
1799 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
1800 # [App Engine Standard request
1801 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
1802 # and [App Engine Flex request
1803 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1804 "instance": "A String", # App instance.
1805 #
1806 # By default, the task is sent to an instance which is available when
1807 # the task is attempted.
1808 #
1809 # Requests can only be sent to a specific instance if
1810 # [manual scaling is used in App Engine
1811 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
1812 # App Engine Flex does not support instances. For more information, see
1813 # [App Engine Standard request
1814 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1815 # and [App Engine Flex request
1816 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1817 "host": "A String", # Output only. The host that the task is sent to.
1818 #
1819 # For more information, see
1820 # [How Requests are
1821 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
1822 #
1823 # The host is constructed as:
1824 #
1825 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001826 # * `host = [application_domain_name]`&lt;/br&gt;
1827 # `| [service] + '.' + [application_domain_name]`&lt;/br&gt;
1828 # `| [version] + '.' + [application_domain_name]`&lt;/br&gt;
1829 # `| [version_dot_service]+ '.' + [application_domain_name]`&lt;/br&gt;
1830 # `| [instance] + '.' + [application_domain_name]`&lt;/br&gt;
1831 # `| [instance_dot_service] + '.' + [application_domain_name]`&lt;/br&gt;
1832 # `| [instance_dot_version] + '.' + [application_domain_name]`&lt;/br&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001833 # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
1834 #
1835 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07001836 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001837 # queue's project ID. Some tasks which were created using the App Engine
1838 # SDK use a custom domain name.
1839 #
1840 # * `service =` service
1841 #
1842 # * `version =` version
1843 #
1844 # * `version_dot_service =`
1845 # version `+ '.' +`
1846 # service
1847 #
1848 # * `instance =` instance
1849 #
1850 # * `instance_dot_service =`
1851 # instance `+ '.' +`
1852 # service
1853 #
1854 # * `instance_dot_version =`
1855 # instance `+ '.' +`
1856 # version
1857 #
1858 # * `instance_dot_version_dot_service =`
1859 # instance `+ '.' +`
1860 # version `+ '.' +`
1861 # service
1862 #
1863 # If service is empty, then the task will be sent
1864 # to the service which is the default service when the task is attempted.
1865 #
1866 # If version is empty, then the task will be sent
1867 # to the version which is the default version when the task is attempted.
1868 #
1869 # If instance is empty, then the task
1870 # will be sent to an instance which is available when the task is
1871 # attempted.
1872 #
1873 # If service,
1874 # version, or
1875 # instance is invalid, then the task
1876 # will be sent to the default version of the default service when
1877 # the task is attempted.
1878 "version": "A String", # App version.
1879 #
1880 # By default, the task is sent to the version which is the default
1881 # version when the task is attempted.
1882 #
1883 # For some queues or tasks which were created using the App Engine
1884 # Task Queue API, host is not parsable
1885 # into service,
1886 # version, and
1887 # instance. For example, some tasks
1888 # which were created using the App Engine SDK use a custom domain
1889 # name; custom domains are not parsed by Cloud Tasks. If
1890 # host is not parsable, then
1891 # service,
1892 # version, and
1893 # instance are the empty string.
1894 "service": "A String", # App service.
1895 #
1896 # By default, the task is sent to the service which is the default
1897 # service when the task is attempted.
1898 #
1899 # For some queues or tasks which were created using the App Engine
1900 # Task Queue API, host is not parsable
1901 # into service,
1902 # version, and
1903 # instance. For example, some tasks
1904 # which were created using the App Engine SDK use a custom domain
1905 # name; custom domains are not parsed by Cloud Tasks. If
1906 # host is not parsable, then
1907 # service,
1908 # version, and
1909 # instance are the empty string.
1910 },
1911 "payload": "A String", # Payload.
1912 #
1913 # The payload will be sent as the HTTP message body. A message
1914 # body, and thus a payload, is allowed only if the HTTP method is
1915 # POST or PUT. It is an error to set a data payload on a task with
1916 # an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07001917 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001918 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001919 # The app's request handler for the task's target URL must be able to handle
1920 # HTTP requests with this http_method, otherwise the task attempt fails with
1921 # error code 405 (Method Not Allowed). See [Writing a push task request
1922 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
1923 # and the App Engine documentation for your runtime on [How Requests are
1924 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001925 },
1926 "name": "A String", # Optionally caller-specified in CreateTask.
1927 #
1928 # The task name.
1929 #
1930 # The task name must have the following format:
1931 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1932 #
1933 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1934 # hyphens (-), colons (:), or periods (.).
1935 # For more information, see
1936 # [Identifying
1937 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1938 # * `LOCATION_ID` is the canonical ID for the task's location.
1939 # The list of available locations can be obtained by calling
1940 # ListLocations.
1941 # For more information, see https://cloud.google.com/about/locations/.
1942 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1943 # hyphens (-). The maximum length is 100 characters.
1944 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1945 # hyphens (-), or underscores (_). The maximum length is 500 characters.
1946 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
1947 #
1948 # For App Engine queues, this is when the task will be attempted or retried.
1949 #
1950 # For pull queues, this is the time when the task is available to
1951 # be leased; if a task is currently leased, this is the time when
1952 # the current lease expires, that is, the time that the task was
1953 # leased plus the lease_duration.
1954 #
1955 # `schedule_time` will be truncated to the nearest microsecond.
1956 "createTime": "A String", # Output only. The time that the task was created.
1957 #
1958 # `create_time` will be truncated to the nearest second.
1959 "view": "A String", # Output only. The view specifies which subset of the Task has
1960 # been returned.
1961 }</pre>
1962</div>
1963
1964<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001965 <code class="details" id="lease">lease(parent, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001966 <pre>Leases tasks from a pull queue for
1967lease_duration.
1968
1969This method is invoked by the worker to obtain a lease. The
1970worker must acknowledge the task via
1971AcknowledgeTask after they have
1972performed the work associated with the task.
1973
1974The payload is intended to store data that
1975the worker needs to perform the work associated with the task. To
1976return the payloads in the response, set
1977response_view to
1978FULL.
1979
1980A maximum of 10 qps of LeaseTasks
1981requests are allowed per
1982queue. RESOURCE_EXHAUSTED
1983is returned when this limit is
1984exceeded. RESOURCE_EXHAUSTED
1985is also returned when
1986max_tasks_dispatched_per_second
1987is exceeded.
1988
1989Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001990 parent: string, Required. The queue name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001991`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001992 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001993 The object takes the form of:
1994
1995{ # Request message for leasing tasks using LeaseTasks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001996 "filter": "A String", # `filter` can be used to specify a subset of tasks to lease.
1997 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001998 # When `filter` is set to `tag=&lt;my-tag&gt;` then the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001999 # response will contain only tasks whose
Dan O'Mearadd494642020-05-01 07:42:23 -07002000 # tag is equal to `&lt;my-tag&gt;`. `&lt;my-tag&gt;` must be
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002001 # less than 500 characters.
2002 #
2003 # When `filter` is set to `tag_function=oldest_tag()`, only tasks which have
2004 # the same tag as the task with the oldest
2005 # schedule_time will be returned.
2006 #
2007 # Grammar Syntax:
2008 #
2009 # * `filter = "tag=" tag | "tag_function=" function`
2010 #
2011 # * `tag = string`
2012 #
2013 # * `function = "oldest_tag()"`
2014 #
2015 # The `oldest_tag()` function returns tasks which have the same tag as the
2016 # oldest task (ordered by schedule time).
2017 #
2018 # SDK compatibility: Although the SDK allows tags to be either
2019 # string or
2020 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
2021 # only UTF-8 encoded tags can be used in Cloud Tasks. Tag which
2022 # aren't UTF-8 encoded can't be used in the
2023 # filter and the task's
2024 # tag will be displayed as empty in Cloud Tasks.
Dan O'Mearadd494642020-05-01 07:42:23 -07002025 "maxTasks": 42, # The maximum number of tasks to lease.
2026 #
2027 # The system will make a best effort to return as close to as
2028 # `max_tasks` as possible.
2029 #
2030 # The largest that `max_tasks` can be is 1000.
2031 #
2032 # The maximum total size of a lease tasks response is
2033 # 32 MB. If the sum of all task sizes requested reaches this limit,
2034 # fewer tasks than requested are returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002035 "responseView": "A String", # The response_view specifies which subset of the Task will be
2036 # returned.
2037 #
2038 # By default response_view is BASIC; not all
2039 # information is retrieved by default because some data, such as
2040 # payloads, might be desirable to return only when needed because
2041 # of its large size or because of the sensitivity of data that it
2042 # contains.
2043 #
2044 # Authorization for FULL requires
2045 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
2046 # permission on the Task resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07002047 "leaseDuration": "A String", # Required. The duration of the lease.
2048 #
2049 # Each task returned in the response will
2050 # have its schedule_time set to the current
2051 # time plus the `lease_duration`. The task is leased until its
2052 # schedule_time; thus, the task will not be
2053 # returned to another LeaseTasks call
2054 # before its schedule_time.
2055 #
2056 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002057 # After the worker has successfully finished the work associated
2058 # with the task, the worker must call via
2059 # AcknowledgeTask before the
2060 # schedule_time. Otherwise the task will be
2061 # returned to a later LeaseTasks call so
2062 # that another worker can retry it.
2063 #
2064 # The maximum lease duration is 1 week.
2065 # `lease_duration` will be truncated to the nearest second.
2066 }
2067
2068 x__xgafv: string, V1 error format.
2069 Allowed values
2070 1 - v1 error format
2071 2 - v2 error format
2072
2073Returns:
2074 An object of the form:
2075
2076 { # Response message for leasing tasks using LeaseTasks.
2077 "tasks": [ # The leased tasks.
2078 { # A unit of scheduled work.
2079 "status": { # Status of the task. # Output only. The task status.
2080 "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt.
2081 #
2082 # This field is not calculated for pull tasks.
2083 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
2084 #
2085 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07002086 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
2087 #
2088 # `dispatch_time` will be truncated to the nearest microsecond.
2089 "responseTime": "A String", # Output only. The time that this attempt response was received.
2090 #
2091 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002092 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
2093 #
2094 # If the task has not been attempted or the task is currently running
2095 # then the response status is unset.
2096 # different programming environments, including REST APIs and RPC APIs. It is
2097 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2098 # three pieces of data: error code, error message, and error details.
2099 #
2100 # You can find out more about this error model and how to work with it in the
2101 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2102 "message": "A String", # A developer-facing error message, which should be in English. Any
2103 # user-facing error message should be localized and sent in the
2104 # google.rpc.Status.details field, or localized by the client.
2105 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
2106 "details": [ # A list of messages that carry the error details. There is a common set of
2107 # message types for APIs to use.
2108 {
2109 "a_key": "", # Properties of the object. Contains field @type with type URL.
2110 },
2111 ],
2112 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002113 },
2114 "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt.
2115 #
2116 # Only dispatch_time will be set.
2117 # The other AttemptStatus information is not retained by Cloud Tasks.
2118 #
2119 # This field is not calculated for pull tasks.
2120 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
2121 #
2122 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07002123 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
2124 #
2125 # `dispatch_time` will be truncated to the nearest microsecond.
2126 "responseTime": "A String", # Output only. The time that this attempt response was received.
2127 #
2128 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002129 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
2130 #
2131 # If the task has not been attempted or the task is currently running
2132 # then the response status is unset.
2133 # different programming environments, including REST APIs and RPC APIs. It is
2134 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2135 # three pieces of data: error code, error message, and error details.
2136 #
2137 # You can find out more about this error model and how to work with it in the
2138 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2139 "message": "A String", # A developer-facing error message, which should be in English. Any
2140 # user-facing error message should be localized and sent in the
2141 # google.rpc.Status.details field, or localized by the client.
2142 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
2143 "details": [ # A list of messages that carry the error details. There is a common set of
2144 # message types for APIs to use.
2145 {
2146 "a_key": "", # Properties of the object. Contains field @type with type URL.
2147 },
2148 ],
2149 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002150 },
2151 "attemptDispatchCount": 42, # Output only. The number of attempts dispatched.
2152 #
2153 # This count includes attempts which have been dispatched but haven't
2154 # received a response.
2155 "attemptResponseCount": 42, # Output only. The number of attempts which have received a response.
2156 #
2157 # This field is not calculated for pull tasks.
2158 },
2159 "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
2160 # set only if pull_target is set on the queue.
2161 #
2162 # A pull task is a task that has PullMessage set.
2163 # LeaseTasks to process the task.
2164 #
2165 # This proto can only be used for tasks in a queue which has
2166 # pull_target set.
2167 "tag": "A String", # The task's tag.
2168 #
2169 # Tags allow similar tasks to be processed in a batch. If you label
2170 # tasks with a tag, your worker can
2171 # lease tasks with the same tag using
2172 # filter. For example, if you want to
2173 # aggregate the events associated with a specific user once a day,
2174 # you could tag tasks with the user ID.
2175 #
2176 # The task's tag can only be set when the
2177 # task is created.
2178 #
2179 # The tag must be less than 500 characters.
2180 #
2181 # SDK compatibility: Although the SDK allows tags to be either
2182 # string or
2183 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
2184 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
2185 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
2186 "payload": "A String", # A data payload consumed by the worker to execute the task.
2187 },
2188 "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can
2189 # be set only if
2190 # app_engine_http_target is set
2191 # on the queue.
2192 #
2193 # An App Engine task is a task that has AppEngineHttpRequest set.
2194 #
2195 # The message defines the HTTP request that is sent to an App Engine app when
2196 # the task is dispatched.
2197 #
2198 # This proto can only be used for tasks in a queue which has
2199 # app_engine_http_target set.
2200 #
2201 # Using AppEngineHttpRequest requires
2202 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
2203 # Google IAM permission for the project
2204 # and the following scope:
2205 #
2206 # `https://www.googleapis.com/auth/cloud-platform`
2207 #
2208 # The task will be delivered to the App Engine app which belongs to the same
2209 # project as the queue. For more information, see
2210 # [How Requests are
2211 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2212 # and how routing is affected by
2213 # [dispatch
2214 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
2215 # Traffic is encrypted during transport and never leaves Google datacenters.
2216 # Because this traffic is carried over a communication mechanism internal to
2217 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
2218 # The request to the handler, however, will appear to have used the HTTP
2219 # protocol.
2220 #
2221 # The AppEngineRouting used to construct the URL that the task is
2222 # delivered to can be set at the queue-level or task-level:
2223 #
2224 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07002225 # app_engine_routing_override
2226 # is used for all tasks in the queue, no matter what the setting
2227 # is for the
2228 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002229 #
2230 #
2231 # The `url` that the task will be sent to is:
2232 #
2233 # * `url =` host `+`
2234 # relative_url
2235 #
2236 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
2237 # URIs restricted with
2238 # [`login:
2239 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
2240 # Because tasks are not run as any user, they cannot be dispatched to URIs
2241 # restricted with
2242 # [`login:
2243 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
2244 # Task dispatches also do not follow redirects.
2245 #
2246 # The task attempt has succeeded if the app's request handler returns an HTTP
2247 # response code in the range [`200` - `299`]. The task attempt has failed if
2248 # the app's handler returns a non-2xx response code or Cloud Tasks does
2249 # not receive response before the deadline. Failed
2250 # tasks will be retried according to the
2251 # retry configuration. `503` (Service Unavailable) is
2252 # considered an App Engine system error instead of an application error and
2253 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
2254 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
2255 # Requests) response from an app handler does not cause traffic congestion
2256 # control to throttle the queue.
2257 "relativeUrl": "A String", # The relative URL.
2258 #
2259 # The relative URL must begin with "/" and must be a valid HTTP relative URL.
2260 # It can contain a path and query string arguments.
2261 # If the relative URL is empty, then the root path "/" will be used.
2262 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -07002263 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002264 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002265 # This map contains the header field names and values.
2266 # Headers can be set when the
2267 # task is created.
2268 # Repeated headers are not supported but a header value can contain commas.
2269 #
2270 # Cloud Tasks sets some headers to default values:
2271 #
2272 # * `User-Agent`: By default, this header is
2273 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
2274 # This header can be modified, but Cloud Tasks will append
2275 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
2276 # modified `User-Agent`.
2277 #
2278 # If the task has a payload, Cloud
2279 # Tasks sets the following headers:
2280 #
2281 # * `Content-Type`: By default, the `Content-Type` header is set to
2282 # `"application/octet-stream"`. The default can be overridden by explicitly
2283 # setting `Content-Type` to a particular media type when the
2284 # task is created.
2285 # For example, `Content-Type` can be set to `"application/json"`.
2286 # * `Content-Length`: This is computed by Cloud Tasks. This value is
2287 # output only. It cannot be changed.
2288 #
2289 # The headers below cannot be set or overridden:
2290 #
2291 # * `Host`
2292 # * `X-Google-*`
2293 # * `X-AppEngine-*`
2294 #
2295 # In addition, Cloud Tasks sets some headers when the task is dispatched,
2296 # such as headers containing information about the task; see
2297 # [request
2298 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
2299 # These headers are set only when the task is dispatched, so they are not
2300 # visible when the task is returned in a Cloud Tasks response.
2301 #
2302 # Although there is no specific limit for the maximum number of headers or
2303 # the size, there is a limit on the maximum size of the Task. For more
2304 # information, see the CreateTask documentation.
2305 "a_key": "A String",
2306 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002307 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
2308 #
2309 # If set,
2310 # app_engine_routing_override
2311 # is used for all tasks in the queue, no matter what the setting is for the
2312 # task-level app_engine_routing.
2313 #
2314 # Defines routing characteristics specific to App Engine - service, version,
2315 # and instance.
2316 #
2317 # For more information about services, versions, and instances see
2318 # [An Overview of App
2319 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
2320 # [Microservices Architecture on Google App
2321 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
2322 # [App Engine Standard request
2323 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
2324 # and [App Engine Flex request
2325 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
2326 "instance": "A String", # App instance.
2327 #
2328 # By default, the task is sent to an instance which is available when
2329 # the task is attempted.
2330 #
2331 # Requests can only be sent to a specific instance if
2332 # [manual scaling is used in App Engine
2333 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
2334 # App Engine Flex does not support instances. For more information, see
2335 # [App Engine Standard request
2336 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2337 # and [App Engine Flex request
2338 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
2339 "host": "A String", # Output only. The host that the task is sent to.
2340 #
2341 # For more information, see
2342 # [How Requests are
2343 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
2344 #
2345 # The host is constructed as:
2346 #
2347 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002348 # * `host = [application_domain_name]`&lt;/br&gt;
2349 # `| [service] + '.' + [application_domain_name]`&lt;/br&gt;
2350 # `| [version] + '.' + [application_domain_name]`&lt;/br&gt;
2351 # `| [version_dot_service]+ '.' + [application_domain_name]`&lt;/br&gt;
2352 # `| [instance] + '.' + [application_domain_name]`&lt;/br&gt;
2353 # `| [instance_dot_service] + '.' + [application_domain_name]`&lt;/br&gt;
2354 # `| [instance_dot_version] + '.' + [application_domain_name]`&lt;/br&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002355 # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
2356 #
2357 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07002358 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002359 # queue's project ID. Some tasks which were created using the App Engine
2360 # SDK use a custom domain name.
2361 #
2362 # * `service =` service
2363 #
2364 # * `version =` version
2365 #
2366 # * `version_dot_service =`
2367 # version `+ '.' +`
2368 # service
2369 #
2370 # * `instance =` instance
2371 #
2372 # * `instance_dot_service =`
2373 # instance `+ '.' +`
2374 # service
2375 #
2376 # * `instance_dot_version =`
2377 # instance `+ '.' +`
2378 # version
2379 #
2380 # * `instance_dot_version_dot_service =`
2381 # instance `+ '.' +`
2382 # version `+ '.' +`
2383 # service
2384 #
2385 # If service is empty, then the task will be sent
2386 # to the service which is the default service when the task is attempted.
2387 #
2388 # If version is empty, then the task will be sent
2389 # to the version which is the default version when the task is attempted.
2390 #
2391 # If instance is empty, then the task
2392 # will be sent to an instance which is available when the task is
2393 # attempted.
2394 #
2395 # If service,
2396 # version, or
2397 # instance is invalid, then the task
2398 # will be sent to the default version of the default service when
2399 # the task is attempted.
2400 "version": "A String", # App version.
2401 #
2402 # By default, the task is sent to the version which is the default
2403 # version when the task is attempted.
2404 #
2405 # For some queues or tasks which were created using the App Engine
2406 # Task Queue API, host is not parsable
2407 # into service,
2408 # version, and
2409 # instance. For example, some tasks
2410 # which were created using the App Engine SDK use a custom domain
2411 # name; custom domains are not parsed by Cloud Tasks. If
2412 # host is not parsable, then
2413 # service,
2414 # version, and
2415 # instance are the empty string.
2416 "service": "A String", # App service.
2417 #
2418 # By default, the task is sent to the service which is the default
2419 # service when the task is attempted.
2420 #
2421 # For some queues or tasks which were created using the App Engine
2422 # Task Queue API, host is not parsable
2423 # into service,
2424 # version, and
2425 # instance. For example, some tasks
2426 # which were created using the App Engine SDK use a custom domain
2427 # name; custom domains are not parsed by Cloud Tasks. If
2428 # host is not parsable, then
2429 # service,
2430 # version, and
2431 # instance are the empty string.
2432 },
2433 "payload": "A String", # Payload.
2434 #
2435 # The payload will be sent as the HTTP message body. A message
2436 # body, and thus a payload, is allowed only if the HTTP method is
2437 # POST or PUT. It is an error to set a data payload on a task with
2438 # an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07002439 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002440 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002441 # The app's request handler for the task's target URL must be able to handle
2442 # HTTP requests with this http_method, otherwise the task attempt fails with
2443 # error code 405 (Method Not Allowed). See [Writing a push task request
2444 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
2445 # and the App Engine documentation for your runtime on [How Requests are
2446 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002447 },
2448 "name": "A String", # Optionally caller-specified in CreateTask.
2449 #
2450 # The task name.
2451 #
2452 # The task name must have the following format:
2453 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
2454 #
2455 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
2456 # hyphens (-), colons (:), or periods (.).
2457 # For more information, see
2458 # [Identifying
2459 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
2460 # * `LOCATION_ID` is the canonical ID for the task's location.
2461 # The list of available locations can be obtained by calling
2462 # ListLocations.
2463 # For more information, see https://cloud.google.com/about/locations/.
2464 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
2465 # hyphens (-). The maximum length is 100 characters.
2466 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
2467 # hyphens (-), or underscores (_). The maximum length is 500 characters.
2468 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
2469 #
2470 # For App Engine queues, this is when the task will be attempted or retried.
2471 #
2472 # For pull queues, this is the time when the task is available to
2473 # be leased; if a task is currently leased, this is the time when
2474 # the current lease expires, that is, the time that the task was
2475 # leased plus the lease_duration.
2476 #
2477 # `schedule_time` will be truncated to the nearest microsecond.
2478 "createTime": "A String", # Output only. The time that the task was created.
2479 #
2480 # `create_time` will be truncated to the nearest second.
2481 "view": "A String", # Output only. The view specifies which subset of the Task has
2482 # been returned.
2483 },
2484 ],
2485 }</pre>
2486</div>
2487
2488<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002489 <code class="details" id="list">list(parent, responseView=None, pageToken=None, x__xgafv=None, pageSize=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002490 <pre>Lists the tasks in a queue.
2491
2492By default, only the BASIC view is retrieved
2493due to performance considerations;
2494response_view controls the
2495subset of information which is returned.
2496
2497The tasks may be returned in any order. The ordering may change at any
2498time.
2499
2500Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07002501 parent: string, Required. The queue name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002502`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` (required)
2503 responseView: string, The response_view specifies which subset of the Task will be
2504returned.
2505
2506By default response_view is BASIC; not all
2507information is retrieved by default because some data, such as
2508payloads, might be desirable to return only when needed because
2509of its large size or because of the sensitivity of data that it
2510contains.
2511
2512Authorization for FULL requires
2513`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
2514permission on the Task resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002515 pageToken: string, A token identifying the page of results to return.
2516
2517To request the first page results, page_token must be empty. To
2518request the next page of results, page_token must be the value of
2519next_page_token returned
2520from the previous call to ListTasks
2521method.
2522
2523The page token is valid for only 2 hours.
2524 x__xgafv: string, V1 error format.
2525 Allowed values
2526 1 - v1 error format
2527 2 - v2 error format
Dan O'Mearadd494642020-05-01 07:42:23 -07002528 pageSize: integer, Maximum page size.
2529
2530Fewer tasks than requested might be returned, even if more tasks exist; use
2531next_page_token in the response to
2532determine if more tasks exist.
2533
2534The maximum page size is 1000. If unspecified, the page size will be the
2535maximum.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002536
2537Returns:
2538 An object of the form:
2539
2540 { # Response message for listing tasks using ListTasks.
2541 "nextPageToken": "A String", # A token to retrieve next page of results.
2542 #
2543 # To return the next page of results, call
2544 # ListTasks with this value as the
2545 # page_token.
2546 #
2547 # If the next_page_token is empty, there are no more results.
2548 "tasks": [ # The list of tasks.
2549 { # A unit of scheduled work.
2550 "status": { # Status of the task. # Output only. The task status.
2551 "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt.
2552 #
2553 # This field is not calculated for pull tasks.
2554 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
2555 #
2556 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07002557 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
2558 #
2559 # `dispatch_time` will be truncated to the nearest microsecond.
2560 "responseTime": "A String", # Output only. The time that this attempt response was received.
2561 #
2562 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002563 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
2564 #
2565 # If the task has not been attempted or the task is currently running
2566 # then the response status is unset.
2567 # different programming environments, including REST APIs and RPC APIs. It is
2568 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2569 # three pieces of data: error code, error message, and error details.
2570 #
2571 # You can find out more about this error model and how to work with it in the
2572 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2573 "message": "A String", # A developer-facing error message, which should be in English. Any
2574 # user-facing error message should be localized and sent in the
2575 # google.rpc.Status.details field, or localized by the client.
2576 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
2577 "details": [ # A list of messages that carry the error details. There is a common set of
2578 # message types for APIs to use.
2579 {
2580 "a_key": "", # Properties of the object. Contains field @type with type URL.
2581 },
2582 ],
2583 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002584 },
2585 "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt.
2586 #
2587 # Only dispatch_time will be set.
2588 # The other AttemptStatus information is not retained by Cloud Tasks.
2589 #
2590 # This field is not calculated for pull tasks.
2591 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
2592 #
2593 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07002594 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
2595 #
2596 # `dispatch_time` will be truncated to the nearest microsecond.
2597 "responseTime": "A String", # Output only. The time that this attempt response was received.
2598 #
2599 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002600 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
2601 #
2602 # If the task has not been attempted or the task is currently running
2603 # then the response status is unset.
2604 # different programming environments, including REST APIs and RPC APIs. It is
2605 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2606 # three pieces of data: error code, error message, and error details.
2607 #
2608 # You can find out more about this error model and how to work with it in the
2609 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2610 "message": "A String", # A developer-facing error message, which should be in English. Any
2611 # user-facing error message should be localized and sent in the
2612 # google.rpc.Status.details field, or localized by the client.
2613 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
2614 "details": [ # A list of messages that carry the error details. There is a common set of
2615 # message types for APIs to use.
2616 {
2617 "a_key": "", # Properties of the object. Contains field @type with type URL.
2618 },
2619 ],
2620 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002621 },
2622 "attemptDispatchCount": 42, # Output only. The number of attempts dispatched.
2623 #
2624 # This count includes attempts which have been dispatched but haven't
2625 # received a response.
2626 "attemptResponseCount": 42, # Output only. The number of attempts which have received a response.
2627 #
2628 # This field is not calculated for pull tasks.
2629 },
2630 "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
2631 # set only if pull_target is set on the queue.
2632 #
2633 # A pull task is a task that has PullMessage set.
2634 # LeaseTasks to process the task.
2635 #
2636 # This proto can only be used for tasks in a queue which has
2637 # pull_target set.
2638 "tag": "A String", # The task's tag.
2639 #
2640 # Tags allow similar tasks to be processed in a batch. If you label
2641 # tasks with a tag, your worker can
2642 # lease tasks with the same tag using
2643 # filter. For example, if you want to
2644 # aggregate the events associated with a specific user once a day,
2645 # you could tag tasks with the user ID.
2646 #
2647 # The task's tag can only be set when the
2648 # task is created.
2649 #
2650 # The tag must be less than 500 characters.
2651 #
2652 # SDK compatibility: Although the SDK allows tags to be either
2653 # string or
2654 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
2655 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
2656 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
2657 "payload": "A String", # A data payload consumed by the worker to execute the task.
2658 },
2659 "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can
2660 # be set only if
2661 # app_engine_http_target is set
2662 # on the queue.
2663 #
2664 # An App Engine task is a task that has AppEngineHttpRequest set.
2665 #
2666 # The message defines the HTTP request that is sent to an App Engine app when
2667 # the task is dispatched.
2668 #
2669 # This proto can only be used for tasks in a queue which has
2670 # app_engine_http_target set.
2671 #
2672 # Using AppEngineHttpRequest requires
2673 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
2674 # Google IAM permission for the project
2675 # and the following scope:
2676 #
2677 # `https://www.googleapis.com/auth/cloud-platform`
2678 #
2679 # The task will be delivered to the App Engine app which belongs to the same
2680 # project as the queue. For more information, see
2681 # [How Requests are
2682 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2683 # and how routing is affected by
2684 # [dispatch
2685 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
2686 # Traffic is encrypted during transport and never leaves Google datacenters.
2687 # Because this traffic is carried over a communication mechanism internal to
2688 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
2689 # The request to the handler, however, will appear to have used the HTTP
2690 # protocol.
2691 #
2692 # The AppEngineRouting used to construct the URL that the task is
2693 # delivered to can be set at the queue-level or task-level:
2694 #
2695 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07002696 # app_engine_routing_override
2697 # is used for all tasks in the queue, no matter what the setting
2698 # is for the
2699 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002700 #
2701 #
2702 # The `url` that the task will be sent to is:
2703 #
2704 # * `url =` host `+`
2705 # relative_url
2706 #
2707 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
2708 # URIs restricted with
2709 # [`login:
2710 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
2711 # Because tasks are not run as any user, they cannot be dispatched to URIs
2712 # restricted with
2713 # [`login:
2714 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
2715 # Task dispatches also do not follow redirects.
2716 #
2717 # The task attempt has succeeded if the app's request handler returns an HTTP
2718 # response code in the range [`200` - `299`]. The task attempt has failed if
2719 # the app's handler returns a non-2xx response code or Cloud Tasks does
2720 # not receive response before the deadline. Failed
2721 # tasks will be retried according to the
2722 # retry configuration. `503` (Service Unavailable) is
2723 # considered an App Engine system error instead of an application error and
2724 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
2725 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
2726 # Requests) response from an app handler does not cause traffic congestion
2727 # control to throttle the queue.
2728 "relativeUrl": "A String", # The relative URL.
2729 #
2730 # The relative URL must begin with "/" and must be a valid HTTP relative URL.
2731 # It can contain a path and query string arguments.
2732 # If the relative URL is empty, then the root path "/" will be used.
2733 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -07002734 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002735 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002736 # This map contains the header field names and values.
2737 # Headers can be set when the
2738 # task is created.
2739 # Repeated headers are not supported but a header value can contain commas.
2740 #
2741 # Cloud Tasks sets some headers to default values:
2742 #
2743 # * `User-Agent`: By default, this header is
2744 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
2745 # This header can be modified, but Cloud Tasks will append
2746 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
2747 # modified `User-Agent`.
2748 #
2749 # If the task has a payload, Cloud
2750 # Tasks sets the following headers:
2751 #
2752 # * `Content-Type`: By default, the `Content-Type` header is set to
2753 # `"application/octet-stream"`. The default can be overridden by explicitly
2754 # setting `Content-Type` to a particular media type when the
2755 # task is created.
2756 # For example, `Content-Type` can be set to `"application/json"`.
2757 # * `Content-Length`: This is computed by Cloud Tasks. This value is
2758 # output only. It cannot be changed.
2759 #
2760 # The headers below cannot be set or overridden:
2761 #
2762 # * `Host`
2763 # * `X-Google-*`
2764 # * `X-AppEngine-*`
2765 #
2766 # In addition, Cloud Tasks sets some headers when the task is dispatched,
2767 # such as headers containing information about the task; see
2768 # [request
2769 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
2770 # These headers are set only when the task is dispatched, so they are not
2771 # visible when the task is returned in a Cloud Tasks response.
2772 #
2773 # Although there is no specific limit for the maximum number of headers or
2774 # the size, there is a limit on the maximum size of the Task. For more
2775 # information, see the CreateTask documentation.
2776 "a_key": "A String",
2777 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002778 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
2779 #
2780 # If set,
2781 # app_engine_routing_override
2782 # is used for all tasks in the queue, no matter what the setting is for the
2783 # task-level app_engine_routing.
2784 #
2785 # Defines routing characteristics specific to App Engine - service, version,
2786 # and instance.
2787 #
2788 # For more information about services, versions, and instances see
2789 # [An Overview of App
2790 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
2791 # [Microservices Architecture on Google App
2792 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
2793 # [App Engine Standard request
2794 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
2795 # and [App Engine Flex request
2796 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
2797 "instance": "A String", # App instance.
2798 #
2799 # By default, the task is sent to an instance which is available when
2800 # the task is attempted.
2801 #
2802 # Requests can only be sent to a specific instance if
2803 # [manual scaling is used in App Engine
2804 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
2805 # App Engine Flex does not support instances. For more information, see
2806 # [App Engine Standard request
2807 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2808 # and [App Engine Flex request
2809 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
2810 "host": "A String", # Output only. The host that the task is sent to.
2811 #
2812 # For more information, see
2813 # [How Requests are
2814 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
2815 #
2816 # The host is constructed as:
2817 #
2818 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002819 # * `host = [application_domain_name]`&lt;/br&gt;
2820 # `| [service] + '.' + [application_domain_name]`&lt;/br&gt;
2821 # `| [version] + '.' + [application_domain_name]`&lt;/br&gt;
2822 # `| [version_dot_service]+ '.' + [application_domain_name]`&lt;/br&gt;
2823 # `| [instance] + '.' + [application_domain_name]`&lt;/br&gt;
2824 # `| [instance_dot_service] + '.' + [application_domain_name]`&lt;/br&gt;
2825 # `| [instance_dot_version] + '.' + [application_domain_name]`&lt;/br&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002826 # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
2827 #
2828 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07002829 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002830 # queue's project ID. Some tasks which were created using the App Engine
2831 # SDK use a custom domain name.
2832 #
2833 # * `service =` service
2834 #
2835 # * `version =` version
2836 #
2837 # * `version_dot_service =`
2838 # version `+ '.' +`
2839 # service
2840 #
2841 # * `instance =` instance
2842 #
2843 # * `instance_dot_service =`
2844 # instance `+ '.' +`
2845 # service
2846 #
2847 # * `instance_dot_version =`
2848 # instance `+ '.' +`
2849 # version
2850 #
2851 # * `instance_dot_version_dot_service =`
2852 # instance `+ '.' +`
2853 # version `+ '.' +`
2854 # service
2855 #
2856 # If service is empty, then the task will be sent
2857 # to the service which is the default service when the task is attempted.
2858 #
2859 # If version is empty, then the task will be sent
2860 # to the version which is the default version when the task is attempted.
2861 #
2862 # If instance is empty, then the task
2863 # will be sent to an instance which is available when the task is
2864 # attempted.
2865 #
2866 # If service,
2867 # version, or
2868 # instance is invalid, then the task
2869 # will be sent to the default version of the default service when
2870 # the task is attempted.
2871 "version": "A String", # App version.
2872 #
2873 # By default, the task is sent to the version which is the default
2874 # version when the task is attempted.
2875 #
2876 # For some queues or tasks which were created using the App Engine
2877 # Task Queue API, host is not parsable
2878 # into service,
2879 # version, and
2880 # instance. For example, some tasks
2881 # which were created using the App Engine SDK use a custom domain
2882 # name; custom domains are not parsed by Cloud Tasks. If
2883 # host is not parsable, then
2884 # service,
2885 # version, and
2886 # instance are the empty string.
2887 "service": "A String", # App service.
2888 #
2889 # By default, the task is sent to the service which is the default
2890 # service when the task is attempted.
2891 #
2892 # For some queues or tasks which were created using the App Engine
2893 # Task Queue API, host is not parsable
2894 # into service,
2895 # version, and
2896 # instance. For example, some tasks
2897 # which were created using the App Engine SDK use a custom domain
2898 # name; custom domains are not parsed by Cloud Tasks. If
2899 # host is not parsable, then
2900 # service,
2901 # version, and
2902 # instance are the empty string.
2903 },
2904 "payload": "A String", # Payload.
2905 #
2906 # The payload will be sent as the HTTP message body. A message
2907 # body, and thus a payload, is allowed only if the HTTP method is
2908 # POST or PUT. It is an error to set a data payload on a task with
2909 # an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07002910 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002911 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002912 # The app's request handler for the task's target URL must be able to handle
2913 # HTTP requests with this http_method, otherwise the task attempt fails with
2914 # error code 405 (Method Not Allowed). See [Writing a push task request
2915 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
2916 # and the App Engine documentation for your runtime on [How Requests are
2917 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002918 },
2919 "name": "A String", # Optionally caller-specified in CreateTask.
2920 #
2921 # The task name.
2922 #
2923 # The task name must have the following format:
2924 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
2925 #
2926 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
2927 # hyphens (-), colons (:), or periods (.).
2928 # For more information, see
2929 # [Identifying
2930 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
2931 # * `LOCATION_ID` is the canonical ID for the task's location.
2932 # The list of available locations can be obtained by calling
2933 # ListLocations.
2934 # For more information, see https://cloud.google.com/about/locations/.
2935 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
2936 # hyphens (-). The maximum length is 100 characters.
2937 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
2938 # hyphens (-), or underscores (_). The maximum length is 500 characters.
2939 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
2940 #
2941 # For App Engine queues, this is when the task will be attempted or retried.
2942 #
2943 # For pull queues, this is the time when the task is available to
2944 # be leased; if a task is currently leased, this is the time when
2945 # the current lease expires, that is, the time that the task was
2946 # leased plus the lease_duration.
2947 #
2948 # `schedule_time` will be truncated to the nearest microsecond.
2949 "createTime": "A String", # Output only. The time that the task was created.
2950 #
2951 # `create_time` will be truncated to the nearest second.
2952 "view": "A String", # Output only. The view specifies which subset of the Task has
2953 # been returned.
2954 },
2955 ],
2956 }</pre>
2957</div>
2958
2959<div class="method">
2960 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
2961 <pre>Retrieves the next page of results.
2962
2963Args:
2964 previous_request: The request for the previous page. (required)
2965 previous_response: The response from the request for the previous page. (required)
2966
2967Returns:
2968 A request object that you can call 'execute()' on to request the next
2969 page. Returns None if there are no more items in the collection.
2970 </pre>
2971</div>
2972
2973<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002974 <code class="details" id="renewLease">renewLease(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002975 <pre>Renew the current lease of a pull task.
2976
2977The worker can use this method to extend the lease by a new
2978duration, starting from now. The new task lease will be
2979returned in the task's schedule_time.
2980
2981Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07002982 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002983`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002984 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002985 The object takes the form of:
2986
2987{ # Request message for renewing a lease using
2988 # RenewLease.
Dan O'Mearadd494642020-05-01 07:42:23 -07002989 "scheduleTime": "A String", # Required. The task's current schedule time, available in the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002990 # schedule_time returned by
2991 # LeaseTasks response or
2992 # RenewLease response. This restriction is
2993 # to ensure that your worker currently holds the lease.
2994 "responseView": "A String", # The response_view specifies which subset of the Task will be
2995 # returned.
2996 #
2997 # By default response_view is BASIC; not all
2998 # information is retrieved by default because some data, such as
2999 # payloads, might be desirable to return only when needed because
3000 # of its large size or because of the sensitivity of data that it
3001 # contains.
3002 #
3003 # Authorization for FULL requires
3004 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
3005 # permission on the Task resource.
Dan O'Mearadd494642020-05-01 07:42:23 -07003006 "leaseDuration": "A String", # Required. The desired new lease duration, starting from now.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003007 #
3008 #
3009 # The maximum lease duration is 1 week.
3010 # `lease_duration` will be truncated to the nearest second.
3011 }
3012
3013 x__xgafv: string, V1 error format.
3014 Allowed values
3015 1 - v1 error format
3016 2 - v2 error format
3017
3018Returns:
3019 An object of the form:
3020
3021 { # A unit of scheduled work.
3022 "status": { # Status of the task. # Output only. The task status.
3023 "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt.
3024 #
3025 # This field is not calculated for pull tasks.
3026 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
3027 #
3028 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07003029 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
3030 #
3031 # `dispatch_time` will be truncated to the nearest microsecond.
3032 "responseTime": "A String", # Output only. The time that this attempt response was received.
3033 #
3034 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003035 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
3036 #
3037 # If the task has not been attempted or the task is currently running
3038 # then the response status is unset.
3039 # different programming environments, including REST APIs and RPC APIs. It is
3040 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3041 # three pieces of data: error code, error message, and error details.
3042 #
3043 # You can find out more about this error model and how to work with it in the
3044 # [API Design Guide](https://cloud.google.com/apis/design/errors).
3045 "message": "A String", # A developer-facing error message, which should be in English. Any
3046 # user-facing error message should be localized and sent in the
3047 # google.rpc.Status.details field, or localized by the client.
3048 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
3049 "details": [ # A list of messages that carry the error details. There is a common set of
3050 # message types for APIs to use.
3051 {
3052 "a_key": "", # Properties of the object. Contains field @type with type URL.
3053 },
3054 ],
3055 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003056 },
3057 "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt.
3058 #
3059 # Only dispatch_time will be set.
3060 # The other AttemptStatus information is not retained by Cloud Tasks.
3061 #
3062 # This field is not calculated for pull tasks.
3063 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
3064 #
3065 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07003066 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
3067 #
3068 # `dispatch_time` will be truncated to the nearest microsecond.
3069 "responseTime": "A String", # Output only. The time that this attempt response was received.
3070 #
3071 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003072 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
3073 #
3074 # If the task has not been attempted or the task is currently running
3075 # then the response status is unset.
3076 # different programming environments, including REST APIs and RPC APIs. It is
3077 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3078 # three pieces of data: error code, error message, and error details.
3079 #
3080 # You can find out more about this error model and how to work with it in the
3081 # [API Design Guide](https://cloud.google.com/apis/design/errors).
3082 "message": "A String", # A developer-facing error message, which should be in English. Any
3083 # user-facing error message should be localized and sent in the
3084 # google.rpc.Status.details field, or localized by the client.
3085 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
3086 "details": [ # A list of messages that carry the error details. There is a common set of
3087 # message types for APIs to use.
3088 {
3089 "a_key": "", # Properties of the object. Contains field @type with type URL.
3090 },
3091 ],
3092 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003093 },
3094 "attemptDispatchCount": 42, # Output only. The number of attempts dispatched.
3095 #
3096 # This count includes attempts which have been dispatched but haven't
3097 # received a response.
3098 "attemptResponseCount": 42, # Output only. The number of attempts which have received a response.
3099 #
3100 # This field is not calculated for pull tasks.
3101 },
3102 "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
3103 # set only if pull_target is set on the queue.
3104 #
3105 # A pull task is a task that has PullMessage set.
3106 # LeaseTasks to process the task.
3107 #
3108 # This proto can only be used for tasks in a queue which has
3109 # pull_target set.
3110 "tag": "A String", # The task's tag.
3111 #
3112 # Tags allow similar tasks to be processed in a batch. If you label
3113 # tasks with a tag, your worker can
3114 # lease tasks with the same tag using
3115 # filter. For example, if you want to
3116 # aggregate the events associated with a specific user once a day,
3117 # you could tag tasks with the user ID.
3118 #
3119 # The task's tag can only be set when the
3120 # task is created.
3121 #
3122 # The tag must be less than 500 characters.
3123 #
3124 # SDK compatibility: Although the SDK allows tags to be either
3125 # string or
3126 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
3127 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
3128 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
3129 "payload": "A String", # A data payload consumed by the worker to execute the task.
3130 },
3131 "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can
3132 # be set only if
3133 # app_engine_http_target is set
3134 # on the queue.
3135 #
3136 # An App Engine task is a task that has AppEngineHttpRequest set.
3137 #
3138 # The message defines the HTTP request that is sent to an App Engine app when
3139 # the task is dispatched.
3140 #
3141 # This proto can only be used for tasks in a queue which has
3142 # app_engine_http_target set.
3143 #
3144 # Using AppEngineHttpRequest requires
3145 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
3146 # Google IAM permission for the project
3147 # and the following scope:
3148 #
3149 # `https://www.googleapis.com/auth/cloud-platform`
3150 #
3151 # The task will be delivered to the App Engine app which belongs to the same
3152 # project as the queue. For more information, see
3153 # [How Requests are
3154 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
3155 # and how routing is affected by
3156 # [dispatch
3157 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
3158 # Traffic is encrypted during transport and never leaves Google datacenters.
3159 # Because this traffic is carried over a communication mechanism internal to
3160 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
3161 # The request to the handler, however, will appear to have used the HTTP
3162 # protocol.
3163 #
3164 # The AppEngineRouting used to construct the URL that the task is
3165 # delivered to can be set at the queue-level or task-level:
3166 #
3167 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07003168 # app_engine_routing_override
3169 # is used for all tasks in the queue, no matter what the setting
3170 # is for the
3171 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003172 #
3173 #
3174 # The `url` that the task will be sent to is:
3175 #
3176 # * `url =` host `+`
3177 # relative_url
3178 #
3179 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
3180 # URIs restricted with
3181 # [`login:
3182 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
3183 # Because tasks are not run as any user, they cannot be dispatched to URIs
3184 # restricted with
3185 # [`login:
3186 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
3187 # Task dispatches also do not follow redirects.
3188 #
3189 # The task attempt has succeeded if the app's request handler returns an HTTP
3190 # response code in the range [`200` - `299`]. The task attempt has failed if
3191 # the app's handler returns a non-2xx response code or Cloud Tasks does
3192 # not receive response before the deadline. Failed
3193 # tasks will be retried according to the
3194 # retry configuration. `503` (Service Unavailable) is
3195 # considered an App Engine system error instead of an application error and
3196 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
3197 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
3198 # Requests) response from an app handler does not cause traffic congestion
3199 # control to throttle the queue.
3200 "relativeUrl": "A String", # The relative URL.
3201 #
3202 # The relative URL must begin with "/" and must be a valid HTTP relative URL.
3203 # It can contain a path and query string arguments.
3204 # If the relative URL is empty, then the root path "/" will be used.
3205 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -07003206 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003207 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003208 # This map contains the header field names and values.
3209 # Headers can be set when the
3210 # task is created.
3211 # Repeated headers are not supported but a header value can contain commas.
3212 #
3213 # Cloud Tasks sets some headers to default values:
3214 #
3215 # * `User-Agent`: By default, this header is
3216 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
3217 # This header can be modified, but Cloud Tasks will append
3218 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
3219 # modified `User-Agent`.
3220 #
3221 # If the task has a payload, Cloud
3222 # Tasks sets the following headers:
3223 #
3224 # * `Content-Type`: By default, the `Content-Type` header is set to
3225 # `"application/octet-stream"`. The default can be overridden by explicitly
3226 # setting `Content-Type` to a particular media type when the
3227 # task is created.
3228 # For example, `Content-Type` can be set to `"application/json"`.
3229 # * `Content-Length`: This is computed by Cloud Tasks. This value is
3230 # output only. It cannot be changed.
3231 #
3232 # The headers below cannot be set or overridden:
3233 #
3234 # * `Host`
3235 # * `X-Google-*`
3236 # * `X-AppEngine-*`
3237 #
3238 # In addition, Cloud Tasks sets some headers when the task is dispatched,
3239 # such as headers containing information about the task; see
3240 # [request
3241 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
3242 # These headers are set only when the task is dispatched, so they are not
3243 # visible when the task is returned in a Cloud Tasks response.
3244 #
3245 # Although there is no specific limit for the maximum number of headers or
3246 # the size, there is a limit on the maximum size of the Task. For more
3247 # information, see the CreateTask documentation.
3248 "a_key": "A String",
3249 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003250 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
3251 #
3252 # If set,
3253 # app_engine_routing_override
3254 # is used for all tasks in the queue, no matter what the setting is for the
3255 # task-level app_engine_routing.
3256 #
3257 # Defines routing characteristics specific to App Engine - service, version,
3258 # and instance.
3259 #
3260 # For more information about services, versions, and instances see
3261 # [An Overview of App
3262 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
3263 # [Microservices Architecture on Google App
3264 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
3265 # [App Engine Standard request
3266 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
3267 # and [App Engine Flex request
3268 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
3269 "instance": "A String", # App instance.
3270 #
3271 # By default, the task is sent to an instance which is available when
3272 # the task is attempted.
3273 #
3274 # Requests can only be sent to a specific instance if
3275 # [manual scaling is used in App Engine
3276 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
3277 # App Engine Flex does not support instances. For more information, see
3278 # [App Engine Standard request
3279 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
3280 # and [App Engine Flex request
3281 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
3282 "host": "A String", # Output only. The host that the task is sent to.
3283 #
3284 # For more information, see
3285 # [How Requests are
3286 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
3287 #
3288 # The host is constructed as:
3289 #
3290 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003291 # * `host = [application_domain_name]`&lt;/br&gt;
3292 # `| [service] + '.' + [application_domain_name]`&lt;/br&gt;
3293 # `| [version] + '.' + [application_domain_name]`&lt;/br&gt;
3294 # `| [version_dot_service]+ '.' + [application_domain_name]`&lt;/br&gt;
3295 # `| [instance] + '.' + [application_domain_name]`&lt;/br&gt;
3296 # `| [instance_dot_service] + '.' + [application_domain_name]`&lt;/br&gt;
3297 # `| [instance_dot_version] + '.' + [application_domain_name]`&lt;/br&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003298 # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
3299 #
3300 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07003301 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003302 # queue's project ID. Some tasks which were created using the App Engine
3303 # SDK use a custom domain name.
3304 #
3305 # * `service =` service
3306 #
3307 # * `version =` version
3308 #
3309 # * `version_dot_service =`
3310 # version `+ '.' +`
3311 # service
3312 #
3313 # * `instance =` instance
3314 #
3315 # * `instance_dot_service =`
3316 # instance `+ '.' +`
3317 # service
3318 #
3319 # * `instance_dot_version =`
3320 # instance `+ '.' +`
3321 # version
3322 #
3323 # * `instance_dot_version_dot_service =`
3324 # instance `+ '.' +`
3325 # version `+ '.' +`
3326 # service
3327 #
3328 # If service is empty, then the task will be sent
3329 # to the service which is the default service when the task is attempted.
3330 #
3331 # If version is empty, then the task will be sent
3332 # to the version which is the default version when the task is attempted.
3333 #
3334 # If instance is empty, then the task
3335 # will be sent to an instance which is available when the task is
3336 # attempted.
3337 #
3338 # If service,
3339 # version, or
3340 # instance is invalid, then the task
3341 # will be sent to the default version of the default service when
3342 # the task is attempted.
3343 "version": "A String", # App version.
3344 #
3345 # By default, the task is sent to the version which is the default
3346 # version when the task is attempted.
3347 #
3348 # For some queues or tasks which were created using the App Engine
3349 # Task Queue API, host is not parsable
3350 # into service,
3351 # version, and
3352 # instance. For example, some tasks
3353 # which were created using the App Engine SDK use a custom domain
3354 # name; custom domains are not parsed by Cloud Tasks. If
3355 # host is not parsable, then
3356 # service,
3357 # version, and
3358 # instance are the empty string.
3359 "service": "A String", # App service.
3360 #
3361 # By default, the task is sent to the service which is the default
3362 # service when the task is attempted.
3363 #
3364 # For some queues or tasks which were created using the App Engine
3365 # Task Queue API, host is not parsable
3366 # into service,
3367 # version, and
3368 # instance. For example, some tasks
3369 # which were created using the App Engine SDK use a custom domain
3370 # name; custom domains are not parsed by Cloud Tasks. If
3371 # host is not parsable, then
3372 # service,
3373 # version, and
3374 # instance are the empty string.
3375 },
3376 "payload": "A String", # Payload.
3377 #
3378 # The payload will be sent as the HTTP message body. A message
3379 # body, and thus a payload, is allowed only if the HTTP method is
3380 # POST or PUT. It is an error to set a data payload on a task with
3381 # an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07003382 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003383 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003384 # The app's request handler for the task's target URL must be able to handle
3385 # HTTP requests with this http_method, otherwise the task attempt fails with
3386 # error code 405 (Method Not Allowed). See [Writing a push task request
3387 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
3388 # and the App Engine documentation for your runtime on [How Requests are
3389 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003390 },
3391 "name": "A String", # Optionally caller-specified in CreateTask.
3392 #
3393 # The task name.
3394 #
3395 # The task name must have the following format:
3396 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
3397 #
3398 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
3399 # hyphens (-), colons (:), or periods (.).
3400 # For more information, see
3401 # [Identifying
3402 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
3403 # * `LOCATION_ID` is the canonical ID for the task's location.
3404 # The list of available locations can be obtained by calling
3405 # ListLocations.
3406 # For more information, see https://cloud.google.com/about/locations/.
3407 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
3408 # hyphens (-). The maximum length is 100 characters.
3409 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
3410 # hyphens (-), or underscores (_). The maximum length is 500 characters.
3411 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
3412 #
3413 # For App Engine queues, this is when the task will be attempted or retried.
3414 #
3415 # For pull queues, this is the time when the task is available to
3416 # be leased; if a task is currently leased, this is the time when
3417 # the current lease expires, that is, the time that the task was
3418 # leased plus the lease_duration.
3419 #
3420 # `schedule_time` will be truncated to the nearest microsecond.
3421 "createTime": "A String", # Output only. The time that the task was created.
3422 #
3423 # `create_time` will be truncated to the nearest second.
3424 "view": "A String", # Output only. The view specifies which subset of the Task has
3425 # been returned.
3426 }</pre>
3427</div>
3428
3429<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07003430 <code class="details" id="run">run(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003431 <pre>Forces a task to run now.
3432
3433When this method is called, Cloud Tasks will dispatch the task, even if
3434the task is already running, the queue has reached its RateLimits or
3435is PAUSED.
3436
3437This command is meant to be used for manual debugging. For
3438example, RunTask can be used to retry a failed
3439task after a fix has been made or to manually force a task to be
3440dispatched now.
3441
3442The dispatched task is returned. That is, the task that is returned
3443contains the status after the task is dispatched but
3444before the task is received by its target.
3445
3446If Cloud Tasks receives a successful response from the task's
3447target, then the task will be deleted; otherwise the task's
3448schedule_time will be reset to the time that
3449RunTask was called plus the retry delay specified
3450in the queue's RetryConfig.
3451
3452RunTask returns
3453NOT_FOUND when it is called on a
3454task that has already succeeded or permanently failed.
3455
3456RunTask cannot be called on a
3457pull task.
3458
3459Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07003460 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003461`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07003462 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003463 The object takes the form of:
3464
3465{ # Request message for forcing a task to run now using
3466 # RunTask.
3467 "responseView": "A String", # The response_view specifies which subset of the Task will be
3468 # returned.
3469 #
3470 # By default response_view is BASIC; not all
3471 # information is retrieved by default because some data, such as
3472 # payloads, might be desirable to return only when needed because
3473 # of its large size or because of the sensitivity of data that it
3474 # contains.
3475 #
3476 # Authorization for FULL requires
3477 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
3478 # permission on the Task resource.
3479 }
3480
3481 x__xgafv: string, V1 error format.
3482 Allowed values
3483 1 - v1 error format
3484 2 - v2 error format
3485
3486Returns:
3487 An object of the form:
3488
3489 { # A unit of scheduled work.
3490 "status": { # Status of the task. # Output only. The task status.
3491 "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt.
3492 #
3493 # This field is not calculated for pull tasks.
3494 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
3495 #
3496 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07003497 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
3498 #
3499 # `dispatch_time` will be truncated to the nearest microsecond.
3500 "responseTime": "A String", # Output only. The time that this attempt response was received.
3501 #
3502 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003503 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
3504 #
3505 # If the task has not been attempted or the task is currently running
3506 # then the response status is unset.
3507 # different programming environments, including REST APIs and RPC APIs. It is
3508 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3509 # three pieces of data: error code, error message, and error details.
3510 #
3511 # You can find out more about this error model and how to work with it in the
3512 # [API Design Guide](https://cloud.google.com/apis/design/errors).
3513 "message": "A String", # A developer-facing error message, which should be in English. Any
3514 # user-facing error message should be localized and sent in the
3515 # google.rpc.Status.details field, or localized by the client.
3516 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
3517 "details": [ # A list of messages that carry the error details. There is a common set of
3518 # message types for APIs to use.
3519 {
3520 "a_key": "", # Properties of the object. Contains field @type with type URL.
3521 },
3522 ],
3523 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003524 },
3525 "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt.
3526 #
3527 # Only dispatch_time will be set.
3528 # The other AttemptStatus information is not retained by Cloud Tasks.
3529 #
3530 # This field is not calculated for pull tasks.
3531 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled.
3532 #
3533 # `schedule_time` will be truncated to the nearest microsecond.
Dan O'Mearadd494642020-05-01 07:42:23 -07003534 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched.
3535 #
3536 # `dispatch_time` will be truncated to the nearest microsecond.
3537 "responseTime": "A String", # Output only. The time that this attempt response was received.
3538 #
3539 # `response_time` will be truncated to the nearest microsecond.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003540 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
3541 #
3542 # If the task has not been attempted or the task is currently running
3543 # then the response status is unset.
3544 # different programming environments, including REST APIs and RPC APIs. It is
3545 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3546 # three pieces of data: error code, error message, and error details.
3547 #
3548 # You can find out more about this error model and how to work with it in the
3549 # [API Design Guide](https://cloud.google.com/apis/design/errors).
3550 "message": "A String", # A developer-facing error message, which should be in English. Any
3551 # user-facing error message should be localized and sent in the
3552 # google.rpc.Status.details field, or localized by the client.
3553 "code": 42, # The status code, which should be an enum value of google.rpc.Code.
3554 "details": [ # A list of messages that carry the error details. There is a common set of
3555 # message types for APIs to use.
3556 {
3557 "a_key": "", # Properties of the object. Contains field @type with type URL.
3558 },
3559 ],
3560 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003561 },
3562 "attemptDispatchCount": 42, # Output only. The number of attempts dispatched.
3563 #
3564 # This count includes attempts which have been dispatched but haven't
3565 # received a response.
3566 "attemptResponseCount": 42, # Output only. The number of attempts which have received a response.
3567 #
3568 # This field is not calculated for pull tasks.
3569 },
3570 "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
3571 # set only if pull_target is set on the queue.
3572 #
3573 # A pull task is a task that has PullMessage set.
3574 # LeaseTasks to process the task.
3575 #
3576 # This proto can only be used for tasks in a queue which has
3577 # pull_target set.
3578 "tag": "A String", # The task's tag.
3579 #
3580 # Tags allow similar tasks to be processed in a batch. If you label
3581 # tasks with a tag, your worker can
3582 # lease tasks with the same tag using
3583 # filter. For example, if you want to
3584 # aggregate the events associated with a specific user once a day,
3585 # you could tag tasks with the user ID.
3586 #
3587 # The task's tag can only be set when the
3588 # task is created.
3589 #
3590 # The tag must be less than 500 characters.
3591 #
3592 # SDK compatibility: Although the SDK allows tags to be either
3593 # string or
3594 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
3595 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8
3596 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
3597 "payload": "A String", # A data payload consumed by the worker to execute the task.
3598 },
3599 "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can
3600 # be set only if
3601 # app_engine_http_target is set
3602 # on the queue.
3603 #
3604 # An App Engine task is a task that has AppEngineHttpRequest set.
3605 #
3606 # The message defines the HTTP request that is sent to an App Engine app when
3607 # the task is dispatched.
3608 #
3609 # This proto can only be used for tasks in a queue which has
3610 # app_engine_http_target set.
3611 #
3612 # Using AppEngineHttpRequest requires
3613 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
3614 # Google IAM permission for the project
3615 # and the following scope:
3616 #
3617 # `https://www.googleapis.com/auth/cloud-platform`
3618 #
3619 # The task will be delivered to the App Engine app which belongs to the same
3620 # project as the queue. For more information, see
3621 # [How Requests are
3622 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
3623 # and how routing is affected by
3624 # [dispatch
3625 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
3626 # Traffic is encrypted during transport and never leaves Google datacenters.
3627 # Because this traffic is carried over a communication mechanism internal to
3628 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
3629 # The request to the handler, however, will appear to have used the HTTP
3630 # protocol.
3631 #
3632 # The AppEngineRouting used to construct the URL that the task is
3633 # delivered to can be set at the queue-level or task-level:
3634 #
3635 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07003636 # app_engine_routing_override
3637 # is used for all tasks in the queue, no matter what the setting
3638 # is for the
3639 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003640 #
3641 #
3642 # The `url` that the task will be sent to is:
3643 #
3644 # * `url =` host `+`
3645 # relative_url
3646 #
3647 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
3648 # URIs restricted with
3649 # [`login:
3650 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
3651 # Because tasks are not run as any user, they cannot be dispatched to URIs
3652 # restricted with
3653 # [`login:
3654 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
3655 # Task dispatches also do not follow redirects.
3656 #
3657 # The task attempt has succeeded if the app's request handler returns an HTTP
3658 # response code in the range [`200` - `299`]. The task attempt has failed if
3659 # the app's handler returns a non-2xx response code or Cloud Tasks does
3660 # not receive response before the deadline. Failed
3661 # tasks will be retried according to the
3662 # retry configuration. `503` (Service Unavailable) is
3663 # considered an App Engine system error instead of an application error and
3664 # will cause Cloud Tasks' traffic congestion control to temporarily throttle
3665 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many
3666 # Requests) response from an app handler does not cause traffic congestion
3667 # control to throttle the queue.
3668 "relativeUrl": "A String", # The relative URL.
3669 #
3670 # The relative URL must begin with "/" and must be a valid HTTP relative URL.
3671 # It can contain a path and query string arguments.
3672 # If the relative URL is empty, then the root path "/" will be used.
3673 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Dan O'Mearadd494642020-05-01 07:42:23 -07003674 "headers": { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003675 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003676 # This map contains the header field names and values.
3677 # Headers can be set when the
3678 # task is created.
3679 # Repeated headers are not supported but a header value can contain commas.
3680 #
3681 # Cloud Tasks sets some headers to default values:
3682 #
3683 # * `User-Agent`: By default, this header is
3684 # `"AppEngine-Google; (+http://code.google.com/appengine)"`.
3685 # This header can be modified, but Cloud Tasks will append
3686 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the
3687 # modified `User-Agent`.
3688 #
3689 # If the task has a payload, Cloud
3690 # Tasks sets the following headers:
3691 #
3692 # * `Content-Type`: By default, the `Content-Type` header is set to
3693 # `"application/octet-stream"`. The default can be overridden by explicitly
3694 # setting `Content-Type` to a particular media type when the
3695 # task is created.
3696 # For example, `Content-Type` can be set to `"application/json"`.
3697 # * `Content-Length`: This is computed by Cloud Tasks. This value is
3698 # output only. It cannot be changed.
3699 #
3700 # The headers below cannot be set or overridden:
3701 #
3702 # * `Host`
3703 # * `X-Google-*`
3704 # * `X-AppEngine-*`
3705 #
3706 # In addition, Cloud Tasks sets some headers when the task is dispatched,
3707 # such as headers containing information about the task; see
3708 # [request
3709 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
3710 # These headers are set only when the task is dispatched, so they are not
3711 # visible when the task is returned in a Cloud Tasks response.
3712 #
3713 # Although there is no specific limit for the maximum number of headers or
3714 # the size, there is a limit on the maximum size of the Task. For more
3715 # information, see the CreateTask documentation.
3716 "a_key": "A String",
3717 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003718 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing.
3719 #
3720 # If set,
3721 # app_engine_routing_override
3722 # is used for all tasks in the queue, no matter what the setting is for the
3723 # task-level app_engine_routing.
3724 #
3725 # Defines routing characteristics specific to App Engine - service, version,
3726 # and instance.
3727 #
3728 # For more information about services, versions, and instances see
3729 # [An Overview of App
3730 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
3731 # [Microservices Architecture on Google App
3732 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
3733 # [App Engine Standard request
3734 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
3735 # and [App Engine Flex request
3736 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
3737 "instance": "A String", # App instance.
3738 #
3739 # By default, the task is sent to an instance which is available when
3740 # the task is attempted.
3741 #
3742 # Requests can only be sent to a specific instance if
3743 # [manual scaling is used in App Engine
3744 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
3745 # App Engine Flex does not support instances. For more information, see
3746 # [App Engine Standard request
3747 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
3748 # and [App Engine Flex request
3749 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
3750 "host": "A String", # Output only. The host that the task is sent to.
3751 #
3752 # For more information, see
3753 # [How Requests are
3754 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
3755 #
3756 # The host is constructed as:
3757 #
3758 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003759 # * `host = [application_domain_name]`&lt;/br&gt;
3760 # `| [service] + '.' + [application_domain_name]`&lt;/br&gt;
3761 # `| [version] + '.' + [application_domain_name]`&lt;/br&gt;
3762 # `| [version_dot_service]+ '.' + [application_domain_name]`&lt;/br&gt;
3763 # `| [instance] + '.' + [application_domain_name]`&lt;/br&gt;
3764 # `| [instance_dot_service] + '.' + [application_domain_name]`&lt;/br&gt;
3765 # `| [instance_dot_version] + '.' + [application_domain_name]`&lt;/br&gt;
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003766 # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]`
3767 #
3768 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07003769 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003770 # queue's project ID. Some tasks which were created using the App Engine
3771 # SDK use a custom domain name.
3772 #
3773 # * `service =` service
3774 #
3775 # * `version =` version
3776 #
3777 # * `version_dot_service =`
3778 # version `+ '.' +`
3779 # service
3780 #
3781 # * `instance =` instance
3782 #
3783 # * `instance_dot_service =`
3784 # instance `+ '.' +`
3785 # service
3786 #
3787 # * `instance_dot_version =`
3788 # instance `+ '.' +`
3789 # version
3790 #
3791 # * `instance_dot_version_dot_service =`
3792 # instance `+ '.' +`
3793 # version `+ '.' +`
3794 # service
3795 #
3796 # If service is empty, then the task will be sent
3797 # to the service which is the default service when the task is attempted.
3798 #
3799 # If version is empty, then the task will be sent
3800 # to the version which is the default version when the task is attempted.
3801 #
3802 # If instance is empty, then the task
3803 # will be sent to an instance which is available when the task is
3804 # attempted.
3805 #
3806 # If service,
3807 # version, or
3808 # instance is invalid, then the task
3809 # will be sent to the default version of the default service when
3810 # the task is attempted.
3811 "version": "A String", # App version.
3812 #
3813 # By default, the task is sent to the version which is the default
3814 # version when the task is attempted.
3815 #
3816 # For some queues or tasks which were created using the App Engine
3817 # Task Queue API, host is not parsable
3818 # into service,
3819 # version, and
3820 # instance. For example, some tasks
3821 # which were created using the App Engine SDK use a custom domain
3822 # name; custom domains are not parsed by Cloud Tasks. If
3823 # host is not parsable, then
3824 # service,
3825 # version, and
3826 # instance are the empty string.
3827 "service": "A String", # App service.
3828 #
3829 # By default, the task is sent to the service which is the default
3830 # service when the task is attempted.
3831 #
3832 # For some queues or tasks which were created using the App Engine
3833 # Task Queue API, host is not parsable
3834 # into service,
3835 # version, and
3836 # instance. For example, some tasks
3837 # which were created using the App Engine SDK use a custom domain
3838 # name; custom domains are not parsed by Cloud Tasks. If
3839 # host is not parsable, then
3840 # service,
3841 # version, and
3842 # instance are the empty string.
3843 },
3844 "payload": "A String", # Payload.
3845 #
3846 # The payload will be sent as the HTTP message body. A message
3847 # body, and thus a payload, is allowed only if the HTTP method is
3848 # POST or PUT. It is an error to set a data payload on a task with
3849 # an incompatible HttpMethod.
Dan O'Mearadd494642020-05-01 07:42:23 -07003850 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003851 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003852 # The app's request handler for the task's target URL must be able to handle
3853 # HTTP requests with this http_method, otherwise the task attempt fails with
3854 # error code 405 (Method Not Allowed). See [Writing a push task request
3855 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
3856 # and the App Engine documentation for your runtime on [How Requests are
3857 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003858 },
3859 "name": "A String", # Optionally caller-specified in CreateTask.
3860 #
3861 # The task name.
3862 #
3863 # The task name must have the following format:
3864 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
3865 #
3866 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
3867 # hyphens (-), colons (:), or periods (.).
3868 # For more information, see
3869 # [Identifying
3870 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
3871 # * `LOCATION_ID` is the canonical ID for the task's location.
3872 # The list of available locations can be obtained by calling
3873 # ListLocations.
3874 # For more information, see https://cloud.google.com/about/locations/.
3875 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
3876 # hyphens (-). The maximum length is 100 characters.
3877 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
3878 # hyphens (-), or underscores (_). The maximum length is 500 characters.
3879 "scheduleTime": "A String", # The time when the task is scheduled to be attempted.
3880 #
3881 # For App Engine queues, this is when the task will be attempted or retried.
3882 #
3883 # For pull queues, this is the time when the task is available to
3884 # be leased; if a task is currently leased, this is the time when
3885 # the current lease expires, that is, the time that the task was
3886 # leased plus the lease_duration.
3887 #
3888 # `schedule_time` will be truncated to the nearest microsecond.
3889 "createTime": "A String", # Output only. The time that the task was created.
3890 #
3891 # `create_time` will be truncated to the nearest second.
3892 "view": "A String", # Output only. The view specifies which subset of the Task has
3893 # been returned.
3894 }</pre>
3895</div>
3896
3897</body></html>