blob: ea60994e556f9b470fcfc08cfed1d762378b5566 [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">
Bu Sun Kimd059ad82020-07-22 17:02:09 -070096 <code><a href="#list">list(parent, pageSize=None, pageToken=None, responseView=None, x__xgafv=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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700132 &quot;scheduleTime&quot;: &quot;A String&quot;, # Required. The task&#x27;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 Kim65020912020-05-20 12:08:20 -0700161 <pre>Cancel a pull task&#x27;s lease.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700162
Bu Sun Kim65020912020-05-20 12:08:20 -0700163The worker can use this method to cancel a task&#x27;s lease by
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700164setting 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.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700176 &quot;scheduleTime&quot;: &quot;A String&quot;, # Required. The task&#x27;s current schedule time, available in the
177 # schedule_time returned by
178 # LeaseTasks response or
179 # RenewLease response. This restriction is
180 # to ensure that your worker currently holds the lease.
Bu Sun Kim65020912020-05-20 12:08:20 -0700181 &quot;responseView&quot;: &quot;A String&quot;, # The response_view specifies which subset of the Task will be
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700182 # 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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700204 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # App Engine HTTP request that is sent to the task&#x27;s target. Can
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700205 # be set only if
206 # app_engine_http_target is set
207 # on the queue.
208 #
209 # An App Engine task is a task that has AppEngineHttpRequest set.
210 #
211 # The message defines the HTTP request that is sent to an App Engine app when
212 # the task is dispatched.
213 #
214 # This proto can only be used for tasks in a queue which has
215 # app_engine_http_target set.
216 #
217 # Using AppEngineHttpRequest requires
218 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
219 # Google IAM permission for the project
220 # and the following scope:
221 #
222 # `https://www.googleapis.com/auth/cloud-platform`
223 #
224 # The task will be delivered to the App Engine app which belongs to the same
225 # project as the queue. For more information, see
226 # [How Requests are
227 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
228 # and how routing is affected by
229 # [dispatch
230 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
231 # Traffic is encrypted during transport and never leaves Google datacenters.
232 # Because this traffic is carried over a communication mechanism internal to
233 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
234 # The request to the handler, however, will appear to have used the HTTP
235 # protocol.
236 #
237 # The AppEngineRouting used to construct the URL that the task is
238 # delivered to can be set at the queue-level or task-level:
239 #
240 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -0700241 # app_engine_routing_override
242 # is used for all tasks in the queue, no matter what the setting
243 # is for the
244 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700245 #
246 #
247 # The `url` that the task will be sent to is:
248 #
249 # * `url =` host `+`
250 # relative_url
251 #
252 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
253 # URIs restricted with
254 # [`login:
255 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
256 # Because tasks are not run as any user, they cannot be dispatched to URIs
257 # restricted with
258 # [`login:
259 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
260 # Task dispatches also do not follow redirects.
261 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700262 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700263 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -0700264 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700265 # not receive response before the deadline. Failed
266 # tasks will be retried according to the
267 # retry configuration. `503` (Service Unavailable) is
268 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -0700269 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
270 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700271 # Requests) response from an app handler does not cause traffic congestion
272 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -0700273 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700274 #
275 # If set,
276 # app_engine_routing_override
277 # is used for all tasks in the queue, no matter what the setting is for the
278 # task-level app_engine_routing.
279 #
280 # Defines routing characteristics specific to App Engine - service, version,
281 # and instance.
282 #
283 # For more information about services, versions, and instances see
284 # [An Overview of App
285 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
286 # [Microservices Architecture on Google App
287 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
288 # [App Engine Standard request
289 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
290 # and [App Engine Flex request
291 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700292 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700293 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700294 # By default, the task is sent to the service which is the default
295 # service when the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700296 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700297 # For some queues or tasks which were created using the App Engine
298 # Task Queue API, host is not parsable
299 # into service,
300 # version, and
301 # instance. For example, some tasks
302 # which were created using the App Engine SDK use a custom domain
303 # name; custom domains are not parsed by Cloud Tasks. If
304 # host is not parsable, then
305 # service,
306 # version, and
307 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -0700308 &quot;version&quot;: &quot;A String&quot;, # App version.
309 #
310 # By default, the task is sent to the version which is the default
311 # version when the task is attempted.
312 #
313 # For some queues or tasks which were created using the App Engine
314 # Task Queue API, host is not parsable
315 # into service,
316 # version, and
317 # instance. For example, some tasks
318 # which were created using the App Engine SDK use a custom domain
319 # name; custom domains are not parsed by Cloud Tasks. If
320 # host is not parsable, then
321 # service,
322 # version, and
323 # instance are the empty string.
324 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700325 #
326 # For more information, see
327 # [How Requests are
328 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
329 #
330 # The host is constructed as:
331 #
332 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700333 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -0700334 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
335 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
336 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
337 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
338 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
339 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
340 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700341 #
342 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -0700343 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -0700344 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700345 # SDK use a custom domain name.
346 #
347 # * `service =` service
348 #
349 # * `version =` version
350 #
351 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700352 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700353 # service
354 #
355 # * `instance =` instance
356 #
357 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700358 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700359 # service
360 #
361 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700362 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700363 # version
364 #
365 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700366 # instance `+ &#x27;.&#x27; +`
367 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700368 # service
369 #
370 # If service is empty, then the task will be sent
371 # to the service which is the default service when the task is attempted.
372 #
373 # If version is empty, then the task will be sent
374 # to the version which is the default version when the task is attempted.
375 #
376 # If instance is empty, then the task
377 # will be sent to an instance which is available when the task is
378 # attempted.
379 #
380 # If service,
381 # version, or
382 # instance is invalid, then the task
383 # will be sent to the default version of the default service when
384 # the task is attempted.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700385 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700386 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700387 # By default, the task is sent to an instance which is available when
388 # the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700389 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700390 # Requests can only be sent to a specific instance if
391 # [manual scaling is used in App Engine
392 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
393 # App Engine Flex does not support instances. For more information, see
394 # [App Engine Standard request
395 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
396 # and [App Engine Flex request
397 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700398 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700399 &quot;headers&quot;: { # HTTP request headers.
400 #
401 # This map contains the header field names and values.
402 # Headers can be set when the
403 # task is created.
404 # Repeated headers are not supported but a header value can contain commas.
405 #
406 # Cloud Tasks sets some headers to default values:
407 #
408 # * `User-Agent`: By default, this header is
409 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
410 # This header can be modified, but Cloud Tasks will append
411 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
412 # modified `User-Agent`.
413 #
414 # If the task has a payload, Cloud
415 # Tasks sets the following headers:
416 #
417 # * `Content-Type`: By default, the `Content-Type` header is set to
418 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
419 # setting `Content-Type` to a particular media type when the
420 # task is created.
421 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
422 # * `Content-Length`: This is computed by Cloud Tasks. This value is
423 # output only. It cannot be changed.
424 #
425 # The headers below cannot be set or overridden:
426 #
427 # * `Host`
428 # * `X-Google-*`
429 # * `X-AppEngine-*`
430 #
431 # In addition, Cloud Tasks sets some headers when the task is dispatched,
432 # such as headers containing information about the task; see
433 # [request
434 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
435 # These headers are set only when the task is dispatched, so they are not
436 # visible when the task is returned in a Cloud Tasks response.
437 #
438 # Although there is no specific limit for the maximum number of headers or
439 # the size, there is a limit on the maximum size of the Task. For more
440 # information, see the CreateTask documentation.
441 &quot;a_key&quot;: &quot;A String&quot;,
442 },
443 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
444 #
445 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
446 # It can contain a path and query string arguments.
447 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
448 # No spaces are allowed, and the maximum length allowed is 2083 characters.
449 &quot;payload&quot;: &quot;A String&quot;, # Payload.
450 #
451 # The payload will be sent as the HTTP message body. A message
452 # body, and thus a payload, is allowed only if the HTTP method is
453 # POST or PUT. It is an error to set a data payload on a task with
454 # an incompatible HttpMethod.
455 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
456 #
457 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
458 # HTTP requests with this http_method, otherwise the task attempt fails with
459 # error code 405 (Method Not Allowed). See [Writing a push task request
460 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
461 # and the App Engine documentation for your runtime on [How Requests are
462 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700463 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700464 &quot;status&quot;: { # Status of the task. # Output only. The task status.
465 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
466 #
467 # This count includes attempts which have been dispatched but haven&#x27;t
468 # received a response.
469 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
470 #
471 # Only dispatch_time will be set.
472 # The other AttemptStatus information is not retained by Cloud Tasks.
473 #
474 # This field is not calculated for pull tasks.
475 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
476 #
477 # `dispatch_time` will be truncated to the nearest microsecond.
478 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
479 #
480 # If the task has not been attempted or the task is currently running
481 # then the response status is unset.
482 # different programming environments, including REST APIs and RPC APIs. It is
483 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
484 # three pieces of data: error code, error message, and error details.
485 #
486 # You can find out more about this error model and how to work with it in the
487 # [API Design Guide](https://cloud.google.com/apis/design/errors).
488 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
489 # user-facing error message should be localized and sent in the
490 # google.rpc.Status.details field, or localized by the client.
491 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
492 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
493 # message types for APIs to use.
494 {
495 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
496 },
497 ],
498 },
499 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
500 #
501 # `response_time` will be truncated to the nearest microsecond.
502 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
503 #
504 # `schedule_time` will be truncated to the nearest microsecond.
505 },
506 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
507 #
508 # This field is not calculated for pull tasks.
509 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
510 #
511 # `dispatch_time` will be truncated to the nearest microsecond.
512 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
513 #
514 # If the task has not been attempted or the task is currently running
515 # then the response status is unset.
516 # different programming environments, including REST APIs and RPC APIs. It is
517 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
518 # three pieces of data: error code, error message, and error details.
519 #
520 # You can find out more about this error model and how to work with it in the
521 # [API Design Guide](https://cloud.google.com/apis/design/errors).
522 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
523 # user-facing error message should be localized and sent in the
524 # google.rpc.Status.details field, or localized by the client.
525 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
526 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
527 # message types for APIs to use.
528 {
529 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
530 },
531 ],
532 },
533 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
534 #
535 # `response_time` will be truncated to the nearest microsecond.
536 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
537 #
538 # `schedule_time` will be truncated to the nearest microsecond.
539 },
540 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
541 #
542 # This field is not calculated for pull tasks.
543 },
544 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
545 #
546 # `create_time` will be truncated to the nearest second.
547 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
548 #
549 # The task name.
550 #
551 # The task name must have the following format:
552 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
553 #
554 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
555 # hyphens (-), colons (:), or periods (.).
556 # For more information, see
557 # [Identifying
558 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
559 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
560 # The list of available locations can be obtained by calling
561 # ListLocations.
562 # For more information, see https://cloud.google.com/about/locations/.
563 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
564 # hyphens (-). The maximum length is 100 characters.
565 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
566 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -0700567 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
568 # set only if pull_target is set on the queue.
569 #
570 # A pull task is a task that has PullMessage set.
571 # LeaseTasks to process the task.
572 #
573 # This proto can only be used for tasks in a queue which has
574 # pull_target set.
575 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
576 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
577 #
578 # Tags allow similar tasks to be processed in a batch. If you label
579 # tasks with a tag, your worker can
580 # lease tasks with the same tag using
581 # filter. For example, if you want to
582 # aggregate the events associated with a specific user once a day,
583 # you could tag tasks with the user ID.
584 #
585 # The task&#x27;s tag can only be set when the
586 # task is created.
587 #
588 # The tag must be less than 500 characters.
589 #
590 # SDK compatibility: Although the SDK allows tags to be either
591 # string or
592 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
593 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
594 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
595 },
596 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
597 #
598 # For App Engine queues, this is when the task will be attempted or retried.
599 #
600 # For pull queues, this is the time when the task is available to
601 # be leased; if a task is currently leased, this is the time when
602 # the current lease expires, that is, the time that the task was
603 # leased plus the lease_duration.
604 #
605 # `schedule_time` will be truncated to the nearest microsecond.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700606 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
607 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700608 }</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.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700630 &quot;responseView&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700642 &quot;task&quot;: { # 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
Bu Sun Kim65020912020-05-20 12:08:20 -0700657 # a task&#x27;s ID is identical to that of an existing task or a task
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700658 # that was deleted or completed recently then the call will fail
659 # with ALREADY_EXISTS.
Bu Sun Kim65020912020-05-20 12:08:20 -0700660 # If the task&#x27;s queue was created using Cloud Tasks, then another task with
661 # the same name can&#x27;t be created for ~1hour after the original task was
662 # deleted or completed. If the task&#x27;s queue was created using queue.yaml or
663 # queue.xml, then another task with the same name can&#x27;t be created
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700664 # 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.
Bu Sun Kim65020912020-05-20 12:08:20 -0700675 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # App Engine HTTP request that is sent to the task&#x27;s target. Can
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700676 # be set only if
677 # app_engine_http_target is set
678 # on the queue.
679 #
680 # An App Engine task is a task that has AppEngineHttpRequest set.
681 #
682 # The message defines the HTTP request that is sent to an App Engine app when
683 # the task is dispatched.
684 #
685 # This proto can only be used for tasks in a queue which has
686 # app_engine_http_target set.
687 #
688 # Using AppEngineHttpRequest requires
689 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
690 # Google IAM permission for the project
691 # and the following scope:
692 #
693 # `https://www.googleapis.com/auth/cloud-platform`
694 #
695 # The task will be delivered to the App Engine app which belongs to the same
696 # project as the queue. For more information, see
697 # [How Requests are
698 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
699 # and how routing is affected by
700 # [dispatch
701 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
702 # Traffic is encrypted during transport and never leaves Google datacenters.
703 # Because this traffic is carried over a communication mechanism internal to
704 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
705 # The request to the handler, however, will appear to have used the HTTP
706 # protocol.
707 #
708 # The AppEngineRouting used to construct the URL that the task is
709 # delivered to can be set at the queue-level or task-level:
710 #
711 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -0700712 # app_engine_routing_override
713 # is used for all tasks in the queue, no matter what the setting
714 # is for the
715 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700716 #
717 #
718 # The `url` that the task will be sent to is:
719 #
720 # * `url =` host `+`
721 # relative_url
722 #
723 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
724 # URIs restricted with
725 # [`login:
726 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
727 # Because tasks are not run as any user, they cannot be dispatched to URIs
728 # restricted with
729 # [`login:
730 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
731 # Task dispatches also do not follow redirects.
732 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700733 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700734 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -0700735 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700736 # not receive response before the deadline. Failed
737 # tasks will be retried according to the
738 # retry configuration. `503` (Service Unavailable) is
739 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -0700740 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
741 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700742 # Requests) response from an app handler does not cause traffic congestion
743 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -0700744 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700745 #
746 # If set,
747 # app_engine_routing_override
748 # is used for all tasks in the queue, no matter what the setting is for the
749 # task-level app_engine_routing.
750 #
751 # Defines routing characteristics specific to App Engine - service, version,
752 # and instance.
753 #
754 # For more information about services, versions, and instances see
755 # [An Overview of App
756 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
757 # [Microservices Architecture on Google App
758 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
759 # [App Engine Standard request
760 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
761 # and [App Engine Flex request
762 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700763 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700764 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700765 # By default, the task is sent to the service which is the default
766 # service when the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700767 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700768 # For some queues or tasks which were created using the App Engine
769 # Task Queue API, host is not parsable
770 # into service,
771 # version, and
772 # instance. For example, some tasks
773 # which were created using the App Engine SDK use a custom domain
774 # name; custom domains are not parsed by Cloud Tasks. If
775 # host is not parsable, then
776 # service,
777 # version, and
778 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -0700779 &quot;version&quot;: &quot;A String&quot;, # App version.
780 #
781 # By default, the task is sent to the version which is the default
782 # version when the task is attempted.
783 #
784 # For some queues or tasks which were created using the App Engine
785 # Task Queue API, host is not parsable
786 # into service,
787 # version, and
788 # instance. For example, some tasks
789 # which were created using the App Engine SDK use a custom domain
790 # name; custom domains are not parsed by Cloud Tasks. If
791 # host is not parsable, then
792 # service,
793 # version, and
794 # instance are the empty string.
795 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700796 #
797 # For more information, see
798 # [How Requests are
799 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
800 #
801 # The host is constructed as:
802 #
803 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700804 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -0700805 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
806 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
807 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
808 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
809 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
810 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
811 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700812 #
813 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -0700814 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -0700815 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700816 # SDK use a custom domain name.
817 #
818 # * `service =` service
819 #
820 # * `version =` version
821 #
822 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700823 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700824 # service
825 #
826 # * `instance =` instance
827 #
828 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700829 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700830 # service
831 #
832 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700833 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700834 # version
835 #
836 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700837 # instance `+ &#x27;.&#x27; +`
838 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700839 # service
840 #
841 # If service is empty, then the task will be sent
842 # to the service which is the default service when the task is attempted.
843 #
844 # If version is empty, then the task will be sent
845 # to the version which is the default version when the task is attempted.
846 #
847 # If instance is empty, then the task
848 # will be sent to an instance which is available when the task is
849 # attempted.
850 #
851 # If service,
852 # version, or
853 # instance is invalid, then the task
854 # will be sent to the default version of the default service when
855 # the task is attempted.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700856 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700857 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700858 # By default, the task is sent to an instance which is available when
859 # the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700860 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700861 # Requests can only be sent to a specific instance if
862 # [manual scaling is used in App Engine
863 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
864 # App Engine Flex does not support instances. For more information, see
865 # [App Engine Standard request
866 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
867 # and [App Engine Flex request
868 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700869 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700870 &quot;headers&quot;: { # HTTP request headers.
871 #
872 # This map contains the header field names and values.
873 # Headers can be set when the
874 # task is created.
875 # Repeated headers are not supported but a header value can contain commas.
876 #
877 # Cloud Tasks sets some headers to default values:
878 #
879 # * `User-Agent`: By default, this header is
880 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
881 # This header can be modified, but Cloud Tasks will append
882 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
883 # modified `User-Agent`.
884 #
885 # If the task has a payload, Cloud
886 # Tasks sets the following headers:
887 #
888 # * `Content-Type`: By default, the `Content-Type` header is set to
889 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
890 # setting `Content-Type` to a particular media type when the
891 # task is created.
892 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
893 # * `Content-Length`: This is computed by Cloud Tasks. This value is
894 # output only. It cannot be changed.
895 #
896 # The headers below cannot be set or overridden:
897 #
898 # * `Host`
899 # * `X-Google-*`
900 # * `X-AppEngine-*`
901 #
902 # In addition, Cloud Tasks sets some headers when the task is dispatched,
903 # such as headers containing information about the task; see
904 # [request
905 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
906 # These headers are set only when the task is dispatched, so they are not
907 # visible when the task is returned in a Cloud Tasks response.
908 #
909 # Although there is no specific limit for the maximum number of headers or
910 # the size, there is a limit on the maximum size of the Task. For more
911 # information, see the CreateTask documentation.
912 &quot;a_key&quot;: &quot;A String&quot;,
913 },
914 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
915 #
916 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
917 # It can contain a path and query string arguments.
918 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
919 # No spaces are allowed, and the maximum length allowed is 2083 characters.
920 &quot;payload&quot;: &quot;A String&quot;, # Payload.
921 #
922 # The payload will be sent as the HTTP message body. A message
923 # body, and thus a payload, is allowed only if the HTTP method is
924 # POST or PUT. It is an error to set a data payload on a task with
925 # an incompatible HttpMethod.
926 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
927 #
928 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
929 # HTTP requests with this http_method, otherwise the task attempt fails with
930 # error code 405 (Method Not Allowed). See [Writing a push task request
931 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
932 # and the App Engine documentation for your runtime on [How Requests are
933 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700934 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700935 &quot;status&quot;: { # Status of the task. # Output only. The task status.
936 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
937 #
938 # This count includes attempts which have been dispatched but haven&#x27;t
939 # received a response.
940 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
941 #
942 # Only dispatch_time will be set.
943 # The other AttemptStatus information is not retained by Cloud Tasks.
944 #
945 # This field is not calculated for pull tasks.
946 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
947 #
948 # `dispatch_time` will be truncated to the nearest microsecond.
949 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
950 #
951 # If the task has not been attempted or the task is currently running
952 # then the response status is unset.
953 # different programming environments, including REST APIs and RPC APIs. It is
954 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
955 # three pieces of data: error code, error message, and error details.
956 #
957 # You can find out more about this error model and how to work with it in the
958 # [API Design Guide](https://cloud.google.com/apis/design/errors).
959 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
960 # user-facing error message should be localized and sent in the
961 # google.rpc.Status.details field, or localized by the client.
962 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
963 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
964 # message types for APIs to use.
965 {
966 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
967 },
968 ],
969 },
970 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
971 #
972 # `response_time` will be truncated to the nearest microsecond.
973 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
974 #
975 # `schedule_time` will be truncated to the nearest microsecond.
976 },
977 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
978 #
979 # This field is not calculated for pull tasks.
980 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
981 #
982 # `dispatch_time` will be truncated to the nearest microsecond.
983 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
984 #
985 # If the task has not been attempted or the task is currently running
986 # then the response status is unset.
987 # different programming environments, including REST APIs and RPC APIs. It is
988 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
989 # three pieces of data: error code, error message, and error details.
990 #
991 # You can find out more about this error model and how to work with it in the
992 # [API Design Guide](https://cloud.google.com/apis/design/errors).
993 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
994 # user-facing error message should be localized and sent in the
995 # google.rpc.Status.details field, or localized by the client.
996 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
997 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
998 # message types for APIs to use.
999 {
1000 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1001 },
1002 ],
1003 },
1004 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1005 #
1006 # `response_time` will be truncated to the nearest microsecond.
1007 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1008 #
1009 # `schedule_time` will be truncated to the nearest microsecond.
1010 },
1011 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
1012 #
1013 # This field is not calculated for pull tasks.
1014 },
1015 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
1016 #
1017 # `create_time` will be truncated to the nearest second.
1018 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
1019 #
1020 # The task name.
1021 #
1022 # The task name must have the following format:
1023 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1024 #
1025 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1026 # hyphens (-), colons (:), or periods (.).
1027 # For more information, see
1028 # [Identifying
1029 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1030 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
1031 # The list of available locations can be obtained by calling
1032 # ListLocations.
1033 # For more information, see https://cloud.google.com/about/locations/.
1034 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1035 # hyphens (-). The maximum length is 100 characters.
1036 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1037 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07001038 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
1039 # set only if pull_target is set on the queue.
1040 #
1041 # A pull task is a task that has PullMessage set.
1042 # LeaseTasks to process the task.
1043 #
1044 # This proto can only be used for tasks in a queue which has
1045 # pull_target set.
1046 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
1047 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
1048 #
1049 # Tags allow similar tasks to be processed in a batch. If you label
1050 # tasks with a tag, your worker can
1051 # lease tasks with the same tag using
1052 # filter. For example, if you want to
1053 # aggregate the events associated with a specific user once a day,
1054 # you could tag tasks with the user ID.
1055 #
1056 # The task&#x27;s tag can only be set when the
1057 # task is created.
1058 #
1059 # The tag must be less than 500 characters.
1060 #
1061 # SDK compatibility: Although the SDK allows tags to be either
1062 # string or
1063 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
1064 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
1065 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
1066 },
1067 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
1068 #
1069 # For App Engine queues, this is when the task will be attempted or retried.
1070 #
1071 # For pull queues, this is the time when the task is available to
1072 # be leased; if a task is currently leased, this is the time when
1073 # the current lease expires, that is, the time that the task was
1074 # leased plus the lease_duration.
1075 #
1076 # `schedule_time` will be truncated to the nearest microsecond.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001077 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
1078 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001079 },
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.
Bu Sun Kim65020912020-05-20 12:08:20 -07001091 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # App Engine HTTP request that is sent to the task&#x27;s target. Can
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001092 # be set only if
1093 # app_engine_http_target is set
1094 # on the queue.
1095 #
1096 # An App Engine task is a task that has AppEngineHttpRequest set.
1097 #
1098 # The message defines the HTTP request that is sent to an App Engine app when
1099 # the task is dispatched.
1100 #
1101 # This proto can only be used for tasks in a queue which has
1102 # app_engine_http_target set.
1103 #
1104 # Using AppEngineHttpRequest requires
1105 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1106 # Google IAM permission for the project
1107 # and the following scope:
1108 #
1109 # `https://www.googleapis.com/auth/cloud-platform`
1110 #
1111 # The task will be delivered to the App Engine app which belongs to the same
1112 # project as the queue. For more information, see
1113 # [How Requests are
1114 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1115 # and how routing is affected by
1116 # [dispatch
1117 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
1118 # Traffic is encrypted during transport and never leaves Google datacenters.
1119 # Because this traffic is carried over a communication mechanism internal to
1120 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
1121 # The request to the handler, however, will appear to have used the HTTP
1122 # protocol.
1123 #
1124 # The AppEngineRouting used to construct the URL that the task is
1125 # delivered to can be set at the queue-level or task-level:
1126 #
1127 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07001128 # app_engine_routing_override
1129 # is used for all tasks in the queue, no matter what the setting
1130 # is for the
1131 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001132 #
1133 #
1134 # The `url` that the task will be sent to is:
1135 #
1136 # * `url =` host `+`
1137 # relative_url
1138 #
1139 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
1140 # URIs restricted with
1141 # [`login:
1142 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
1143 # Because tasks are not run as any user, they cannot be dispatched to URIs
1144 # restricted with
1145 # [`login:
1146 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
1147 # Task dispatches also do not follow redirects.
1148 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001149 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001150 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07001151 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001152 # not receive response before the deadline. Failed
1153 # tasks will be retried according to the
1154 # retry configuration. `503` (Service Unavailable) is
1155 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07001156 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
1157 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001158 # Requests) response from an app handler does not cause traffic congestion
1159 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -07001160 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001161 #
1162 # If set,
1163 # app_engine_routing_override
1164 # is used for all tasks in the queue, no matter what the setting is for the
1165 # task-level app_engine_routing.
1166 #
1167 # Defines routing characteristics specific to App Engine - service, version,
1168 # and instance.
1169 #
1170 # For more information about services, versions, and instances see
1171 # [An Overview of App
1172 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
1173 # [Microservices Architecture on Google App
1174 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
1175 # [App Engine Standard request
1176 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
1177 # and [App Engine Flex request
1178 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001179 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001180 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001181 # By default, the task is sent to the service which is the default
1182 # service when the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001183 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001184 # For some queues or tasks which were created using the App Engine
1185 # Task Queue API, host is not parsable
1186 # into service,
1187 # version, and
1188 # instance. For example, some tasks
1189 # which were created using the App Engine SDK use a custom domain
1190 # name; custom domains are not parsed by Cloud Tasks. If
1191 # host is not parsable, then
1192 # service,
1193 # version, and
1194 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -07001195 &quot;version&quot;: &quot;A String&quot;, # App version.
1196 #
1197 # By default, the task is sent to the version which is the default
1198 # version when the task is attempted.
1199 #
1200 # For some queues or tasks which were created using the App Engine
1201 # Task Queue API, host is not parsable
1202 # into service,
1203 # version, and
1204 # instance. For example, some tasks
1205 # which were created using the App Engine SDK use a custom domain
1206 # name; custom domains are not parsed by Cloud Tasks. If
1207 # host is not parsable, then
1208 # service,
1209 # version, and
1210 # instance are the empty string.
1211 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001212 #
1213 # For more information, see
1214 # [How Requests are
1215 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
1216 #
1217 # The host is constructed as:
1218 #
1219 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001220 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07001221 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1222 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1223 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1224 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1225 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1226 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1227 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001228 #
1229 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07001230 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07001231 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001232 # SDK use a custom domain name.
1233 #
1234 # * `service =` service
1235 #
1236 # * `version =` version
1237 #
1238 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001239 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001240 # service
1241 #
1242 # * `instance =` instance
1243 #
1244 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001245 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001246 # service
1247 #
1248 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001249 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001250 # version
1251 #
1252 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001253 # instance `+ &#x27;.&#x27; +`
1254 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001255 # service
1256 #
1257 # If service is empty, then the task will be sent
1258 # to the service which is the default service when the task is attempted.
1259 #
1260 # If version is empty, then the task will be sent
1261 # to the version which is the default version when the task is attempted.
1262 #
1263 # If instance is empty, then the task
1264 # will be sent to an instance which is available when the task is
1265 # attempted.
1266 #
1267 # If service,
1268 # version, or
1269 # instance is invalid, then the task
1270 # will be sent to the default version of the default service when
1271 # the task is attempted.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001272 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001273 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001274 # By default, the task is sent to an instance which is available when
1275 # the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001276 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001277 # Requests can only be sent to a specific instance if
1278 # [manual scaling is used in App Engine
1279 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
1280 # App Engine Flex does not support instances. For more information, see
1281 # [App Engine Standard request
1282 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1283 # and [App Engine Flex request
1284 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001285 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001286 &quot;headers&quot;: { # HTTP request headers.
1287 #
1288 # This map contains the header field names and values.
1289 # Headers can be set when the
1290 # task is created.
1291 # Repeated headers are not supported but a header value can contain commas.
1292 #
1293 # Cloud Tasks sets some headers to default values:
1294 #
1295 # * `User-Agent`: By default, this header is
1296 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
1297 # This header can be modified, but Cloud Tasks will append
1298 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
1299 # modified `User-Agent`.
1300 #
1301 # If the task has a payload, Cloud
1302 # Tasks sets the following headers:
1303 #
1304 # * `Content-Type`: By default, the `Content-Type` header is set to
1305 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
1306 # setting `Content-Type` to a particular media type when the
1307 # task is created.
1308 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
1309 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1310 # output only. It cannot be changed.
1311 #
1312 # The headers below cannot be set or overridden:
1313 #
1314 # * `Host`
1315 # * `X-Google-*`
1316 # * `X-AppEngine-*`
1317 #
1318 # In addition, Cloud Tasks sets some headers when the task is dispatched,
1319 # such as headers containing information about the task; see
1320 # [request
1321 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
1322 # These headers are set only when the task is dispatched, so they are not
1323 # visible when the task is returned in a Cloud Tasks response.
1324 #
1325 # Although there is no specific limit for the maximum number of headers or
1326 # the size, there is a limit on the maximum size of the Task. For more
1327 # information, see the CreateTask documentation.
1328 &quot;a_key&quot;: &quot;A String&quot;,
1329 },
1330 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
1331 #
1332 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
1333 # It can contain a path and query string arguments.
1334 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
1335 # No spaces are allowed, and the maximum length allowed is 2083 characters.
1336 &quot;payload&quot;: &quot;A String&quot;, # Payload.
1337 #
1338 # The payload will be sent as the HTTP message body. A message
1339 # body, and thus a payload, is allowed only if the HTTP method is
1340 # POST or PUT. It is an error to set a data payload on a task with
1341 # an incompatible HttpMethod.
1342 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
1343 #
1344 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
1345 # HTTP requests with this http_method, otherwise the task attempt fails with
1346 # error code 405 (Method Not Allowed). See [Writing a push task request
1347 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
1348 # and the App Engine documentation for your runtime on [How Requests are
1349 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001350 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001351 &quot;status&quot;: { # Status of the task. # Output only. The task status.
1352 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
1353 #
1354 # This count includes attempts which have been dispatched but haven&#x27;t
1355 # received a response.
1356 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
1357 #
1358 # Only dispatch_time will be set.
1359 # The other AttemptStatus information is not retained by Cloud Tasks.
1360 #
1361 # This field is not calculated for pull tasks.
1362 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1363 #
1364 # `dispatch_time` will be truncated to the nearest microsecond.
1365 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
1366 #
1367 # If the task has not been attempted or the task is currently running
1368 # then the response status is unset.
1369 # different programming environments, including REST APIs and RPC APIs. It is
1370 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1371 # three pieces of data: error code, error message, and error details.
1372 #
1373 # You can find out more about this error model and how to work with it in the
1374 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1375 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1376 # user-facing error message should be localized and sent in the
1377 # google.rpc.Status.details field, or localized by the client.
1378 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1379 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1380 # message types for APIs to use.
1381 {
1382 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1383 },
1384 ],
1385 },
1386 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1387 #
1388 # `response_time` will be truncated to the nearest microsecond.
1389 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1390 #
1391 # `schedule_time` will be truncated to the nearest microsecond.
1392 },
1393 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
1394 #
1395 # This field is not calculated for pull tasks.
1396 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1397 #
1398 # `dispatch_time` will be truncated to the nearest microsecond.
1399 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
1400 #
1401 # If the task has not been attempted or the task is currently running
1402 # then the response status is unset.
1403 # different programming environments, including REST APIs and RPC APIs. It is
1404 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1405 # three pieces of data: error code, error message, and error details.
1406 #
1407 # You can find out more about this error model and how to work with it in the
1408 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1409 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1410 # user-facing error message should be localized and sent in the
1411 # google.rpc.Status.details field, or localized by the client.
1412 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1413 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1414 # message types for APIs to use.
1415 {
1416 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1417 },
1418 ],
1419 },
1420 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1421 #
1422 # `response_time` will be truncated to the nearest microsecond.
1423 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1424 #
1425 # `schedule_time` will be truncated to the nearest microsecond.
1426 },
1427 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
1428 #
1429 # This field is not calculated for pull tasks.
1430 },
1431 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
1432 #
1433 # `create_time` will be truncated to the nearest second.
1434 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
1435 #
1436 # The task name.
1437 #
1438 # The task name must have the following format:
1439 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1440 #
1441 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1442 # hyphens (-), colons (:), or periods (.).
1443 # For more information, see
1444 # [Identifying
1445 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1446 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
1447 # The list of available locations can be obtained by calling
1448 # ListLocations.
1449 # For more information, see https://cloud.google.com/about/locations/.
1450 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1451 # hyphens (-). The maximum length is 100 characters.
1452 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1453 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07001454 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
1455 # set only if pull_target is set on the queue.
1456 #
1457 # A pull task is a task that has PullMessage set.
1458 # LeaseTasks to process the task.
1459 #
1460 # This proto can only be used for tasks in a queue which has
1461 # pull_target set.
1462 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
1463 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
1464 #
1465 # Tags allow similar tasks to be processed in a batch. If you label
1466 # tasks with a tag, your worker can
1467 # lease tasks with the same tag using
1468 # filter. For example, if you want to
1469 # aggregate the events associated with a specific user once a day,
1470 # you could tag tasks with the user ID.
1471 #
1472 # The task&#x27;s tag can only be set when the
1473 # task is created.
1474 #
1475 # The tag must be less than 500 characters.
1476 #
1477 # SDK compatibility: Although the SDK allows tags to be either
1478 # string or
1479 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
1480 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
1481 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
1482 },
1483 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
1484 #
1485 # For App Engine queues, this is when the task will be attempted or retried.
1486 #
1487 # For pull queues, this is the time when the task is available to
1488 # be leased; if a task is currently leased, this is the time when
1489 # the current lease expires, that is, the time that the task was
1490 # leased plus the lease_duration.
1491 #
1492 # `schedule_time` will be truncated to the nearest microsecond.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001493 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
1494 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001495 }</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.
Bu Sun Kim65020912020-05-20 12:08:20 -07001557 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # App Engine HTTP request that is sent to the task&#x27;s target. Can
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001558 # be set only if
1559 # app_engine_http_target is set
1560 # on the queue.
1561 #
1562 # An App Engine task is a task that has AppEngineHttpRequest set.
1563 #
1564 # The message defines the HTTP request that is sent to an App Engine app when
1565 # the task is dispatched.
1566 #
1567 # This proto can only be used for tasks in a queue which has
1568 # app_engine_http_target set.
1569 #
1570 # Using AppEngineHttpRequest requires
1571 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1572 # Google IAM permission for the project
1573 # and the following scope:
1574 #
1575 # `https://www.googleapis.com/auth/cloud-platform`
1576 #
1577 # The task will be delivered to the App Engine app which belongs to the same
1578 # project as the queue. For more information, see
1579 # [How Requests are
1580 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1581 # and how routing is affected by
1582 # [dispatch
1583 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
1584 # Traffic is encrypted during transport and never leaves Google datacenters.
1585 # Because this traffic is carried over a communication mechanism internal to
1586 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
1587 # The request to the handler, however, will appear to have used the HTTP
1588 # protocol.
1589 #
1590 # The AppEngineRouting used to construct the URL that the task is
1591 # delivered to can be set at the queue-level or task-level:
1592 #
1593 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07001594 # app_engine_routing_override
1595 # is used for all tasks in the queue, no matter what the setting
1596 # is for the
1597 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001598 #
1599 #
1600 # The `url` that the task will be sent to is:
1601 #
1602 # * `url =` host `+`
1603 # relative_url
1604 #
1605 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
1606 # URIs restricted with
1607 # [`login:
1608 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
1609 # Because tasks are not run as any user, they cannot be dispatched to URIs
1610 # restricted with
1611 # [`login:
1612 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
1613 # Task dispatches also do not follow redirects.
1614 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001615 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001616 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07001617 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001618 # not receive response before the deadline. Failed
1619 # tasks will be retried according to the
1620 # retry configuration. `503` (Service Unavailable) is
1621 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07001622 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
1623 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001624 # Requests) response from an app handler does not cause traffic congestion
1625 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -07001626 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001627 #
1628 # If set,
1629 # app_engine_routing_override
1630 # is used for all tasks in the queue, no matter what the setting is for the
1631 # task-level app_engine_routing.
1632 #
1633 # Defines routing characteristics specific to App Engine - service, version,
1634 # and instance.
1635 #
1636 # For more information about services, versions, and instances see
1637 # [An Overview of App
1638 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
1639 # [Microservices Architecture on Google App
1640 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
1641 # [App Engine Standard request
1642 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
1643 # and [App Engine Flex request
1644 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001645 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001646 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001647 # By default, the task is sent to the service which is the default
1648 # service when the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001649 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001650 # For some queues or tasks which were created using the App Engine
1651 # Task Queue API, host is not parsable
1652 # into service,
1653 # version, and
1654 # instance. For example, some tasks
1655 # which were created using the App Engine SDK use a custom domain
1656 # name; custom domains are not parsed by Cloud Tasks. If
1657 # host is not parsable, then
1658 # service,
1659 # version, and
1660 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -07001661 &quot;version&quot;: &quot;A String&quot;, # App version.
1662 #
1663 # By default, the task is sent to the version which is the default
1664 # version when the task is attempted.
1665 #
1666 # For some queues or tasks which were created using the App Engine
1667 # Task Queue API, host is not parsable
1668 # into service,
1669 # version, and
1670 # instance. For example, some tasks
1671 # which were created using the App Engine SDK use a custom domain
1672 # name; custom domains are not parsed by Cloud Tasks. If
1673 # host is not parsable, then
1674 # service,
1675 # version, and
1676 # instance are the empty string.
1677 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001678 #
1679 # For more information, see
1680 # [How Requests are
1681 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
1682 #
1683 # The host is constructed as:
1684 #
1685 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001686 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07001687 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1688 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1689 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1690 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1691 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1692 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1693 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001694 #
1695 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07001696 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07001697 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001698 # SDK use a custom domain name.
1699 #
1700 # * `service =` service
1701 #
1702 # * `version =` version
1703 #
1704 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001705 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001706 # service
1707 #
1708 # * `instance =` instance
1709 #
1710 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001711 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001712 # service
1713 #
1714 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001715 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001716 # version
1717 #
1718 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001719 # instance `+ &#x27;.&#x27; +`
1720 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001721 # service
1722 #
1723 # If service is empty, then the task will be sent
1724 # to the service which is the default service when the task is attempted.
1725 #
1726 # If version is empty, then the task will be sent
1727 # to the version which is the default version when the task is attempted.
1728 #
1729 # If instance is empty, then the task
1730 # will be sent to an instance which is available when the task is
1731 # attempted.
1732 #
1733 # If service,
1734 # version, or
1735 # instance is invalid, then the task
1736 # will be sent to the default version of the default service when
1737 # the task is attempted.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001738 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001739 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001740 # By default, the task is sent to an instance which is available when
1741 # the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001742 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001743 # Requests can only be sent to a specific instance if
1744 # [manual scaling is used in App Engine
1745 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
1746 # App Engine Flex does not support instances. For more information, see
1747 # [App Engine Standard request
1748 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1749 # and [App Engine Flex request
1750 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001751 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001752 &quot;headers&quot;: { # HTTP request headers.
1753 #
1754 # This map contains the header field names and values.
1755 # Headers can be set when the
1756 # task is created.
1757 # Repeated headers are not supported but a header value can contain commas.
1758 #
1759 # Cloud Tasks sets some headers to default values:
1760 #
1761 # * `User-Agent`: By default, this header is
1762 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
1763 # This header can be modified, but Cloud Tasks will append
1764 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
1765 # modified `User-Agent`.
1766 #
1767 # If the task has a payload, Cloud
1768 # Tasks sets the following headers:
1769 #
1770 # * `Content-Type`: By default, the `Content-Type` header is set to
1771 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
1772 # setting `Content-Type` to a particular media type when the
1773 # task is created.
1774 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
1775 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1776 # output only. It cannot be changed.
1777 #
1778 # The headers below cannot be set or overridden:
1779 #
1780 # * `Host`
1781 # * `X-Google-*`
1782 # * `X-AppEngine-*`
1783 #
1784 # In addition, Cloud Tasks sets some headers when the task is dispatched,
1785 # such as headers containing information about the task; see
1786 # [request
1787 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
1788 # These headers are set only when the task is dispatched, so they are not
1789 # visible when the task is returned in a Cloud Tasks response.
1790 #
1791 # Although there is no specific limit for the maximum number of headers or
1792 # the size, there is a limit on the maximum size of the Task. For more
1793 # information, see the CreateTask documentation.
1794 &quot;a_key&quot;: &quot;A String&quot;,
1795 },
1796 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
1797 #
1798 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
1799 # It can contain a path and query string arguments.
1800 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
1801 # No spaces are allowed, and the maximum length allowed is 2083 characters.
1802 &quot;payload&quot;: &quot;A String&quot;, # Payload.
1803 #
1804 # The payload will be sent as the HTTP message body. A message
1805 # body, and thus a payload, is allowed only if the HTTP method is
1806 # POST or PUT. It is an error to set a data payload on a task with
1807 # an incompatible HttpMethod.
1808 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
1809 #
1810 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
1811 # HTTP requests with this http_method, otherwise the task attempt fails with
1812 # error code 405 (Method Not Allowed). See [Writing a push task request
1813 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
1814 # and the App Engine documentation for your runtime on [How Requests are
1815 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001816 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001817 &quot;status&quot;: { # Status of the task. # Output only. The task status.
1818 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
1819 #
1820 # This count includes attempts which have been dispatched but haven&#x27;t
1821 # received a response.
1822 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
1823 #
1824 # Only dispatch_time will be set.
1825 # The other AttemptStatus information is not retained by Cloud Tasks.
1826 #
1827 # This field is not calculated for pull tasks.
1828 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1829 #
1830 # `dispatch_time` will be truncated to the nearest microsecond.
1831 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
1832 #
1833 # If the task has not been attempted or the task is currently running
1834 # then the response status is unset.
1835 # different programming environments, including REST APIs and RPC APIs. It is
1836 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1837 # three pieces of data: error code, error message, and error details.
1838 #
1839 # You can find out more about this error model and how to work with it in the
1840 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1841 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1842 # user-facing error message should be localized and sent in the
1843 # google.rpc.Status.details field, or localized by the client.
1844 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1845 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1846 # message types for APIs to use.
1847 {
1848 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1849 },
1850 ],
1851 },
1852 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1853 #
1854 # `response_time` will be truncated to the nearest microsecond.
1855 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1856 #
1857 # `schedule_time` will be truncated to the nearest microsecond.
1858 },
1859 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
1860 #
1861 # This field is not calculated for pull tasks.
1862 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1863 #
1864 # `dispatch_time` will be truncated to the nearest microsecond.
1865 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
1866 #
1867 # If the task has not been attempted or the task is currently running
1868 # then the response status is unset.
1869 # different programming environments, including REST APIs and RPC APIs. It is
1870 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1871 # three pieces of data: error code, error message, and error details.
1872 #
1873 # You can find out more about this error model and how to work with it in the
1874 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1875 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1876 # user-facing error message should be localized and sent in the
1877 # google.rpc.Status.details field, or localized by the client.
1878 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1879 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1880 # message types for APIs to use.
1881 {
1882 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1883 },
1884 ],
1885 },
1886 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1887 #
1888 # `response_time` will be truncated to the nearest microsecond.
1889 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1890 #
1891 # `schedule_time` will be truncated to the nearest microsecond.
1892 },
1893 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
1894 #
1895 # This field is not calculated for pull tasks.
1896 },
1897 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
1898 #
1899 # `create_time` will be truncated to the nearest second.
1900 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
1901 #
1902 # The task name.
1903 #
1904 # The task name must have the following format:
1905 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1906 #
1907 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1908 # hyphens (-), colons (:), or periods (.).
1909 # For more information, see
1910 # [Identifying
1911 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1912 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
1913 # The list of available locations can be obtained by calling
1914 # ListLocations.
1915 # For more information, see https://cloud.google.com/about/locations/.
1916 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1917 # hyphens (-). The maximum length is 100 characters.
1918 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1919 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07001920 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
1921 # set only if pull_target is set on the queue.
1922 #
1923 # A pull task is a task that has PullMessage set.
1924 # LeaseTasks to process the task.
1925 #
1926 # This proto can only be used for tasks in a queue which has
1927 # pull_target set.
1928 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
1929 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
1930 #
1931 # Tags allow similar tasks to be processed in a batch. If you label
1932 # tasks with a tag, your worker can
1933 # lease tasks with the same tag using
1934 # filter. For example, if you want to
1935 # aggregate the events associated with a specific user once a day,
1936 # you could tag tasks with the user ID.
1937 #
1938 # The task&#x27;s tag can only be set when the
1939 # task is created.
1940 #
1941 # The tag must be less than 500 characters.
1942 #
1943 # SDK compatibility: Although the SDK allows tags to be either
1944 # string or
1945 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
1946 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
1947 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
1948 },
1949 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
1950 #
1951 # For App Engine queues, this is when the task will be attempted or retried.
1952 #
1953 # For pull queues, this is the time when the task is available to
1954 # be leased; if a task is currently leased, this is the time when
1955 # the current lease expires, that is, the time that the task was
1956 # leased plus the lease_duration.
1957 #
1958 # `schedule_time` will be truncated to the nearest microsecond.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07001959 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
1960 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001961 }</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 Kim4ed7d3f2020-05-27 12:20:54 -07001996 &quot;responseView&quot;: &quot;A String&quot;, # The response_view specifies which subset of the Task will be
1997 # returned.
1998 #
1999 # By default response_view is BASIC; not all
2000 # information is retrieved by default because some data, such as
2001 # payloads, might be desirable to return only when needed because
2002 # of its large size or because of the sensitivity of data that it
2003 # contains.
2004 #
2005 # Authorization for FULL requires
2006 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
2007 # permission on the Task resource.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002008 &quot;leaseDuration&quot;: &quot;A String&quot;, # Required. The duration of the lease.
2009 #
2010 # Each task returned in the response will
2011 # have its schedule_time set to the current
2012 # time plus the `lease_duration`. The task is leased until its
2013 # schedule_time; thus, the task will not be
2014 # returned to another LeaseTasks call
2015 # before its schedule_time.
2016 #
2017 #
2018 # After the worker has successfully finished the work associated
2019 # with the task, the worker must call via
2020 # AcknowledgeTask before the
2021 # schedule_time. Otherwise the task will be
2022 # returned to a later LeaseTasks call so
2023 # that another worker can retry it.
2024 #
2025 # The maximum lease duration is 1 week.
2026 # `lease_duration` will be truncated to the nearest second.
2027 &quot;maxTasks&quot;: 42, # The maximum number of tasks to lease.
2028 #
2029 # The system will make a best effort to return as close to as
2030 # `max_tasks` as possible.
2031 #
2032 # The largest that `max_tasks` can be is 1000.
2033 #
2034 # The maximum total size of a lease tasks response is
2035 # 32 MB. If the sum of all task sizes requested reaches this limit,
2036 # fewer tasks than requested are returned.
Bu Sun Kim65020912020-05-20 12:08:20 -07002037 &quot;filter&quot;: &quot;A String&quot;, # `filter` can be used to specify a subset of tasks to lease.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002038 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002039 # When `filter` is set to `tag=&lt;my-tag&gt;` then the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002040 # response will contain only tasks whose
Dan O'Mearadd494642020-05-01 07:42:23 -07002041 # tag is equal to `&lt;my-tag&gt;`. `&lt;my-tag&gt;` must be
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002042 # less than 500 characters.
2043 #
2044 # When `filter` is set to `tag_function=oldest_tag()`, only tasks which have
2045 # the same tag as the task with the oldest
2046 # schedule_time will be returned.
2047 #
2048 # Grammar Syntax:
2049 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002050 # * `filter = &quot;tag=&quot; tag | &quot;tag_function=&quot; function`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002051 #
2052 # * `tag = string`
2053 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002054 # * `function = &quot;oldest_tag()&quot;`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002055 #
2056 # The `oldest_tag()` function returns tasks which have the same tag as the
2057 # oldest task (ordered by schedule time).
2058 #
2059 # SDK compatibility: Although the SDK allows tags to be either
2060 # string or
2061 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
2062 # only UTF-8 encoded tags can be used in Cloud Tasks. Tag which
Bu Sun Kim65020912020-05-20 12:08:20 -07002063 # aren&#x27;t UTF-8 encoded can&#x27;t be used in the
2064 # filter and the task&#x27;s
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002065 # tag will be displayed as empty in Cloud Tasks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002066 }
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.
Bu Sun Kim65020912020-05-20 12:08:20 -07002077 &quot;tasks&quot;: [ # The leased tasks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002078 { # A unit of scheduled work.
Bu Sun Kim65020912020-05-20 12:08:20 -07002079 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # App Engine HTTP request that is sent to the task&#x27;s target. Can
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002080 # be set only if
2081 # app_engine_http_target is set
2082 # on the queue.
2083 #
2084 # An App Engine task is a task that has AppEngineHttpRequest set.
2085 #
2086 # The message defines the HTTP request that is sent to an App Engine app when
2087 # the task is dispatched.
2088 #
2089 # This proto can only be used for tasks in a queue which has
2090 # app_engine_http_target set.
2091 #
2092 # Using AppEngineHttpRequest requires
2093 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
2094 # Google IAM permission for the project
2095 # and the following scope:
2096 #
2097 # `https://www.googleapis.com/auth/cloud-platform`
2098 #
2099 # The task will be delivered to the App Engine app which belongs to the same
2100 # project as the queue. For more information, see
2101 # [How Requests are
2102 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2103 # and how routing is affected by
2104 # [dispatch
2105 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
2106 # Traffic is encrypted during transport and never leaves Google datacenters.
2107 # Because this traffic is carried over a communication mechanism internal to
2108 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
2109 # The request to the handler, however, will appear to have used the HTTP
2110 # protocol.
2111 #
2112 # The AppEngineRouting used to construct the URL that the task is
2113 # delivered to can be set at the queue-level or task-level:
2114 #
2115 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07002116 # app_engine_routing_override
2117 # is used for all tasks in the queue, no matter what the setting
2118 # is for the
2119 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002120 #
2121 #
2122 # The `url` that the task will be sent to is:
2123 #
2124 # * `url =` host `+`
2125 # relative_url
2126 #
2127 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
2128 # URIs restricted with
2129 # [`login:
2130 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
2131 # Because tasks are not run as any user, they cannot be dispatched to URIs
2132 # restricted with
2133 # [`login:
2134 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
2135 # Task dispatches also do not follow redirects.
2136 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002137 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002138 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07002139 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002140 # not receive response before the deadline. Failed
2141 # tasks will be retried according to the
2142 # retry configuration. `503` (Service Unavailable) is
2143 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07002144 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
2145 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002146 # Requests) response from an app handler does not cause traffic congestion
2147 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -07002148 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002149 #
2150 # If set,
2151 # app_engine_routing_override
2152 # is used for all tasks in the queue, no matter what the setting is for the
2153 # task-level app_engine_routing.
2154 #
2155 # Defines routing characteristics specific to App Engine - service, version,
2156 # and instance.
2157 #
2158 # For more information about services, versions, and instances see
2159 # [An Overview of App
2160 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
2161 # [Microservices Architecture on Google App
2162 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
2163 # [App Engine Standard request
2164 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
2165 # and [App Engine Flex request
2166 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002167 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002168 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002169 # By default, the task is sent to the service which is the default
2170 # service when the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002171 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002172 # For some queues or tasks which were created using the App Engine
2173 # Task Queue API, host is not parsable
2174 # into service,
2175 # version, and
2176 # instance. For example, some tasks
2177 # which were created using the App Engine SDK use a custom domain
2178 # name; custom domains are not parsed by Cloud Tasks. If
2179 # host is not parsable, then
2180 # service,
2181 # version, and
2182 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -07002183 &quot;version&quot;: &quot;A String&quot;, # App version.
2184 #
2185 # By default, the task is sent to the version which is the default
2186 # version when the task is attempted.
2187 #
2188 # For some queues or tasks which were created using the App Engine
2189 # Task Queue API, host is not parsable
2190 # into service,
2191 # version, and
2192 # instance. For example, some tasks
2193 # which were created using the App Engine SDK use a custom domain
2194 # name; custom domains are not parsed by Cloud Tasks. If
2195 # host is not parsable, then
2196 # service,
2197 # version, and
2198 # instance are the empty string.
2199 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002200 #
2201 # For more information, see
2202 # [How Requests are
2203 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
2204 #
2205 # The host is constructed as:
2206 #
2207 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002208 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07002209 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2210 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2211 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2212 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2213 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2214 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2215 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002216 #
2217 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07002218 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07002219 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002220 # SDK use a custom domain name.
2221 #
2222 # * `service =` service
2223 #
2224 # * `version =` version
2225 #
2226 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002227 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002228 # service
2229 #
2230 # * `instance =` instance
2231 #
2232 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002233 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002234 # service
2235 #
2236 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002237 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002238 # version
2239 #
2240 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002241 # instance `+ &#x27;.&#x27; +`
2242 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002243 # service
2244 #
2245 # If service is empty, then the task will be sent
2246 # to the service which is the default service when the task is attempted.
2247 #
2248 # If version is empty, then the task will be sent
2249 # to the version which is the default version when the task is attempted.
2250 #
2251 # If instance is empty, then the task
2252 # will be sent to an instance which is available when the task is
2253 # attempted.
2254 #
2255 # If service,
2256 # version, or
2257 # instance is invalid, then the task
2258 # will be sent to the default version of the default service when
2259 # the task is attempted.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002260 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002261 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002262 # By default, the task is sent to an instance which is available when
2263 # the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002264 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002265 # Requests can only be sent to a specific instance if
2266 # [manual scaling is used in App Engine
2267 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
2268 # App Engine Flex does not support instances. For more information, see
2269 # [App Engine Standard request
2270 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2271 # and [App Engine Flex request
2272 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002273 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002274 &quot;headers&quot;: { # HTTP request headers.
2275 #
2276 # This map contains the header field names and values.
2277 # Headers can be set when the
2278 # task is created.
2279 # Repeated headers are not supported but a header value can contain commas.
2280 #
2281 # Cloud Tasks sets some headers to default values:
2282 #
2283 # * `User-Agent`: By default, this header is
2284 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
2285 # This header can be modified, but Cloud Tasks will append
2286 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
2287 # modified `User-Agent`.
2288 #
2289 # If the task has a payload, Cloud
2290 # Tasks sets the following headers:
2291 #
2292 # * `Content-Type`: By default, the `Content-Type` header is set to
2293 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
2294 # setting `Content-Type` to a particular media type when the
2295 # task is created.
2296 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
2297 # * `Content-Length`: This is computed by Cloud Tasks. This value is
2298 # output only. It cannot be changed.
2299 #
2300 # The headers below cannot be set or overridden:
2301 #
2302 # * `Host`
2303 # * `X-Google-*`
2304 # * `X-AppEngine-*`
2305 #
2306 # In addition, Cloud Tasks sets some headers when the task is dispatched,
2307 # such as headers containing information about the task; see
2308 # [request
2309 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
2310 # These headers are set only when the task is dispatched, so they are not
2311 # visible when the task is returned in a Cloud Tasks response.
2312 #
2313 # Although there is no specific limit for the maximum number of headers or
2314 # the size, there is a limit on the maximum size of the Task. For more
2315 # information, see the CreateTask documentation.
2316 &quot;a_key&quot;: &quot;A String&quot;,
2317 },
2318 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
2319 #
2320 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
2321 # It can contain a path and query string arguments.
2322 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
2323 # No spaces are allowed, and the maximum length allowed is 2083 characters.
2324 &quot;payload&quot;: &quot;A String&quot;, # Payload.
2325 #
2326 # The payload will be sent as the HTTP message body. A message
2327 # body, and thus a payload, is allowed only if the HTTP method is
2328 # POST or PUT. It is an error to set a data payload on a task with
2329 # an incompatible HttpMethod.
2330 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
2331 #
2332 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
2333 # HTTP requests with this http_method, otherwise the task attempt fails with
2334 # error code 405 (Method Not Allowed). See [Writing a push task request
2335 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
2336 # and the App Engine documentation for your runtime on [How Requests are
2337 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002338 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002339 &quot;status&quot;: { # Status of the task. # Output only. The task status.
2340 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
2341 #
2342 # This count includes attempts which have been dispatched but haven&#x27;t
2343 # received a response.
2344 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
2345 #
2346 # Only dispatch_time will be set.
2347 # The other AttemptStatus information is not retained by Cloud Tasks.
2348 #
2349 # This field is not calculated for pull tasks.
2350 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2351 #
2352 # `dispatch_time` will be truncated to the nearest microsecond.
2353 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
2354 #
2355 # If the task has not been attempted or the task is currently running
2356 # then the response status is unset.
2357 # different programming environments, including REST APIs and RPC APIs. It is
2358 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2359 # three pieces of data: error code, error message, and error details.
2360 #
2361 # You can find out more about this error model and how to work with it in the
2362 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2363 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2364 # user-facing error message should be localized and sent in the
2365 # google.rpc.Status.details field, or localized by the client.
2366 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2367 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2368 # message types for APIs to use.
2369 {
2370 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2371 },
2372 ],
2373 },
2374 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2375 #
2376 # `response_time` will be truncated to the nearest microsecond.
2377 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
2378 #
2379 # `schedule_time` will be truncated to the nearest microsecond.
2380 },
2381 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
2382 #
2383 # This field is not calculated for pull tasks.
2384 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2385 #
2386 # `dispatch_time` will be truncated to the nearest microsecond.
2387 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
2388 #
2389 # If the task has not been attempted or the task is currently running
2390 # then the response status is unset.
2391 # different programming environments, including REST APIs and RPC APIs. It is
2392 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2393 # three pieces of data: error code, error message, and error details.
2394 #
2395 # You can find out more about this error model and how to work with it in the
2396 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2397 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2398 # user-facing error message should be localized and sent in the
2399 # google.rpc.Status.details field, or localized by the client.
2400 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2401 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2402 # message types for APIs to use.
2403 {
2404 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2405 },
2406 ],
2407 },
2408 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2409 #
2410 # `response_time` will be truncated to the nearest microsecond.
2411 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
2412 #
2413 # `schedule_time` will be truncated to the nearest microsecond.
2414 },
2415 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
2416 #
2417 # This field is not calculated for pull tasks.
2418 },
2419 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
2420 #
2421 # `create_time` will be truncated to the nearest second.
2422 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
2423 #
2424 # The task name.
2425 #
2426 # The task name must have the following format:
2427 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
2428 #
2429 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
2430 # hyphens (-), colons (:), or periods (.).
2431 # For more information, see
2432 # [Identifying
2433 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
2434 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
2435 # The list of available locations can be obtained by calling
2436 # ListLocations.
2437 # For more information, see https://cloud.google.com/about/locations/.
2438 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
2439 # hyphens (-). The maximum length is 100 characters.
2440 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
2441 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07002442 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
2443 # set only if pull_target is set on the queue.
2444 #
2445 # A pull task is a task that has PullMessage set.
2446 # LeaseTasks to process the task.
2447 #
2448 # This proto can only be used for tasks in a queue which has
2449 # pull_target set.
2450 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
2451 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
2452 #
2453 # Tags allow similar tasks to be processed in a batch. If you label
2454 # tasks with a tag, your worker can
2455 # lease tasks with the same tag using
2456 # filter. For example, if you want to
2457 # aggregate the events associated with a specific user once a day,
2458 # you could tag tasks with the user ID.
2459 #
2460 # The task&#x27;s tag can only be set when the
2461 # task is created.
2462 #
2463 # The tag must be less than 500 characters.
2464 #
2465 # SDK compatibility: Although the SDK allows tags to be either
2466 # string or
2467 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
2468 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
2469 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
2470 },
2471 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
2472 #
2473 # For App Engine queues, this is when the task will be attempted or retried.
2474 #
2475 # For pull queues, this is the time when the task is available to
2476 # be leased; if a task is currently leased, this is the time when
2477 # the current lease expires, that is, the time that the task was
2478 # leased plus the lease_duration.
2479 #
2480 # `schedule_time` will be truncated to the nearest microsecond.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002481 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
2482 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002483 },
2484 ],
2485 }</pre>
2486</div>
2487
2488<div class="method">
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002489 <code class="details" id="list">list(parent, pageSize=None, pageToken=None, responseView=None, x__xgafv=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)
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002503 pageSize: integer, Maximum page size.
2504
2505Fewer tasks than requested might be returned, even if more tasks exist; use
2506next_page_token in the response to
2507determine if more tasks exist.
2508
2509The maximum page size is 1000. If unspecified, the page size will be the
2510maximum.
2511 pageToken: string, A token identifying the page of results to return.
2512
2513To request the first page results, page_token must be empty. To
2514request the next page of results, page_token must be the value of
2515next_page_token returned
2516from the previous call to ListTasks
2517method.
2518
2519The page token is valid for only 2 hours.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002520 responseView: string, The response_view specifies which subset of the Task will be
2521returned.
2522
2523By default response_view is BASIC; not all
2524information is retrieved by default because some data, such as
2525payloads, might be desirable to return only when needed because
2526of its large size or because of the sensitivity of data that it
2527contains.
2528
2529Authorization for FULL requires
2530`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
2531permission on the Task resource.
Bu Sun Kim65020912020-05-20 12:08:20 -07002532 x__xgafv: string, V1 error format.
2533 Allowed values
2534 1 - v1 error format
2535 2 - v2 error format
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.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002541 &quot;nextPageToken&quot;: &quot;A String&quot;, # 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.
Bu Sun Kim65020912020-05-20 12:08:20 -07002548 &quot;tasks&quot;: [ # The list of tasks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002549 { # A unit of scheduled work.
Bu Sun Kim65020912020-05-20 12:08:20 -07002550 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # App Engine HTTP request that is sent to the task&#x27;s target. Can
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002551 # be set only if
2552 # app_engine_http_target is set
2553 # on the queue.
2554 #
2555 # An App Engine task is a task that has AppEngineHttpRequest set.
2556 #
2557 # The message defines the HTTP request that is sent to an App Engine app when
2558 # the task is dispatched.
2559 #
2560 # This proto can only be used for tasks in a queue which has
2561 # app_engine_http_target set.
2562 #
2563 # Using AppEngineHttpRequest requires
2564 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
2565 # Google IAM permission for the project
2566 # and the following scope:
2567 #
2568 # `https://www.googleapis.com/auth/cloud-platform`
2569 #
2570 # The task will be delivered to the App Engine app which belongs to the same
2571 # project as the queue. For more information, see
2572 # [How Requests are
2573 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2574 # and how routing is affected by
2575 # [dispatch
2576 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
2577 # Traffic is encrypted during transport and never leaves Google datacenters.
2578 # Because this traffic is carried over a communication mechanism internal to
2579 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
2580 # The request to the handler, however, will appear to have used the HTTP
2581 # protocol.
2582 #
2583 # The AppEngineRouting used to construct the URL that the task is
2584 # delivered to can be set at the queue-level or task-level:
2585 #
2586 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07002587 # app_engine_routing_override
2588 # is used for all tasks in the queue, no matter what the setting
2589 # is for the
2590 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002591 #
2592 #
2593 # The `url` that the task will be sent to is:
2594 #
2595 # * `url =` host `+`
2596 # relative_url
2597 #
2598 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
2599 # URIs restricted with
2600 # [`login:
2601 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
2602 # Because tasks are not run as any user, they cannot be dispatched to URIs
2603 # restricted with
2604 # [`login:
2605 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
2606 # Task dispatches also do not follow redirects.
2607 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002608 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002609 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07002610 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002611 # not receive response before the deadline. Failed
2612 # tasks will be retried according to the
2613 # retry configuration. `503` (Service Unavailable) is
2614 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07002615 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
2616 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002617 # Requests) response from an app handler does not cause traffic congestion
2618 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -07002619 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002620 #
2621 # If set,
2622 # app_engine_routing_override
2623 # is used for all tasks in the queue, no matter what the setting is for the
2624 # task-level app_engine_routing.
2625 #
2626 # Defines routing characteristics specific to App Engine - service, version,
2627 # and instance.
2628 #
2629 # For more information about services, versions, and instances see
2630 # [An Overview of App
2631 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
2632 # [Microservices Architecture on Google App
2633 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
2634 # [App Engine Standard request
2635 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
2636 # and [App Engine Flex request
2637 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002638 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002639 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002640 # By default, the task is sent to the service which is the default
2641 # service when the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002642 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002643 # For some queues or tasks which were created using the App Engine
2644 # Task Queue API, host is not parsable
2645 # into service,
2646 # version, and
2647 # instance. For example, some tasks
2648 # which were created using the App Engine SDK use a custom domain
2649 # name; custom domains are not parsed by Cloud Tasks. If
2650 # host is not parsable, then
2651 # service,
2652 # version, and
2653 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -07002654 &quot;version&quot;: &quot;A String&quot;, # App version.
2655 #
2656 # By default, the task is sent to the version which is the default
2657 # version when the task is attempted.
2658 #
2659 # For some queues or tasks which were created using the App Engine
2660 # Task Queue API, host is not parsable
2661 # into service,
2662 # version, and
2663 # instance. For example, some tasks
2664 # which were created using the App Engine SDK use a custom domain
2665 # name; custom domains are not parsed by Cloud Tasks. If
2666 # host is not parsable, then
2667 # service,
2668 # version, and
2669 # instance are the empty string.
2670 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002671 #
2672 # For more information, see
2673 # [How Requests are
2674 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
2675 #
2676 # The host is constructed as:
2677 #
2678 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002679 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07002680 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2681 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2682 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2683 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2684 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2685 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2686 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002687 #
2688 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07002689 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07002690 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002691 # SDK use a custom domain name.
2692 #
2693 # * `service =` service
2694 #
2695 # * `version =` version
2696 #
2697 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002698 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002699 # service
2700 #
2701 # * `instance =` instance
2702 #
2703 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002704 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002705 # service
2706 #
2707 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002708 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002709 # version
2710 #
2711 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002712 # instance `+ &#x27;.&#x27; +`
2713 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002714 # service
2715 #
2716 # If service is empty, then the task will be sent
2717 # to the service which is the default service when the task is attempted.
2718 #
2719 # If version is empty, then the task will be sent
2720 # to the version which is the default version when the task is attempted.
2721 #
2722 # If instance is empty, then the task
2723 # will be sent to an instance which is available when the task is
2724 # attempted.
2725 #
2726 # If service,
2727 # version, or
2728 # instance is invalid, then the task
2729 # will be sent to the default version of the default service when
2730 # the task is attempted.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002731 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002732 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002733 # By default, the task is sent to an instance which is available when
2734 # the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002735 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002736 # Requests can only be sent to a specific instance if
2737 # [manual scaling is used in App Engine
2738 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
2739 # App Engine Flex does not support instances. For more information, see
2740 # [App Engine Standard request
2741 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2742 # and [App Engine Flex request
2743 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002744 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002745 &quot;headers&quot;: { # HTTP request headers.
2746 #
2747 # This map contains the header field names and values.
2748 # Headers can be set when the
2749 # task is created.
2750 # Repeated headers are not supported but a header value can contain commas.
2751 #
2752 # Cloud Tasks sets some headers to default values:
2753 #
2754 # * `User-Agent`: By default, this header is
2755 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
2756 # This header can be modified, but Cloud Tasks will append
2757 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
2758 # modified `User-Agent`.
2759 #
2760 # If the task has a payload, Cloud
2761 # Tasks sets the following headers:
2762 #
2763 # * `Content-Type`: By default, the `Content-Type` header is set to
2764 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
2765 # setting `Content-Type` to a particular media type when the
2766 # task is created.
2767 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
2768 # * `Content-Length`: This is computed by Cloud Tasks. This value is
2769 # output only. It cannot be changed.
2770 #
2771 # The headers below cannot be set or overridden:
2772 #
2773 # * `Host`
2774 # * `X-Google-*`
2775 # * `X-AppEngine-*`
2776 #
2777 # In addition, Cloud Tasks sets some headers when the task is dispatched,
2778 # such as headers containing information about the task; see
2779 # [request
2780 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
2781 # These headers are set only when the task is dispatched, so they are not
2782 # visible when the task is returned in a Cloud Tasks response.
2783 #
2784 # Although there is no specific limit for the maximum number of headers or
2785 # the size, there is a limit on the maximum size of the Task. For more
2786 # information, see the CreateTask documentation.
2787 &quot;a_key&quot;: &quot;A String&quot;,
2788 },
2789 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
2790 #
2791 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
2792 # It can contain a path and query string arguments.
2793 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
2794 # No spaces are allowed, and the maximum length allowed is 2083 characters.
2795 &quot;payload&quot;: &quot;A String&quot;, # Payload.
2796 #
2797 # The payload will be sent as the HTTP message body. A message
2798 # body, and thus a payload, is allowed only if the HTTP method is
2799 # POST or PUT. It is an error to set a data payload on a task with
2800 # an incompatible HttpMethod.
2801 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
2802 #
2803 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
2804 # HTTP requests with this http_method, otherwise the task attempt fails with
2805 # error code 405 (Method Not Allowed). See [Writing a push task request
2806 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
2807 # and the App Engine documentation for your runtime on [How Requests are
2808 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002809 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002810 &quot;status&quot;: { # Status of the task. # Output only. The task status.
2811 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
2812 #
2813 # This count includes attempts which have been dispatched but haven&#x27;t
2814 # received a response.
2815 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
2816 #
2817 # Only dispatch_time will be set.
2818 # The other AttemptStatus information is not retained by Cloud Tasks.
2819 #
2820 # This field is not calculated for pull tasks.
2821 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2822 #
2823 # `dispatch_time` will be truncated to the nearest microsecond.
2824 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
2825 #
2826 # If the task has not been attempted or the task is currently running
2827 # then the response status is unset.
2828 # different programming environments, including REST APIs and RPC APIs. It is
2829 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2830 # three pieces of data: error code, error message, and error details.
2831 #
2832 # You can find out more about this error model and how to work with it in the
2833 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2834 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2835 # user-facing error message should be localized and sent in the
2836 # google.rpc.Status.details field, or localized by the client.
2837 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2838 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2839 # message types for APIs to use.
2840 {
2841 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2842 },
2843 ],
2844 },
2845 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2846 #
2847 # `response_time` will be truncated to the nearest microsecond.
2848 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
2849 #
2850 # `schedule_time` will be truncated to the nearest microsecond.
2851 },
2852 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
2853 #
2854 # This field is not calculated for pull tasks.
2855 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2856 #
2857 # `dispatch_time` will be truncated to the nearest microsecond.
2858 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
2859 #
2860 # If the task has not been attempted or the task is currently running
2861 # then the response status is unset.
2862 # different programming environments, including REST APIs and RPC APIs. It is
2863 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2864 # three pieces of data: error code, error message, and error details.
2865 #
2866 # You can find out more about this error model and how to work with it in the
2867 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2868 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2869 # user-facing error message should be localized and sent in the
2870 # google.rpc.Status.details field, or localized by the client.
2871 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2872 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2873 # message types for APIs to use.
2874 {
2875 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2876 },
2877 ],
2878 },
2879 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2880 #
2881 # `response_time` will be truncated to the nearest microsecond.
2882 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
2883 #
2884 # `schedule_time` will be truncated to the nearest microsecond.
2885 },
2886 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
2887 #
2888 # This field is not calculated for pull tasks.
2889 },
2890 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
2891 #
2892 # `create_time` will be truncated to the nearest second.
2893 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
2894 #
2895 # The task name.
2896 #
2897 # The task name must have the following format:
2898 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
2899 #
2900 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
2901 # hyphens (-), colons (:), or periods (.).
2902 # For more information, see
2903 # [Identifying
2904 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
2905 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
2906 # The list of available locations can be obtained by calling
2907 # ListLocations.
2908 # For more information, see https://cloud.google.com/about/locations/.
2909 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
2910 # hyphens (-). The maximum length is 100 characters.
2911 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
2912 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07002913 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
2914 # set only if pull_target is set on the queue.
2915 #
2916 # A pull task is a task that has PullMessage set.
2917 # LeaseTasks to process the task.
2918 #
2919 # This proto can only be used for tasks in a queue which has
2920 # pull_target set.
2921 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
2922 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
2923 #
2924 # Tags allow similar tasks to be processed in a batch. If you label
2925 # tasks with a tag, your worker can
2926 # lease tasks with the same tag using
2927 # filter. For example, if you want to
2928 # aggregate the events associated with a specific user once a day,
2929 # you could tag tasks with the user ID.
2930 #
2931 # The task&#x27;s tag can only be set when the
2932 # task is created.
2933 #
2934 # The tag must be less than 500 characters.
2935 #
2936 # SDK compatibility: Although the SDK allows tags to be either
2937 # string or
2938 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
2939 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
2940 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
2941 },
2942 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
2943 #
2944 # For App Engine queues, this is when the task will be attempted or retried.
2945 #
2946 # For pull queues, this is the time when the task is available to
2947 # be leased; if a task is currently leased, this is the time when
2948 # the current lease expires, that is, the time that the task was
2949 # leased plus the lease_duration.
2950 #
2951 # `schedule_time` will be truncated to the nearest microsecond.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07002952 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
2953 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002954 },
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:
Bu Sun Kim65020912020-05-20 12:08:20 -07002968 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002969 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
Bu Sun Kim65020912020-05-20 12:08:20 -07002979returned in the task&#x27;s schedule_time.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002980
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.
Bu Sun Kim65020912020-05-20 12:08:20 -07002989 &quot;responseView&quot;: &quot;A String&quot;, # The response_view specifies which subset of the Task will be
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002990 # returned.
2991 #
2992 # By default response_view is BASIC; not all
2993 # information is retrieved by default because some data, such as
2994 # payloads, might be desirable to return only when needed because
2995 # of its large size or because of the sensitivity of data that it
2996 # contains.
2997 #
2998 # Authorization for FULL requires
2999 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
3000 # permission on the Task resource.
Bu Sun Kim65020912020-05-20 12:08:20 -07003001 &quot;leaseDuration&quot;: &quot;A String&quot;, # Required. The desired new lease duration, starting from now.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003002 #
3003 #
3004 # The maximum lease duration is 1 week.
3005 # `lease_duration` will be truncated to the nearest second.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003006 &quot;scheduleTime&quot;: &quot;A String&quot;, # Required. The task&#x27;s current schedule time, available in the
3007 # schedule_time returned by
3008 # LeaseTasks response or
3009 # RenewLease response. This restriction is
3010 # to ensure that your worker currently holds the lease.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003011 }
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.
Bu Sun Kim65020912020-05-20 12:08:20 -07003022 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # App Engine HTTP request that is sent to the task&#x27;s target. Can
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003023 # be set only if
3024 # app_engine_http_target is set
3025 # on the queue.
3026 #
3027 # An App Engine task is a task that has AppEngineHttpRequest set.
3028 #
3029 # The message defines the HTTP request that is sent to an App Engine app when
3030 # the task is dispatched.
3031 #
3032 # This proto can only be used for tasks in a queue which has
3033 # app_engine_http_target set.
3034 #
3035 # Using AppEngineHttpRequest requires
3036 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
3037 # Google IAM permission for the project
3038 # and the following scope:
3039 #
3040 # `https://www.googleapis.com/auth/cloud-platform`
3041 #
3042 # The task will be delivered to the App Engine app which belongs to the same
3043 # project as the queue. For more information, see
3044 # [How Requests are
3045 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
3046 # and how routing is affected by
3047 # [dispatch
3048 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
3049 # Traffic is encrypted during transport and never leaves Google datacenters.
3050 # Because this traffic is carried over a communication mechanism internal to
3051 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
3052 # The request to the handler, however, will appear to have used the HTTP
3053 # protocol.
3054 #
3055 # The AppEngineRouting used to construct the URL that the task is
3056 # delivered to can be set at the queue-level or task-level:
3057 #
3058 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07003059 # app_engine_routing_override
3060 # is used for all tasks in the queue, no matter what the setting
3061 # is for the
3062 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003063 #
3064 #
3065 # The `url` that the task will be sent to is:
3066 #
3067 # * `url =` host `+`
3068 # relative_url
3069 #
3070 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
3071 # URIs restricted with
3072 # [`login:
3073 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
3074 # Because tasks are not run as any user, they cannot be dispatched to URIs
3075 # restricted with
3076 # [`login:
3077 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
3078 # Task dispatches also do not follow redirects.
3079 #
Bu Sun Kim65020912020-05-20 12:08:20 -07003080 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003081 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07003082 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003083 # not receive response before the deadline. Failed
3084 # tasks will be retried according to the
3085 # retry configuration. `503` (Service Unavailable) is
3086 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07003087 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
3088 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003089 # Requests) response from an app handler does not cause traffic congestion
3090 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -07003091 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003092 #
3093 # If set,
3094 # app_engine_routing_override
3095 # is used for all tasks in the queue, no matter what the setting is for the
3096 # task-level app_engine_routing.
3097 #
3098 # Defines routing characteristics specific to App Engine - service, version,
3099 # and instance.
3100 #
3101 # For more information about services, versions, and instances see
3102 # [An Overview of App
3103 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
3104 # [Microservices Architecture on Google App
3105 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
3106 # [App Engine Standard request
3107 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
3108 # and [App Engine Flex request
3109 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003110 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003111 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003112 # By default, the task is sent to the service which is the default
3113 # service when the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003114 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003115 # For some queues or tasks which were created using the App Engine
3116 # Task Queue API, host is not parsable
3117 # into service,
3118 # version, and
3119 # instance. For example, some tasks
3120 # which were created using the App Engine SDK use a custom domain
3121 # name; custom domains are not parsed by Cloud Tasks. If
3122 # host is not parsable, then
3123 # service,
3124 # version, and
3125 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -07003126 &quot;version&quot;: &quot;A String&quot;, # App version.
3127 #
3128 # By default, the task is sent to the version which is the default
3129 # version when the task is attempted.
3130 #
3131 # For some queues or tasks which were created using the App Engine
3132 # Task Queue API, host is not parsable
3133 # into service,
3134 # version, and
3135 # instance. For example, some tasks
3136 # which were created using the App Engine SDK use a custom domain
3137 # name; custom domains are not parsed by Cloud Tasks. If
3138 # host is not parsable, then
3139 # service,
3140 # version, and
3141 # instance are the empty string.
3142 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003143 #
3144 # For more information, see
3145 # [How Requests are
3146 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
3147 #
3148 # The host is constructed as:
3149 #
3150 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003151 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07003152 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3153 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3154 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3155 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3156 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3157 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3158 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003159 #
3160 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07003161 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07003162 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003163 # SDK use a custom domain name.
3164 #
3165 # * `service =` service
3166 #
3167 # * `version =` version
3168 #
3169 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003170 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003171 # service
3172 #
3173 # * `instance =` instance
3174 #
3175 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003176 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003177 # service
3178 #
3179 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003180 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003181 # version
3182 #
3183 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003184 # instance `+ &#x27;.&#x27; +`
3185 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003186 # service
3187 #
3188 # If service is empty, then the task will be sent
3189 # to the service which is the default service when the task is attempted.
3190 #
3191 # If version is empty, then the task will be sent
3192 # to the version which is the default version when the task is attempted.
3193 #
3194 # If instance is empty, then the task
3195 # will be sent to an instance which is available when the task is
3196 # attempted.
3197 #
3198 # If service,
3199 # version, or
3200 # instance is invalid, then the task
3201 # will be sent to the default version of the default service when
3202 # the task is attempted.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003203 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003204 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003205 # By default, the task is sent to an instance which is available when
3206 # the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003207 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003208 # Requests can only be sent to a specific instance if
3209 # [manual scaling is used in App Engine
3210 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
3211 # App Engine Flex does not support instances. For more information, see
3212 # [App Engine Standard request
3213 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
3214 # and [App Engine Flex request
3215 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003216 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003217 &quot;headers&quot;: { # HTTP request headers.
3218 #
3219 # This map contains the header field names and values.
3220 # Headers can be set when the
3221 # task is created.
3222 # Repeated headers are not supported but a header value can contain commas.
3223 #
3224 # Cloud Tasks sets some headers to default values:
3225 #
3226 # * `User-Agent`: By default, this header is
3227 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
3228 # This header can be modified, but Cloud Tasks will append
3229 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
3230 # modified `User-Agent`.
3231 #
3232 # If the task has a payload, Cloud
3233 # Tasks sets the following headers:
3234 #
3235 # * `Content-Type`: By default, the `Content-Type` header is set to
3236 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
3237 # setting `Content-Type` to a particular media type when the
3238 # task is created.
3239 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
3240 # * `Content-Length`: This is computed by Cloud Tasks. This value is
3241 # output only. It cannot be changed.
3242 #
3243 # The headers below cannot be set or overridden:
3244 #
3245 # * `Host`
3246 # * `X-Google-*`
3247 # * `X-AppEngine-*`
3248 #
3249 # In addition, Cloud Tasks sets some headers when the task is dispatched,
3250 # such as headers containing information about the task; see
3251 # [request
3252 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
3253 # These headers are set only when the task is dispatched, so they are not
3254 # visible when the task is returned in a Cloud Tasks response.
3255 #
3256 # Although there is no specific limit for the maximum number of headers or
3257 # the size, there is a limit on the maximum size of the Task. For more
3258 # information, see the CreateTask documentation.
3259 &quot;a_key&quot;: &quot;A String&quot;,
3260 },
3261 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
3262 #
3263 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
3264 # It can contain a path and query string arguments.
3265 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
3266 # No spaces are allowed, and the maximum length allowed is 2083 characters.
3267 &quot;payload&quot;: &quot;A String&quot;, # Payload.
3268 #
3269 # The payload will be sent as the HTTP message body. A message
3270 # body, and thus a payload, is allowed only if the HTTP method is
3271 # POST or PUT. It is an error to set a data payload on a task with
3272 # an incompatible HttpMethod.
3273 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
3274 #
3275 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
3276 # HTTP requests with this http_method, otherwise the task attempt fails with
3277 # error code 405 (Method Not Allowed). See [Writing a push task request
3278 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
3279 # and the App Engine documentation for your runtime on [How Requests are
3280 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003281 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003282 &quot;status&quot;: { # Status of the task. # Output only. The task status.
3283 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
3284 #
3285 # This count includes attempts which have been dispatched but haven&#x27;t
3286 # received a response.
3287 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
3288 #
3289 # Only dispatch_time will be set.
3290 # The other AttemptStatus information is not retained by Cloud Tasks.
3291 #
3292 # This field is not calculated for pull tasks.
3293 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
3294 #
3295 # `dispatch_time` will be truncated to the nearest microsecond.
3296 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
3297 #
3298 # If the task has not been attempted or the task is currently running
3299 # then the response status is unset.
3300 # different programming environments, including REST APIs and RPC APIs. It is
3301 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3302 # three pieces of data: error code, error message, and error details.
3303 #
3304 # You can find out more about this error model and how to work with it in the
3305 # [API Design Guide](https://cloud.google.com/apis/design/errors).
3306 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
3307 # user-facing error message should be localized and sent in the
3308 # google.rpc.Status.details field, or localized by the client.
3309 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
3310 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
3311 # message types for APIs to use.
3312 {
3313 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
3314 },
3315 ],
3316 },
3317 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
3318 #
3319 # `response_time` will be truncated to the nearest microsecond.
3320 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
3321 #
3322 # `schedule_time` will be truncated to the nearest microsecond.
3323 },
3324 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
3325 #
3326 # This field is not calculated for pull tasks.
3327 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
3328 #
3329 # `dispatch_time` will be truncated to the nearest microsecond.
3330 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
3331 #
3332 # If the task has not been attempted or the task is currently running
3333 # then the response status is unset.
3334 # different programming environments, including REST APIs and RPC APIs. It is
3335 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3336 # three pieces of data: error code, error message, and error details.
3337 #
3338 # You can find out more about this error model and how to work with it in the
3339 # [API Design Guide](https://cloud.google.com/apis/design/errors).
3340 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
3341 # user-facing error message should be localized and sent in the
3342 # google.rpc.Status.details field, or localized by the client.
3343 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
3344 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
3345 # message types for APIs to use.
3346 {
3347 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
3348 },
3349 ],
3350 },
3351 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
3352 #
3353 # `response_time` will be truncated to the nearest microsecond.
3354 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
3355 #
3356 # `schedule_time` will be truncated to the nearest microsecond.
3357 },
3358 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
3359 #
3360 # This field is not calculated for pull tasks.
3361 },
3362 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
3363 #
3364 # `create_time` will be truncated to the nearest second.
3365 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
3366 #
3367 # The task name.
3368 #
3369 # The task name must have the following format:
3370 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
3371 #
3372 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
3373 # hyphens (-), colons (:), or periods (.).
3374 # For more information, see
3375 # [Identifying
3376 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
3377 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
3378 # The list of available locations can be obtained by calling
3379 # ListLocations.
3380 # For more information, see https://cloud.google.com/about/locations/.
3381 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
3382 # hyphens (-). The maximum length is 100 characters.
3383 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
3384 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07003385 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
3386 # set only if pull_target is set on the queue.
3387 #
3388 # A pull task is a task that has PullMessage set.
3389 # LeaseTasks to process the task.
3390 #
3391 # This proto can only be used for tasks in a queue which has
3392 # pull_target set.
3393 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
3394 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
3395 #
3396 # Tags allow similar tasks to be processed in a batch. If you label
3397 # tasks with a tag, your worker can
3398 # lease tasks with the same tag using
3399 # filter. For example, if you want to
3400 # aggregate the events associated with a specific user once a day,
3401 # you could tag tasks with the user ID.
3402 #
3403 # The task&#x27;s tag can only be set when the
3404 # task is created.
3405 #
3406 # The tag must be less than 500 characters.
3407 #
3408 # SDK compatibility: Although the SDK allows tags to be either
3409 # string or
3410 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
3411 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
3412 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
3413 },
3414 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
3415 #
3416 # For App Engine queues, this is when the task will be attempted or retried.
3417 #
3418 # For pull queues, this is the time when the task is available to
3419 # be leased; if a task is currently leased, this is the time when
3420 # the current lease expires, that is, the time that the task was
3421 # leased plus the lease_duration.
3422 #
3423 # `schedule_time` will be truncated to the nearest microsecond.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003424 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
3425 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003426 }</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
Bu Sun Kim65020912020-05-20 12:08:20 -07003446If Cloud Tasks receives a successful response from the task&#x27;s
3447target, then the task will be deleted; otherwise the task&#x27;s
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003448schedule_time will be reset to the time that
3449RunTask was called plus the retry delay specified
Bu Sun Kim65020912020-05-20 12:08:20 -07003450in the queue&#x27;s RetryConfig.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003451
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.
Bu Sun Kim65020912020-05-20 12:08:20 -07003467 &quot;responseView&quot;: &quot;A String&quot;, # The response_view specifies which subset of the Task will be
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003468 # 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.
Bu Sun Kim65020912020-05-20 12:08:20 -07003490 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # App Engine HTTP request that is sent to the task&#x27;s target. Can
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003491 # be set only if
3492 # app_engine_http_target is set
3493 # on the queue.
3494 #
3495 # An App Engine task is a task that has AppEngineHttpRequest set.
3496 #
3497 # The message defines the HTTP request that is sent to an App Engine app when
3498 # the task is dispatched.
3499 #
3500 # This proto can only be used for tasks in a queue which has
3501 # app_engine_http_target set.
3502 #
3503 # Using AppEngineHttpRequest requires
3504 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
3505 # Google IAM permission for the project
3506 # and the following scope:
3507 #
3508 # `https://www.googleapis.com/auth/cloud-platform`
3509 #
3510 # The task will be delivered to the App Engine app which belongs to the same
3511 # project as the queue. For more information, see
3512 # [How Requests are
3513 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
3514 # and how routing is affected by
3515 # [dispatch
3516 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
3517 # Traffic is encrypted during transport and never leaves Google datacenters.
3518 # Because this traffic is carried over a communication mechanism internal to
3519 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
3520 # The request to the handler, however, will appear to have used the HTTP
3521 # protocol.
3522 #
3523 # The AppEngineRouting used to construct the URL that the task is
3524 # delivered to can be set at the queue-level or task-level:
3525 #
3526 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07003527 # app_engine_routing_override
3528 # is used for all tasks in the queue, no matter what the setting
3529 # is for the
3530 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003531 #
3532 #
3533 # The `url` that the task will be sent to is:
3534 #
3535 # * `url =` host `+`
3536 # relative_url
3537 #
3538 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
3539 # URIs restricted with
3540 # [`login:
3541 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
3542 # Because tasks are not run as any user, they cannot be dispatched to URIs
3543 # restricted with
3544 # [`login:
3545 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
3546 # Task dispatches also do not follow redirects.
3547 #
Bu Sun Kim65020912020-05-20 12:08:20 -07003548 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003549 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07003550 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003551 # not receive response before the deadline. Failed
3552 # tasks will be retried according to the
3553 # retry configuration. `503` (Service Unavailable) is
3554 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07003555 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
3556 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003557 # Requests) response from an app handler does not cause traffic congestion
3558 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -07003559 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003560 #
3561 # If set,
3562 # app_engine_routing_override
3563 # is used for all tasks in the queue, no matter what the setting is for the
3564 # task-level app_engine_routing.
3565 #
3566 # Defines routing characteristics specific to App Engine - service, version,
3567 # and instance.
3568 #
3569 # For more information about services, versions, and instances see
3570 # [An Overview of App
3571 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
3572 # [Microservices Architecture on Google App
3573 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
3574 # [App Engine Standard request
3575 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
3576 # and [App Engine Flex request
3577 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003578 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003579 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003580 # By default, the task is sent to the service which is the default
3581 # service when the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003582 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003583 # For some queues or tasks which were created using the App Engine
3584 # Task Queue API, host is not parsable
3585 # into service,
3586 # version, and
3587 # instance. For example, some tasks
3588 # which were created using the App Engine SDK use a custom domain
3589 # name; custom domains are not parsed by Cloud Tasks. If
3590 # host is not parsable, then
3591 # service,
3592 # version, and
3593 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -07003594 &quot;version&quot;: &quot;A String&quot;, # App version.
3595 #
3596 # By default, the task is sent to the version which is the default
3597 # version when the task is attempted.
3598 #
3599 # For some queues or tasks which were created using the App Engine
3600 # Task Queue API, host is not parsable
3601 # into service,
3602 # version, and
3603 # instance. For example, some tasks
3604 # which were created using the App Engine SDK use a custom domain
3605 # name; custom domains are not parsed by Cloud Tasks. If
3606 # host is not parsable, then
3607 # service,
3608 # version, and
3609 # instance are the empty string.
3610 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003611 #
3612 # For more information, see
3613 # [How Requests are
3614 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
3615 #
3616 # The host is constructed as:
3617 #
3618 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003619 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07003620 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3621 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3622 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3623 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3624 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3625 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3626 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003627 #
3628 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07003629 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07003630 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003631 # SDK use a custom domain name.
3632 #
3633 # * `service =` service
3634 #
3635 # * `version =` version
3636 #
3637 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003638 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003639 # service
3640 #
3641 # * `instance =` instance
3642 #
3643 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003644 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003645 # service
3646 #
3647 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003648 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003649 # version
3650 #
3651 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003652 # instance `+ &#x27;.&#x27; +`
3653 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003654 # service
3655 #
3656 # If service is empty, then the task will be sent
3657 # to the service which is the default service when the task is attempted.
3658 #
3659 # If version is empty, then the task will be sent
3660 # to the version which is the default version when the task is attempted.
3661 #
3662 # If instance is empty, then the task
3663 # will be sent to an instance which is available when the task is
3664 # attempted.
3665 #
3666 # If service,
3667 # version, or
3668 # instance is invalid, then the task
3669 # will be sent to the default version of the default service when
3670 # the task is attempted.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003671 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003672 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003673 # By default, the task is sent to an instance which is available when
3674 # the task is attempted.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003675 #
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003676 # Requests can only be sent to a specific instance if
3677 # [manual scaling is used in App Engine
3678 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
3679 # App Engine Flex does not support instances. For more information, see
3680 # [App Engine Standard request
3681 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
3682 # and [App Engine Flex request
3683 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003684 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003685 &quot;headers&quot;: { # HTTP request headers.
3686 #
3687 # This map contains the header field names and values.
3688 # Headers can be set when the
3689 # task is created.
3690 # Repeated headers are not supported but a header value can contain commas.
3691 #
3692 # Cloud Tasks sets some headers to default values:
3693 #
3694 # * `User-Agent`: By default, this header is
3695 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
3696 # This header can be modified, but Cloud Tasks will append
3697 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
3698 # modified `User-Agent`.
3699 #
3700 # If the task has a payload, Cloud
3701 # Tasks sets the following headers:
3702 #
3703 # * `Content-Type`: By default, the `Content-Type` header is set to
3704 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
3705 # setting `Content-Type` to a particular media type when the
3706 # task is created.
3707 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
3708 # * `Content-Length`: This is computed by Cloud Tasks. This value is
3709 # output only. It cannot be changed.
3710 #
3711 # The headers below cannot be set or overridden:
3712 #
3713 # * `Host`
3714 # * `X-Google-*`
3715 # * `X-AppEngine-*`
3716 #
3717 # In addition, Cloud Tasks sets some headers when the task is dispatched,
3718 # such as headers containing information about the task; see
3719 # [request
3720 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
3721 # These headers are set only when the task is dispatched, so they are not
3722 # visible when the task is returned in a Cloud Tasks response.
3723 #
3724 # Although there is no specific limit for the maximum number of headers or
3725 # the size, there is a limit on the maximum size of the Task. For more
3726 # information, see the CreateTask documentation.
3727 &quot;a_key&quot;: &quot;A String&quot;,
3728 },
3729 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
3730 #
3731 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
3732 # It can contain a path and query string arguments.
3733 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
3734 # No spaces are allowed, and the maximum length allowed is 2083 characters.
3735 &quot;payload&quot;: &quot;A String&quot;, # Payload.
3736 #
3737 # The payload will be sent as the HTTP message body. A message
3738 # body, and thus a payload, is allowed only if the HTTP method is
3739 # POST or PUT. It is an error to set a data payload on a task with
3740 # an incompatible HttpMethod.
3741 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
3742 #
3743 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
3744 # HTTP requests with this http_method, otherwise the task attempt fails with
3745 # error code 405 (Method Not Allowed). See [Writing a push task request
3746 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
3747 # and the App Engine documentation for your runtime on [How Requests are
3748 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003749 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003750 &quot;status&quot;: { # Status of the task. # Output only. The task status.
3751 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
3752 #
3753 # This count includes attempts which have been dispatched but haven&#x27;t
3754 # received a response.
3755 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
3756 #
3757 # Only dispatch_time will be set.
3758 # The other AttemptStatus information is not retained by Cloud Tasks.
3759 #
3760 # This field is not calculated for pull tasks.
3761 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
3762 #
3763 # `dispatch_time` will be truncated to the nearest microsecond.
3764 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
3765 #
3766 # If the task has not been attempted or the task is currently running
3767 # then the response status is unset.
3768 # different programming environments, including REST APIs and RPC APIs. It is
3769 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3770 # three pieces of data: error code, error message, and error details.
3771 #
3772 # You can find out more about this error model and how to work with it in the
3773 # [API Design Guide](https://cloud.google.com/apis/design/errors).
3774 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
3775 # user-facing error message should be localized and sent in the
3776 # google.rpc.Status.details field, or localized by the client.
3777 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
3778 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
3779 # message types for APIs to use.
3780 {
3781 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
3782 },
3783 ],
3784 },
3785 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
3786 #
3787 # `response_time` will be truncated to the nearest microsecond.
3788 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
3789 #
3790 # `schedule_time` will be truncated to the nearest microsecond.
3791 },
3792 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
3793 #
3794 # This field is not calculated for pull tasks.
3795 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
3796 #
3797 # `dispatch_time` will be truncated to the nearest microsecond.
3798 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt.
3799 #
3800 # If the task has not been attempted or the task is currently running
3801 # then the response status is unset.
3802 # different programming environments, including REST APIs and RPC APIs. It is
3803 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3804 # three pieces of data: error code, error message, and error details.
3805 #
3806 # You can find out more about this error model and how to work with it in the
3807 # [API Design Guide](https://cloud.google.com/apis/design/errors).
3808 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
3809 # user-facing error message should be localized and sent in the
3810 # google.rpc.Status.details field, or localized by the client.
3811 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
3812 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
3813 # message types for APIs to use.
3814 {
3815 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
3816 },
3817 ],
3818 },
3819 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
3820 #
3821 # `response_time` will be truncated to the nearest microsecond.
3822 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
3823 #
3824 # `schedule_time` will be truncated to the nearest microsecond.
3825 },
3826 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
3827 #
3828 # This field is not calculated for pull tasks.
3829 },
3830 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
3831 #
3832 # `create_time` will be truncated to the nearest second.
3833 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
3834 #
3835 # The task name.
3836 #
3837 # The task name must have the following format:
3838 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
3839 #
3840 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
3841 # hyphens (-), colons (:), or periods (.).
3842 # For more information, see
3843 # [Identifying
3844 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
3845 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
3846 # The list of available locations can be obtained by calling
3847 # ListLocations.
3848 # For more information, see https://cloud.google.com/about/locations/.
3849 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
3850 # hyphens (-). The maximum length is 100 characters.
3851 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
3852 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07003853 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
3854 # set only if pull_target is set on the queue.
3855 #
3856 # A pull task is a task that has PullMessage set.
3857 # LeaseTasks to process the task.
3858 #
3859 # This proto can only be used for tasks in a queue which has
3860 # pull_target set.
3861 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
3862 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
3863 #
3864 # Tags allow similar tasks to be processed in a batch. If you label
3865 # tasks with a tag, your worker can
3866 # lease tasks with the same tag using
3867 # filter. For example, if you want to
3868 # aggregate the events associated with a specific user once a day,
3869 # you could tag tasks with the user ID.
3870 #
3871 # The task&#x27;s tag can only be set when the
3872 # task is created.
3873 #
3874 # The tag must be less than 500 characters.
3875 #
3876 # SDK compatibility: Although the SDK allows tags to be either
3877 # string or
3878 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
3879 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
3880 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
3881 },
3882 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
3883 #
3884 # For App Engine queues, this is when the task will be attempted or retried.
3885 #
3886 # For pull queues, this is the time when the task is available to
3887 # be leased; if a task is currently leased, this is the time when
3888 # the current lease expires, that is, the time that the task was
3889 # leased plus the lease_duration.
3890 #
3891 # `schedule_time` will be truncated to the nearest microsecond.
Bu Sun Kimd059ad82020-07-22 17:02:09 -07003892 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
3893 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003894 }</pre>
3895</div>
3896
3897</body></html>