blob: afb78ce5a386c17a7784f5e7dae5ed9583eb00ee [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 Kim65020912020-05-20 12:08:20 -070096 <code><a href="#list">list(parent, responseView=None, pageToken=None, pageSize=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;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700274 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700275 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
276 # HTTP requests with this http_method, otherwise the task attempt fails with
277 # error code 405 (Method Not Allowed). See [Writing a push task request
278 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
279 # and the App Engine documentation for your runtime on [How Requests are
280 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
281 &quot;payload&quot;: &quot;A String&quot;, # Payload.
282 #
283 # The payload will be sent as the HTTP message body. A message
284 # body, and thus a payload, is allowed only if the HTTP method is
285 # POST or PUT. It is an error to set a data payload on a task with
286 # an incompatible HttpMethod.
287 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
288 #
289 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700290 # It can contain a path and query string arguments.
Bu Sun Kim65020912020-05-20 12:08:20 -0700291 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700292 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -0700293 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700294 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700295 # This map contains the header field names and values.
296 # Headers can be set when the
297 # task is created.
298 # Repeated headers are not supported but a header value can contain commas.
299 #
300 # Cloud Tasks sets some headers to default values:
301 #
302 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -0700303 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700304 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -0700305 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -0700306 # modified `User-Agent`.
307 #
308 # If the task has a payload, Cloud
309 # Tasks sets the following headers:
310 #
311 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -0700312 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -0700313 # setting `Content-Type` to a particular media type when the
314 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -0700315 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700316 # * `Content-Length`: This is computed by Cloud Tasks. This value is
317 # output only. It cannot be changed.
318 #
319 # The headers below cannot be set or overridden:
320 #
321 # * `Host`
322 # * `X-Google-*`
323 # * `X-AppEngine-*`
324 #
325 # In addition, Cloud Tasks sets some headers when the task is dispatched,
326 # such as headers containing information about the task; see
327 # [request
328 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
329 # These headers are set only when the task is dispatched, so they are not
330 # visible when the task is returned in a Cloud Tasks response.
331 #
332 # Although there is no specific limit for the maximum number of headers or
333 # the size, there is a limit on the maximum size of the Task. For more
334 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700335 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700336 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700337 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700338 #
339 # If set,
340 # app_engine_routing_override
341 # is used for all tasks in the queue, no matter what the setting is for the
342 # task-level app_engine_routing.
343 #
344 # Defines routing characteristics specific to App Engine - service, version,
345 # and instance.
346 #
347 # For more information about services, versions, and instances see
348 # [An Overview of App
349 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
350 # [Microservices Architecture on Google App
351 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
352 # [App Engine Standard request
353 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
354 # and [App Engine Flex request
355 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -0700356 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700357 #
358 # By default, the task is sent to an instance which is available when
359 # the task is attempted.
360 #
361 # Requests can only be sent to a specific instance if
362 # [manual scaling is used in App Engine
363 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
364 # App Engine Flex does not support instances. For more information, see
365 # [App Engine Standard request
366 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
367 # and [App Engine Flex request
368 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -0700369 &quot;version&quot;: &quot;A String&quot;, # App version.
370 #
371 # By default, the task is sent to the version which is the default
372 # version when the task is attempted.
373 #
374 # For some queues or tasks which were created using the App Engine
375 # Task Queue API, host is not parsable
376 # into service,
377 # version, and
378 # instance. For example, some tasks
379 # which were created using the App Engine SDK use a custom domain
380 # name; custom domains are not parsed by Cloud Tasks. If
381 # host is not parsable, then
382 # service,
383 # version, and
384 # instance are the empty string.
385 &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 -0700386 #
387 # For more information, see
388 # [How Requests are
389 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
390 #
391 # The host is constructed as:
392 #
393 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700394 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -0700395 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
396 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
397 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
398 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
399 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
400 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
401 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700402 #
403 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -0700404 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -0700405 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700406 # SDK use a custom domain name.
407 #
408 # * `service =` service
409 #
410 # * `version =` version
411 #
412 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700413 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700414 # service
415 #
416 # * `instance =` instance
417 #
418 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700419 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700420 # service
421 #
422 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700423 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700424 # version
425 #
426 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700427 # instance `+ &#x27;.&#x27; +`
428 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700429 # service
430 #
431 # If service is empty, then the task will be sent
432 # to the service which is the default service when the task is attempted.
433 #
434 # If version is empty, then the task will be sent
435 # to the version which is the default version when the task is attempted.
436 #
437 # If instance is empty, then the task
438 # will be sent to an instance which is available when the task is
439 # attempted.
440 #
441 # If service,
442 # version, or
443 # instance is invalid, then the task
444 # will be sent to the default version of the default service when
445 # the task is attempted.
Bu Sun Kim65020912020-05-20 12:08:20 -0700446 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700447 #
448 # By default, the task is sent to the service which is the default
449 # service when the task is attempted.
450 #
451 # For some queues or tasks which were created using the App Engine
452 # Task Queue API, host is not parsable
453 # into service,
454 # version, and
455 # instance. For example, some tasks
456 # which were created using the App Engine SDK use a custom domain
457 # name; custom domains are not parsed by Cloud Tasks. If
458 # host is not parsable, then
459 # service,
460 # version, and
461 # instance are the empty string.
462 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700463 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700464 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
465 # been returned.
466 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
467 # set only if pull_target is set on the queue.
468 #
469 # A pull task is a task that has PullMessage set.
470 # LeaseTasks to process the task.
471 #
472 # This proto can only be used for tasks in a queue which has
473 # pull_target set.
474 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
475 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
476 #
477 # Tags allow similar tasks to be processed in a batch. If you label
478 # tasks with a tag, your worker can
479 # lease tasks with the same tag using
480 # filter. For example, if you want to
481 # aggregate the events associated with a specific user once a day,
482 # you could tag tasks with the user ID.
483 #
484 # The task&#x27;s tag can only be set when the
485 # task is created.
486 #
487 # The tag must be less than 500 characters.
488 #
489 # SDK compatibility: Although the SDK allows tags to be either
490 # string or
491 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
492 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
493 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
494 },
495 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
496 #
497 # For App Engine queues, this is when the task will be attempted or retried.
498 #
499 # For pull queues, this is the time when the task is available to
500 # be leased; if a task is currently leased, this is the time when
501 # the current lease expires, that is, the time that the task was
502 # leased plus the lease_duration.
503 #
504 # `schedule_time` will be truncated to the nearest microsecond.
505 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
506 #
507 # `create_time` will be truncated to the nearest second.
508 &quot;status&quot;: { # Status of the task. # Output only. The task status.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700509 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
510 #
511 # This field is not calculated for pull tasks.
512 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
513 #
514 # `response_time` will be truncated to the nearest microsecond.
515 &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.
516 #
517 # If the task has not been attempted or the task is currently running
518 # then the response status is unset.
519 # different programming environments, including REST APIs and RPC APIs. It is
520 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
521 # three pieces of data: error code, error message, and error details.
522 #
523 # You can find out more about this error model and how to work with it in the
524 # [API Design Guide](https://cloud.google.com/apis/design/errors).
525 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
526 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
527 # user-facing error message should be localized and sent in the
528 # google.rpc.Status.details field, or localized by the client.
529 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
530 # message types for APIs to use.
531 {
532 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
533 },
534 ],
535 },
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 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
540 #
541 # `dispatch_time` will be truncated to the nearest microsecond.
542 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700543 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
544 #
545 # This count includes attempts which have been dispatched but haven&#x27;t
546 # received a response.
547 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
548 #
549 # Only dispatch_time will be set.
550 # The other AttemptStatus information is not retained by Cloud Tasks.
551 #
552 # This field is not calculated for pull tasks.
553 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
554 #
555 # `response_time` will be truncated to the nearest microsecond.
556 &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.
557 #
558 # If the task has not been attempted or the task is currently running
559 # then the response status is unset.
560 # different programming environments, including REST APIs and RPC APIs. It is
561 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
562 # three pieces of data: error code, error message, and error details.
563 #
564 # You can find out more about this error model and how to work with it in the
565 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700566 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
567 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
568 # user-facing error message should be localized and sent in the
569 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -0700570 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
571 # message types for APIs to use.
572 {
573 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
574 },
575 ],
Bu Sun Kim65020912020-05-20 12:08:20 -0700576 },
577 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
578 #
579 # `schedule_time` will be truncated to the nearest microsecond.
580 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
581 #
582 # `dispatch_time` will be truncated to the nearest microsecond.
583 },
584 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
585 #
586 # This field is not calculated for pull tasks.
Bu Sun Kim65020912020-05-20 12:08:20 -0700587 },
588 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700589 #
590 # The task name.
591 #
592 # The task name must have the following format:
593 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
594 #
595 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
596 # hyphens (-), colons (:), or periods (.).
597 # For more information, see
598 # [Identifying
599 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
Bu Sun Kim65020912020-05-20 12:08:20 -0700600 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700601 # The list of available locations can be obtained by calling
602 # ListLocations.
603 # For more information, see https://cloud.google.com/about/locations/.
604 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
605 # hyphens (-). The maximum length is 100 characters.
606 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
607 # hyphens (-), or underscores (_). The maximum length is 500 characters.
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 Kim65020912020-05-20 12:08:20 -0700630 &quot;task&quot;: { # A unit of scheduled work. # Required. The task to add.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700631 #
632 # Task names have the following format:
633 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
634 # The user can optionally specify a task name. If a
635 # name is not specified then the system will generate a random
636 # unique task id, which will be set in the task returned in the
637 # response.
638 #
639 # If schedule_time is not set or is in the
640 # past then Cloud Tasks will set it to the current time.
641 #
642 # Task De-duplication:
643 #
644 # Explicitly specifying a task ID enables task de-duplication. If
Bu Sun Kim65020912020-05-20 12:08:20 -0700645 # a task&#x27;s ID is identical to that of an existing task or a task
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700646 # that was deleted or completed recently then the call will fail
647 # with ALREADY_EXISTS.
Bu Sun Kim65020912020-05-20 12:08:20 -0700648 # If the task&#x27;s queue was created using Cloud Tasks, then another task with
649 # the same name can&#x27;t be created for ~1hour after the original task was
650 # deleted or completed. If the task&#x27;s queue was created using queue.yaml or
651 # queue.xml, then another task with the same name can&#x27;t be created
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700652 # for ~9days after the original task was deleted or completed.
653 #
654 # Because there is an extra lookup cost to identify duplicate task
655 # names, these CreateTask calls have significantly
656 # increased latency. Using hashed strings for the task id or for
657 # the prefix of the task id is recommended. Choosing task ids that
658 # are sequential or have sequential prefixes, for example using a
659 # timestamp, causes an increase in latency and error rates in all
660 # task commands. The infrastructure relies on an approximately
661 # uniform distribution of task ids to store and serve tasks
662 # efficiently.
Bu Sun Kim65020912020-05-20 12:08:20 -0700663 &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 -0700664 # be set only if
665 # app_engine_http_target is set
666 # on the queue.
667 #
668 # An App Engine task is a task that has AppEngineHttpRequest set.
669 #
670 # The message defines the HTTP request that is sent to an App Engine app when
671 # the task is dispatched.
672 #
673 # This proto can only be used for tasks in a queue which has
674 # app_engine_http_target set.
675 #
676 # Using AppEngineHttpRequest requires
677 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
678 # Google IAM permission for the project
679 # and the following scope:
680 #
681 # `https://www.googleapis.com/auth/cloud-platform`
682 #
683 # The task will be delivered to the App Engine app which belongs to the same
684 # project as the queue. For more information, see
685 # [How Requests are
686 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
687 # and how routing is affected by
688 # [dispatch
689 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
690 # Traffic is encrypted during transport and never leaves Google datacenters.
691 # Because this traffic is carried over a communication mechanism internal to
692 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
693 # The request to the handler, however, will appear to have used the HTTP
694 # protocol.
695 #
696 # The AppEngineRouting used to construct the URL that the task is
697 # delivered to can be set at the queue-level or task-level:
698 #
699 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -0700700 # app_engine_routing_override
701 # is used for all tasks in the queue, no matter what the setting
702 # is for the
703 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700704 #
705 #
706 # The `url` that the task will be sent to is:
707 #
708 # * `url =` host `+`
709 # relative_url
710 #
711 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
712 # URIs restricted with
713 # [`login:
714 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
715 # Because tasks are not run as any user, they cannot be dispatched to URIs
716 # restricted with
717 # [`login:
718 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
719 # Task dispatches also do not follow redirects.
720 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700721 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700722 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -0700723 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700724 # not receive response before the deadline. Failed
725 # tasks will be retried according to the
726 # retry configuration. `503` (Service Unavailable) is
727 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -0700728 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
729 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700730 # Requests) response from an app handler does not cause traffic congestion
731 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -0700732 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700733 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700734 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
735 # HTTP requests with this http_method, otherwise the task attempt fails with
736 # error code 405 (Method Not Allowed). See [Writing a push task request
737 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
738 # and the App Engine documentation for your runtime on [How Requests are
739 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
740 &quot;payload&quot;: &quot;A String&quot;, # Payload.
741 #
742 # The payload will be sent as the HTTP message body. A message
743 # body, and thus a payload, is allowed only if the HTTP method is
744 # POST or PUT. It is an error to set a data payload on a task with
745 # an incompatible HttpMethod.
746 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
747 #
748 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700749 # It can contain a path and query string arguments.
Bu Sun Kim65020912020-05-20 12:08:20 -0700750 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700751 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -0700752 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700753 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700754 # This map contains the header field names and values.
755 # Headers can be set when the
756 # task is created.
757 # Repeated headers are not supported but a header value can contain commas.
758 #
759 # Cloud Tasks sets some headers to default values:
760 #
761 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -0700762 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700763 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -0700764 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -0700765 # modified `User-Agent`.
766 #
767 # If the task has a payload, Cloud
768 # Tasks sets the following headers:
769 #
770 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -0700771 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -0700772 # setting `Content-Type` to a particular media type when the
773 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -0700774 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -0700775 # * `Content-Length`: This is computed by Cloud Tasks. This value is
776 # output only. It cannot be changed.
777 #
778 # The headers below cannot be set or overridden:
779 #
780 # * `Host`
781 # * `X-Google-*`
782 # * `X-AppEngine-*`
783 #
784 # In addition, Cloud Tasks sets some headers when the task is dispatched,
785 # such as headers containing information about the task; see
786 # [request
787 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
788 # These headers are set only when the task is dispatched, so they are not
789 # visible when the task is returned in a Cloud Tasks response.
790 #
791 # Although there is no specific limit for the maximum number of headers or
792 # the size, there is a limit on the maximum size of the Task. For more
793 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700794 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -0700795 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700796 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700797 #
798 # If set,
799 # app_engine_routing_override
800 # is used for all tasks in the queue, no matter what the setting is for the
801 # task-level app_engine_routing.
802 #
803 # Defines routing characteristics specific to App Engine - service, version,
804 # and instance.
805 #
806 # For more information about services, versions, and instances see
807 # [An Overview of App
808 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
809 # [Microservices Architecture on Google App
810 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
811 # [App Engine Standard request
812 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
813 # and [App Engine Flex request
814 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -0700815 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700816 #
817 # By default, the task is sent to an instance which is available when
818 # the task is attempted.
819 #
820 # Requests can only be sent to a specific instance if
821 # [manual scaling is used in App Engine
822 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
823 # App Engine Flex does not support instances. For more information, see
824 # [App Engine Standard request
825 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
826 # and [App Engine Flex request
827 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -0700828 &quot;version&quot;: &quot;A String&quot;, # App version.
829 #
830 # By default, the task is sent to the version which is the default
831 # version when the task is attempted.
832 #
833 # For some queues or tasks which were created using the App Engine
834 # Task Queue API, host is not parsable
835 # into service,
836 # version, and
837 # instance. For example, some tasks
838 # which were created using the App Engine SDK use a custom domain
839 # name; custom domains are not parsed by Cloud Tasks. If
840 # host is not parsable, then
841 # service,
842 # version, and
843 # instance are the empty string.
844 &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 -0700845 #
846 # For more information, see
847 # [How Requests are
848 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
849 #
850 # The host is constructed as:
851 #
852 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700853 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -0700854 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
855 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
856 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
857 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
858 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
859 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
860 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700861 #
862 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -0700863 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -0700864 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700865 # SDK use a custom domain name.
866 #
867 # * `service =` service
868 #
869 # * `version =` version
870 #
871 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700872 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700873 # service
874 #
875 # * `instance =` instance
876 #
877 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700878 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700879 # service
880 #
881 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700882 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700883 # version
884 #
885 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -0700886 # instance `+ &#x27;.&#x27; +`
887 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700888 # service
889 #
890 # If service is empty, then the task will be sent
891 # to the service which is the default service when the task is attempted.
892 #
893 # If version is empty, then the task will be sent
894 # to the version which is the default version when the task is attempted.
895 #
896 # If instance is empty, then the task
897 # will be sent to an instance which is available when the task is
898 # attempted.
899 #
900 # If service,
901 # version, or
902 # instance is invalid, then the task
903 # will be sent to the default version of the default service when
904 # the task is attempted.
Bu Sun Kim65020912020-05-20 12:08:20 -0700905 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700906 #
907 # By default, the task is sent to the service which is the default
908 # service when the task is attempted.
909 #
910 # For some queues or tasks which were created using the App Engine
911 # Task Queue API, host is not parsable
912 # into service,
913 # version, and
914 # instance. For example, some tasks
915 # which were created using the App Engine SDK use a custom domain
916 # name; custom domains are not parsed by Cloud Tasks. If
917 # host is not parsable, then
918 # service,
919 # version, and
920 # instance are the empty string.
921 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700922 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700923 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
924 # been returned.
925 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
926 # set only if pull_target is set on the queue.
927 #
928 # A pull task is a task that has PullMessage set.
929 # LeaseTasks to process the task.
930 #
931 # This proto can only be used for tasks in a queue which has
932 # pull_target set.
933 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
934 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
935 #
936 # Tags allow similar tasks to be processed in a batch. If you label
937 # tasks with a tag, your worker can
938 # lease tasks with the same tag using
939 # filter. For example, if you want to
940 # aggregate the events associated with a specific user once a day,
941 # you could tag tasks with the user ID.
942 #
943 # The task&#x27;s tag can only be set when the
944 # task is created.
945 #
946 # The tag must be less than 500 characters.
947 #
948 # SDK compatibility: Although the SDK allows tags to be either
949 # string or
950 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
951 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
952 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
953 },
954 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
955 #
956 # For App Engine queues, this is when the task will be attempted or retried.
957 #
958 # For pull queues, this is the time when the task is available to
959 # be leased; if a task is currently leased, this is the time when
960 # the current lease expires, that is, the time that the task was
961 # leased plus the lease_duration.
962 #
963 # `schedule_time` will be truncated to the nearest microsecond.
964 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
965 #
966 # `create_time` will be truncated to the nearest second.
967 &quot;status&quot;: { # Status of the task. # Output only. The task status.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700968 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
969 #
970 # This field is not calculated for pull tasks.
971 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
972 #
973 # `response_time` will be truncated to the nearest microsecond.
974 &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.
975 #
976 # If the task has not been attempted or the task is currently running
977 # then the response status is unset.
978 # different programming environments, including REST APIs and RPC APIs. It is
979 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
980 # three pieces of data: error code, error message, and error details.
981 #
982 # You can find out more about this error model and how to work with it in the
983 # [API Design Guide](https://cloud.google.com/apis/design/errors).
984 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
985 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
986 # user-facing error message should be localized and sent in the
987 # google.rpc.Status.details field, or localized by the client.
988 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
989 # message types for APIs to use.
990 {
991 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
992 },
993 ],
994 },
995 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
996 #
997 # `schedule_time` will be truncated to the nearest microsecond.
998 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
999 #
1000 # `dispatch_time` will be truncated to the nearest microsecond.
1001 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001002 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
1003 #
1004 # This count includes attempts which have been dispatched but haven&#x27;t
1005 # received a response.
1006 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
1007 #
1008 # Only dispatch_time will be set.
1009 # The other AttemptStatus information is not retained by Cloud Tasks.
1010 #
1011 # This field is not calculated for pull tasks.
1012 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1013 #
1014 # `response_time` will be truncated to the nearest microsecond.
1015 &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.
1016 #
1017 # If the task has not been attempted or the task is currently running
1018 # then the response status is unset.
1019 # different programming environments, including REST APIs and RPC APIs. It is
1020 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1021 # three pieces of data: error code, error message, and error details.
1022 #
1023 # You can find out more about this error model and how to work with it in the
1024 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001025 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1026 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1027 # user-facing error message should be localized and sent in the
1028 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -07001029 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1030 # message types for APIs to use.
1031 {
1032 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1033 },
1034 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001035 },
1036 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1037 #
1038 # `schedule_time` will be truncated to the nearest microsecond.
1039 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1040 #
1041 # `dispatch_time` will be truncated to the nearest microsecond.
1042 },
1043 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
1044 #
1045 # This field is not calculated for pull tasks.
Bu Sun Kim65020912020-05-20 12:08:20 -07001046 },
1047 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001048 #
1049 # The task name.
1050 #
1051 # The task name must have the following format:
1052 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1053 #
1054 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1055 # hyphens (-), colons (:), or periods (.).
1056 # For more information, see
1057 # [Identifying
1058 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
Bu Sun Kim65020912020-05-20 12:08:20 -07001059 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001060 # The list of available locations can be obtained by calling
1061 # ListLocations.
1062 # For more information, see https://cloud.google.com/about/locations/.
1063 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1064 # hyphens (-). The maximum length is 100 characters.
1065 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1066 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001067 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001068 &quot;responseView&quot;: &quot;A String&quot;, # The response_view specifies which subset of the Task will be
1069 # returned.
1070 #
1071 # By default response_view is BASIC; not all
1072 # information is retrieved by default because some data, such as
1073 # payloads, might be desirable to return only when needed because
1074 # of its large size or because of the sensitivity of data that it
1075 # contains.
1076 #
1077 # Authorization for FULL requires
1078 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1079 # permission on the Task resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001080 }
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;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001161 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001162 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
1163 # HTTP requests with this http_method, otherwise the task attempt fails with
1164 # error code 405 (Method Not Allowed). See [Writing a push task request
1165 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
1166 # and the App Engine documentation for your runtime on [How Requests are
1167 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
1168 &quot;payload&quot;: &quot;A String&quot;, # Payload.
1169 #
1170 # The payload will be sent as the HTTP message body. A message
1171 # body, and thus a payload, is allowed only if the HTTP method is
1172 # POST or PUT. It is an error to set a data payload on a task with
1173 # an incompatible HttpMethod.
1174 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
1175 #
1176 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001177 # It can contain a path and query string arguments.
Bu Sun Kim65020912020-05-20 12:08:20 -07001178 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001179 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07001180 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001181 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001182 # This map contains the header field names and values.
1183 # Headers can be set when the
1184 # task is created.
1185 # Repeated headers are not supported but a header value can contain commas.
1186 #
1187 # Cloud Tasks sets some headers to default values:
1188 #
1189 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07001190 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07001191 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07001192 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -07001193 # modified `User-Agent`.
1194 #
1195 # If the task has a payload, Cloud
1196 # Tasks sets the following headers:
1197 #
1198 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07001199 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -07001200 # setting `Content-Type` to a particular media type when the
1201 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07001202 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07001203 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1204 # output only. It cannot be changed.
1205 #
1206 # The headers below cannot be set or overridden:
1207 #
1208 # * `Host`
1209 # * `X-Google-*`
1210 # * `X-AppEngine-*`
1211 #
1212 # In addition, Cloud Tasks sets some headers when the task is dispatched,
1213 # such as headers containing information about the task; see
1214 # [request
1215 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
1216 # These headers are set only when the task is dispatched, so they are not
1217 # visible when the task is returned in a Cloud Tasks response.
1218 #
1219 # Although there is no specific limit for the maximum number of headers or
1220 # the size, there is a limit on the maximum size of the Task. For more
1221 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07001222 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07001223 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001224 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001225 #
1226 # If set,
1227 # app_engine_routing_override
1228 # is used for all tasks in the queue, no matter what the setting is for the
1229 # task-level app_engine_routing.
1230 #
1231 # Defines routing characteristics specific to App Engine - service, version,
1232 # and instance.
1233 #
1234 # For more information about services, versions, and instances see
1235 # [An Overview of App
1236 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
1237 # [Microservices Architecture on Google App
1238 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
1239 # [App Engine Standard request
1240 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
1241 # and [App Engine Flex request
1242 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07001243 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001244 #
1245 # By default, the task is sent to an instance which is available when
1246 # the task is attempted.
1247 #
1248 # Requests can only be sent to a specific instance if
1249 # [manual scaling is used in App Engine
1250 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
1251 # App Engine Flex does not support instances. For more information, see
1252 # [App Engine Standard request
1253 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1254 # and [App Engine Flex request
1255 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07001256 &quot;version&quot;: &quot;A String&quot;, # App version.
1257 #
1258 # By default, the task is sent to the version which is the default
1259 # version when the task is attempted.
1260 #
1261 # For some queues or tasks which were created using the App Engine
1262 # Task Queue API, host is not parsable
1263 # into service,
1264 # version, and
1265 # instance. For example, some tasks
1266 # which were created using the App Engine SDK use a custom domain
1267 # name; custom domains are not parsed by Cloud Tasks. If
1268 # host is not parsable, then
1269 # service,
1270 # version, and
1271 # instance are the empty string.
1272 &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 -07001273 #
1274 # For more information, see
1275 # [How Requests are
1276 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
1277 #
1278 # The host is constructed as:
1279 #
1280 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001281 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07001282 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1283 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1284 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1285 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1286 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1287 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1288 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001289 #
1290 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07001291 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07001292 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001293 # SDK use a custom domain name.
1294 #
1295 # * `service =` service
1296 #
1297 # * `version =` version
1298 #
1299 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001300 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001301 # service
1302 #
1303 # * `instance =` instance
1304 #
1305 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001306 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001307 # service
1308 #
1309 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001310 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001311 # version
1312 #
1313 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001314 # instance `+ &#x27;.&#x27; +`
1315 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001316 # service
1317 #
1318 # If service is empty, then the task will be sent
1319 # to the service which is the default service when the task is attempted.
1320 #
1321 # If version is empty, then the task will be sent
1322 # to the version which is the default version when the task is attempted.
1323 #
1324 # If instance is empty, then the task
1325 # will be sent to an instance which is available when the task is
1326 # attempted.
1327 #
1328 # If service,
1329 # version, or
1330 # instance is invalid, then the task
1331 # will be sent to the default version of the default service when
1332 # the task is attempted.
Bu Sun Kim65020912020-05-20 12:08:20 -07001333 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001334 #
1335 # By default, the task is sent to the service which is the default
1336 # service when the task is attempted.
1337 #
1338 # For some queues or tasks which were created using the App Engine
1339 # Task Queue API, host is not parsable
1340 # into service,
1341 # version, and
1342 # instance. For example, some tasks
1343 # which were created using the App Engine SDK use a custom domain
1344 # name; custom domains are not parsed by Cloud Tasks. If
1345 # host is not parsable, then
1346 # service,
1347 # version, and
1348 # instance are the empty string.
1349 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001350 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001351 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
1352 # been returned.
1353 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
1354 # set only if pull_target is set on the queue.
1355 #
1356 # A pull task is a task that has PullMessage set.
1357 # LeaseTasks to process the task.
1358 #
1359 # This proto can only be used for tasks in a queue which has
1360 # pull_target set.
1361 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
1362 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
1363 #
1364 # Tags allow similar tasks to be processed in a batch. If you label
1365 # tasks with a tag, your worker can
1366 # lease tasks with the same tag using
1367 # filter. For example, if you want to
1368 # aggregate the events associated with a specific user once a day,
1369 # you could tag tasks with the user ID.
1370 #
1371 # The task&#x27;s tag can only be set when the
1372 # task is created.
1373 #
1374 # The tag must be less than 500 characters.
1375 #
1376 # SDK compatibility: Although the SDK allows tags to be either
1377 # string or
1378 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
1379 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
1380 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
1381 },
1382 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
1383 #
1384 # For App Engine queues, this is when the task will be attempted or retried.
1385 #
1386 # For pull queues, this is the time when the task is available to
1387 # be leased; if a task is currently leased, this is the time when
1388 # the current lease expires, that is, the time that the task was
1389 # leased plus the lease_duration.
1390 #
1391 # `schedule_time` will be truncated to the nearest microsecond.
1392 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
1393 #
1394 # `create_time` will be truncated to the nearest second.
1395 &quot;status&quot;: { # Status of the task. # Output only. The task status.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001396 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
1397 #
1398 # This field is not calculated for pull tasks.
1399 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1400 #
1401 # `response_time` will be truncated to the nearest microsecond.
1402 &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.
1403 #
1404 # If the task has not been attempted or the task is currently running
1405 # then the response status is unset.
1406 # different programming environments, including REST APIs and RPC APIs. It is
1407 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1408 # three pieces of data: error code, error message, and error details.
1409 #
1410 # You can find out more about this error model and how to work with it in the
1411 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1412 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1413 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1414 # user-facing error message should be localized and sent in the
1415 # google.rpc.Status.details field, or localized by the client.
1416 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1417 # message types for APIs to use.
1418 {
1419 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1420 },
1421 ],
1422 },
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 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1427 #
1428 # `dispatch_time` will be truncated to the nearest microsecond.
1429 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001430 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
1431 #
1432 # This count includes attempts which have been dispatched but haven&#x27;t
1433 # received a response.
1434 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
1435 #
1436 # Only dispatch_time will be set.
1437 # The other AttemptStatus information is not retained by Cloud Tasks.
1438 #
1439 # This field is not calculated for pull tasks.
1440 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1441 #
1442 # `response_time` will be truncated to the nearest microsecond.
1443 &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.
1444 #
1445 # If the task has not been attempted or the task is currently running
1446 # then the response status is unset.
1447 # different programming environments, including REST APIs and RPC APIs. It is
1448 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1449 # three pieces of data: error code, error message, and error details.
1450 #
1451 # You can find out more about this error model and how to work with it in the
1452 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001453 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1454 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1455 # user-facing error message should be localized and sent in the
1456 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -07001457 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1458 # message types for APIs to use.
1459 {
1460 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1461 },
1462 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001463 },
1464 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1465 #
1466 # `schedule_time` will be truncated to the nearest microsecond.
1467 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1468 #
1469 # `dispatch_time` will be truncated to the nearest microsecond.
1470 },
1471 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
1472 #
1473 # This field is not calculated for pull tasks.
Bu Sun Kim65020912020-05-20 12:08:20 -07001474 },
1475 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001476 #
1477 # The task name.
1478 #
1479 # The task name must have the following format:
1480 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1481 #
1482 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1483 # hyphens (-), colons (:), or periods (.).
1484 # For more information, see
1485 # [Identifying
1486 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
Bu Sun Kim65020912020-05-20 12:08:20 -07001487 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001488 # The list of available locations can be obtained by calling
1489 # ListLocations.
1490 # For more information, see https://cloud.google.com/about/locations/.
1491 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1492 # hyphens (-). The maximum length is 100 characters.
1493 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1494 # hyphens (-), or underscores (_). The maximum length is 500 characters.
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;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001627 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001628 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
1629 # HTTP requests with this http_method, otherwise the task attempt fails with
1630 # error code 405 (Method Not Allowed). See [Writing a push task request
1631 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
1632 # and the App Engine documentation for your runtime on [How Requests are
1633 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
1634 &quot;payload&quot;: &quot;A String&quot;, # Payload.
1635 #
1636 # The payload will be sent as the HTTP message body. A message
1637 # body, and thus a payload, is allowed only if the HTTP method is
1638 # POST or PUT. It is an error to set a data payload on a task with
1639 # an incompatible HttpMethod.
1640 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
1641 #
1642 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001643 # It can contain a path and query string arguments.
Bu Sun Kim65020912020-05-20 12:08:20 -07001644 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001645 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07001646 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001647 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001648 # This map contains the header field names and values.
1649 # Headers can be set when the
1650 # task is created.
1651 # Repeated headers are not supported but a header value can contain commas.
1652 #
1653 # Cloud Tasks sets some headers to default values:
1654 #
1655 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07001656 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07001657 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07001658 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -07001659 # modified `User-Agent`.
1660 #
1661 # If the task has a payload, Cloud
1662 # Tasks sets the following headers:
1663 #
1664 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07001665 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -07001666 # setting `Content-Type` to a particular media type when the
1667 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07001668 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07001669 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1670 # output only. It cannot be changed.
1671 #
1672 # The headers below cannot be set or overridden:
1673 #
1674 # * `Host`
1675 # * `X-Google-*`
1676 # * `X-AppEngine-*`
1677 #
1678 # In addition, Cloud Tasks sets some headers when the task is dispatched,
1679 # such as headers containing information about the task; see
1680 # [request
1681 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
1682 # These headers are set only when the task is dispatched, so they are not
1683 # visible when the task is returned in a Cloud Tasks response.
1684 #
1685 # Although there is no specific limit for the maximum number of headers or
1686 # the size, there is a limit on the maximum size of the Task. For more
1687 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07001688 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07001689 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001690 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001691 #
1692 # If set,
1693 # app_engine_routing_override
1694 # is used for all tasks in the queue, no matter what the setting is for the
1695 # task-level app_engine_routing.
1696 #
1697 # Defines routing characteristics specific to App Engine - service, version,
1698 # and instance.
1699 #
1700 # For more information about services, versions, and instances see
1701 # [An Overview of App
1702 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
1703 # [Microservices Architecture on Google App
1704 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
1705 # [App Engine Standard request
1706 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
1707 # and [App Engine Flex request
1708 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07001709 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001710 #
1711 # By default, the task is sent to an instance which is available when
1712 # the task is attempted.
1713 #
1714 # Requests can only be sent to a specific instance if
1715 # [manual scaling is used in App Engine
1716 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
1717 # App Engine Flex does not support instances. For more information, see
1718 # [App Engine Standard request
1719 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1720 # and [App Engine Flex request
1721 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07001722 &quot;version&quot;: &quot;A String&quot;, # App version.
1723 #
1724 # By default, the task is sent to the version which is the default
1725 # version when the task is attempted.
1726 #
1727 # For some queues or tasks which were created using the App Engine
1728 # Task Queue API, host is not parsable
1729 # into service,
1730 # version, and
1731 # instance. For example, some tasks
1732 # which were created using the App Engine SDK use a custom domain
1733 # name; custom domains are not parsed by Cloud Tasks. If
1734 # host is not parsable, then
1735 # service,
1736 # version, and
1737 # instance are the empty string.
1738 &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 -07001739 #
1740 # For more information, see
1741 # [How Requests are
1742 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
1743 #
1744 # The host is constructed as:
1745 #
1746 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001747 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07001748 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1749 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1750 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1751 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1752 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1753 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
1754 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001755 #
1756 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07001757 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07001758 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001759 # SDK use a custom domain name.
1760 #
1761 # * `service =` service
1762 #
1763 # * `version =` version
1764 #
1765 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001766 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001767 # service
1768 #
1769 # * `instance =` instance
1770 #
1771 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001772 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001773 # service
1774 #
1775 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001776 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001777 # version
1778 #
1779 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07001780 # instance `+ &#x27;.&#x27; +`
1781 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001782 # service
1783 #
1784 # If service is empty, then the task will be sent
1785 # to the service which is the default service when the task is attempted.
1786 #
1787 # If version is empty, then the task will be sent
1788 # to the version which is the default version when the task is attempted.
1789 #
1790 # If instance is empty, then the task
1791 # will be sent to an instance which is available when the task is
1792 # attempted.
1793 #
1794 # If service,
1795 # version, or
1796 # instance is invalid, then the task
1797 # will be sent to the default version of the default service when
1798 # the task is attempted.
Bu Sun Kim65020912020-05-20 12:08:20 -07001799 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001800 #
1801 # By default, the task is sent to the service which is the default
1802 # service when the task is attempted.
1803 #
1804 # For some queues or tasks which were created using the App Engine
1805 # Task Queue API, host is not parsable
1806 # into service,
1807 # version, and
1808 # instance. For example, some tasks
1809 # which were created using the App Engine SDK use a custom domain
1810 # name; custom domains are not parsed by Cloud Tasks. If
1811 # host is not parsable, then
1812 # service,
1813 # version, and
1814 # instance are the empty string.
1815 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001816 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001817 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
1818 # been returned.
1819 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
1820 # set only if pull_target is set on the queue.
1821 #
1822 # A pull task is a task that has PullMessage set.
1823 # LeaseTasks to process the task.
1824 #
1825 # This proto can only be used for tasks in a queue which has
1826 # pull_target set.
1827 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
1828 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
1829 #
1830 # Tags allow similar tasks to be processed in a batch. If you label
1831 # tasks with a tag, your worker can
1832 # lease tasks with the same tag using
1833 # filter. For example, if you want to
1834 # aggregate the events associated with a specific user once a day,
1835 # you could tag tasks with the user ID.
1836 #
1837 # The task&#x27;s tag can only be set when the
1838 # task is created.
1839 #
1840 # The tag must be less than 500 characters.
1841 #
1842 # SDK compatibility: Although the SDK allows tags to be either
1843 # string or
1844 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
1845 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
1846 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
1847 },
1848 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
1849 #
1850 # For App Engine queues, this is when the task will be attempted or retried.
1851 #
1852 # For pull queues, this is the time when the task is available to
1853 # be leased; if a task is currently leased, this is the time when
1854 # the current lease expires, that is, the time that the task was
1855 # leased plus the lease_duration.
1856 #
1857 # `schedule_time` will be truncated to the nearest microsecond.
1858 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
1859 #
1860 # `create_time` will be truncated to the nearest second.
1861 &quot;status&quot;: { # Status of the task. # Output only. The task status.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001862 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
1863 #
1864 # This field is not calculated for pull tasks.
1865 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1866 #
1867 # `response_time` will be truncated to the nearest microsecond.
1868 &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.
1869 #
1870 # If the task has not been attempted or the task is currently running
1871 # then the response status is unset.
1872 # different programming environments, including REST APIs and RPC APIs. It is
1873 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1874 # three pieces of data: error code, error message, and error details.
1875 #
1876 # You can find out more about this error model and how to work with it in the
1877 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1878 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1879 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1880 # user-facing error message should be localized and sent in the
1881 # google.rpc.Status.details field, or localized by the client.
1882 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1883 # message types for APIs to use.
1884 {
1885 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1886 },
1887 ],
1888 },
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 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1893 #
1894 # `dispatch_time` will be truncated to the nearest microsecond.
1895 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001896 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
1897 #
1898 # This count includes attempts which have been dispatched but haven&#x27;t
1899 # received a response.
1900 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
1901 #
1902 # Only dispatch_time will be set.
1903 # The other AttemptStatus information is not retained by Cloud Tasks.
1904 #
1905 # This field is not calculated for pull tasks.
1906 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1907 #
1908 # `response_time` will be truncated to the nearest microsecond.
1909 &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.
1910 #
1911 # If the task has not been attempted or the task is currently running
1912 # then the response status is unset.
1913 # different programming environments, including REST APIs and RPC APIs. It is
1914 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1915 # three pieces of data: error code, error message, and error details.
1916 #
1917 # You can find out more about this error model and how to work with it in the
1918 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07001919 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1920 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1921 # user-facing error message should be localized and sent in the
1922 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -07001923 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1924 # message types for APIs to use.
1925 {
1926 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1927 },
1928 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07001929 },
1930 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1931 #
1932 # `schedule_time` will be truncated to the nearest microsecond.
1933 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1934 #
1935 # `dispatch_time` will be truncated to the nearest microsecond.
1936 },
1937 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
1938 #
1939 # This field is not calculated for pull tasks.
Bu Sun Kim65020912020-05-20 12:08:20 -07001940 },
1941 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001942 #
1943 # The task name.
1944 #
1945 # The task name must have the following format:
1946 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1947 #
1948 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1949 # hyphens (-), colons (:), or periods (.).
1950 # For more information, see
1951 # [Identifying
1952 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
Bu Sun Kim65020912020-05-20 12:08:20 -07001953 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001954 # The list of available locations can be obtained by calling
1955 # ListLocations.
1956 # For more information, see https://cloud.google.com/about/locations/.
1957 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1958 # hyphens (-). The maximum length is 100 characters.
1959 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1960 # hyphens (-), or underscores (_). The maximum length is 500 characters.
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 Kim65020912020-05-20 12:08:20 -07002008 &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 -07002009 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002010 # When `filter` is set to `tag=&lt;my-tag&gt;` then the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002011 # response will contain only tasks whose
Dan O'Mearadd494642020-05-01 07:42:23 -07002012 # tag is equal to `&lt;my-tag&gt;`. `&lt;my-tag&gt;` must be
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002013 # less than 500 characters.
2014 #
2015 # When `filter` is set to `tag_function=oldest_tag()`, only tasks which have
2016 # the same tag as the task with the oldest
2017 # schedule_time will be returned.
2018 #
2019 # Grammar Syntax:
2020 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002021 # * `filter = &quot;tag=&quot; tag | &quot;tag_function=&quot; function`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002022 #
2023 # * `tag = string`
2024 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002025 # * `function = &quot;oldest_tag()&quot;`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002026 #
2027 # The `oldest_tag()` function returns tasks which have the same tag as the
2028 # oldest task (ordered by schedule time).
2029 #
2030 # SDK compatibility: Although the SDK allows tags to be either
2031 # string or
2032 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
2033 # only UTF-8 encoded tags can be used in Cloud Tasks. Tag which
Bu Sun Kim65020912020-05-20 12:08:20 -07002034 # aren&#x27;t UTF-8 encoded can&#x27;t be used in the
2035 # filter and the task&#x27;s
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002036 # tag will be displayed as empty in Cloud Tasks.
Bu Sun Kim65020912020-05-20 12:08:20 -07002037 &quot;maxTasks&quot;: 42, # The maximum number of tasks to lease.
Dan O'Mearadd494642020-05-01 07:42:23 -07002038 #
2039 # The system will make a best effort to return as close to as
2040 # `max_tasks` as possible.
2041 #
2042 # The largest that `max_tasks` can be is 1000.
2043 #
2044 # The maximum total size of a lease tasks response is
2045 # 32 MB. If the sum of all task sizes requested reaches this limit,
2046 # fewer tasks than requested are returned.
Bu Sun Kim65020912020-05-20 12:08:20 -07002047 &quot;leaseDuration&quot;: &quot;A String&quot;, # Required. The duration of the lease.
Dan O'Mearadd494642020-05-01 07:42:23 -07002048 #
2049 # Each task returned in the response will
2050 # have its schedule_time set to the current
2051 # time plus the `lease_duration`. The task is leased until its
2052 # schedule_time; thus, the task will not be
2053 # returned to another LeaseTasks call
2054 # before its schedule_time.
2055 #
2056 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002057 # After the worker has successfully finished the work associated
2058 # with the task, the worker must call via
2059 # AcknowledgeTask before the
2060 # schedule_time. Otherwise the task will be
2061 # returned to a later LeaseTasks call so
2062 # that another worker can retry it.
2063 #
2064 # The maximum lease duration is 1 week.
2065 # `lease_duration` will be truncated to the nearest second.
2066 }
2067
2068 x__xgafv: string, V1 error format.
2069 Allowed values
2070 1 - v1 error format
2071 2 - v2 error format
2072
2073Returns:
2074 An object of the form:
2075
2076 { # Response message for leasing tasks using LeaseTasks.
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;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002149 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002150 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
2151 # HTTP requests with this http_method, otherwise the task attempt fails with
2152 # error code 405 (Method Not Allowed). See [Writing a push task request
2153 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
2154 # and the App Engine documentation for your runtime on [How Requests are
2155 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
2156 &quot;payload&quot;: &quot;A String&quot;, # Payload.
2157 #
2158 # The payload will be sent as the HTTP message body. A message
2159 # body, and thus a payload, is allowed only if the HTTP method is
2160 # POST or PUT. It is an error to set a data payload on a task with
2161 # an incompatible HttpMethod.
2162 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
2163 #
2164 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002165 # It can contain a path and query string arguments.
Bu Sun Kim65020912020-05-20 12:08:20 -07002166 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002167 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07002168 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002169 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002170 # This map contains the header field names and values.
2171 # Headers can be set when the
2172 # task is created.
2173 # Repeated headers are not supported but a header value can contain commas.
2174 #
2175 # Cloud Tasks sets some headers to default values:
2176 #
2177 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07002178 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07002179 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07002180 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -07002181 # modified `User-Agent`.
2182 #
2183 # If the task has a payload, Cloud
2184 # Tasks sets the following headers:
2185 #
2186 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07002187 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -07002188 # setting `Content-Type` to a particular media type when the
2189 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07002190 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07002191 # * `Content-Length`: This is computed by Cloud Tasks. This value is
2192 # output only. It cannot be changed.
2193 #
2194 # The headers below cannot be set or overridden:
2195 #
2196 # * `Host`
2197 # * `X-Google-*`
2198 # * `X-AppEngine-*`
2199 #
2200 # In addition, Cloud Tasks sets some headers when the task is dispatched,
2201 # such as headers containing information about the task; see
2202 # [request
2203 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
2204 # These headers are set only when the task is dispatched, so they are not
2205 # visible when the task is returned in a Cloud Tasks response.
2206 #
2207 # Although there is no specific limit for the maximum number of headers or
2208 # the size, there is a limit on the maximum size of the Task. For more
2209 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07002210 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07002211 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002212 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002213 #
2214 # If set,
2215 # app_engine_routing_override
2216 # is used for all tasks in the queue, no matter what the setting is for the
2217 # task-level app_engine_routing.
2218 #
2219 # Defines routing characteristics specific to App Engine - service, version,
2220 # and instance.
2221 #
2222 # For more information about services, versions, and instances see
2223 # [An Overview of App
2224 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
2225 # [Microservices Architecture on Google App
2226 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
2227 # [App Engine Standard request
2228 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
2229 # and [App Engine Flex request
2230 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07002231 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002232 #
2233 # By default, the task is sent to an instance which is available when
2234 # the task is attempted.
2235 #
2236 # Requests can only be sent to a specific instance if
2237 # [manual scaling is used in App Engine
2238 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
2239 # App Engine Flex does not support instances. For more information, see
2240 # [App Engine Standard request
2241 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2242 # and [App Engine Flex request
2243 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07002244 &quot;version&quot;: &quot;A String&quot;, # App version.
2245 #
2246 # By default, the task is sent to the version which is the default
2247 # version when the task is attempted.
2248 #
2249 # For some queues or tasks which were created using the App Engine
2250 # Task Queue API, host is not parsable
2251 # into service,
2252 # version, and
2253 # instance. For example, some tasks
2254 # which were created using the App Engine SDK use a custom domain
2255 # name; custom domains are not parsed by Cloud Tasks. If
2256 # host is not parsable, then
2257 # service,
2258 # version, and
2259 # instance are the empty string.
2260 &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 -07002261 #
2262 # For more information, see
2263 # [How Requests are
2264 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
2265 #
2266 # The host is constructed as:
2267 #
2268 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002269 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07002270 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2271 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2272 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2273 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2274 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2275 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2276 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002277 #
2278 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07002279 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07002280 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002281 # SDK use a custom domain name.
2282 #
2283 # * `service =` service
2284 #
2285 # * `version =` version
2286 #
2287 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002288 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002289 # service
2290 #
2291 # * `instance =` instance
2292 #
2293 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002294 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002295 # service
2296 #
2297 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002298 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002299 # version
2300 #
2301 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002302 # instance `+ &#x27;.&#x27; +`
2303 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002304 # service
2305 #
2306 # If service is empty, then the task will be sent
2307 # to the service which is the default service when the task is attempted.
2308 #
2309 # If version is empty, then the task will be sent
2310 # to the version which is the default version when the task is attempted.
2311 #
2312 # If instance is empty, then the task
2313 # will be sent to an instance which is available when the task is
2314 # attempted.
2315 #
2316 # If service,
2317 # version, or
2318 # instance is invalid, then the task
2319 # will be sent to the default version of the default service when
2320 # the task is attempted.
Bu Sun Kim65020912020-05-20 12:08:20 -07002321 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002322 #
2323 # By default, the task is sent to the service which is the default
2324 # service when the task is attempted.
2325 #
2326 # For some queues or tasks which were created using the App Engine
2327 # Task Queue API, host is not parsable
2328 # into service,
2329 # version, and
2330 # instance. For example, some tasks
2331 # which were created using the App Engine SDK use a custom domain
2332 # name; custom domains are not parsed by Cloud Tasks. If
2333 # host is not parsable, then
2334 # service,
2335 # version, and
2336 # instance are the empty string.
2337 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002338 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002339 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
2340 # been returned.
2341 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
2342 # set only if pull_target is set on the queue.
2343 #
2344 # A pull task is a task that has PullMessage set.
2345 # LeaseTasks to process the task.
2346 #
2347 # This proto can only be used for tasks in a queue which has
2348 # pull_target set.
2349 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
2350 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
2351 #
2352 # Tags allow similar tasks to be processed in a batch. If you label
2353 # tasks with a tag, your worker can
2354 # lease tasks with the same tag using
2355 # filter. For example, if you want to
2356 # aggregate the events associated with a specific user once a day,
2357 # you could tag tasks with the user ID.
2358 #
2359 # The task&#x27;s tag can only be set when the
2360 # task is created.
2361 #
2362 # The tag must be less than 500 characters.
2363 #
2364 # SDK compatibility: Although the SDK allows tags to be either
2365 # string or
2366 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
2367 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
2368 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
2369 },
2370 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
2371 #
2372 # For App Engine queues, this is when the task will be attempted or retried.
2373 #
2374 # For pull queues, this is the time when the task is available to
2375 # be leased; if a task is currently leased, this is the time when
2376 # the current lease expires, that is, the time that the task was
2377 # leased plus the lease_duration.
2378 #
2379 # `schedule_time` will be truncated to the nearest microsecond.
2380 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
2381 #
2382 # `create_time` will be truncated to the nearest second.
2383 &quot;status&quot;: { # Status of the task. # Output only. The task status.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002384 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
2385 #
2386 # This field is not calculated for pull tasks.
2387 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2388 #
2389 # `response_time` will be truncated to the nearest microsecond.
2390 &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.
2391 #
2392 # If the task has not been attempted or the task is currently running
2393 # then the response status is unset.
2394 # different programming environments, including REST APIs and RPC APIs. It is
2395 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2396 # three pieces of data: error code, error message, and error details.
2397 #
2398 # You can find out more about this error model and how to work with it in the
2399 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2400 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2401 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2402 # user-facing error message should be localized and sent in the
2403 # google.rpc.Status.details field, or localized by the client.
2404 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2405 # message types for APIs to use.
2406 {
2407 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2408 },
2409 ],
2410 },
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 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2415 #
2416 # `dispatch_time` will be truncated to the nearest microsecond.
2417 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002418 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
2419 #
2420 # This count includes attempts which have been dispatched but haven&#x27;t
2421 # received a response.
2422 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
2423 #
2424 # Only dispatch_time will be set.
2425 # The other AttemptStatus information is not retained by Cloud Tasks.
2426 #
2427 # This field is not calculated for pull tasks.
2428 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2429 #
2430 # `response_time` will be truncated to the nearest microsecond.
2431 &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.
2432 #
2433 # If the task has not been attempted or the task is currently running
2434 # then the response status is unset.
2435 # different programming environments, including REST APIs and RPC APIs. It is
2436 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2437 # three pieces of data: error code, error message, and error details.
2438 #
2439 # You can find out more about this error model and how to work with it in the
2440 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002441 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2442 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2443 # user-facing error message should be localized and sent in the
2444 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -07002445 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2446 # message types for APIs to use.
2447 {
2448 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2449 },
2450 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002451 },
2452 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
2453 #
2454 # `schedule_time` will be truncated to the nearest microsecond.
2455 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2456 #
2457 # `dispatch_time` will be truncated to the nearest microsecond.
2458 },
2459 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
2460 #
2461 # This field is not calculated for pull tasks.
Bu Sun Kim65020912020-05-20 12:08:20 -07002462 },
2463 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002464 #
2465 # The task name.
2466 #
2467 # The task name must have the following format:
2468 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
2469 #
2470 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
2471 # hyphens (-), colons (:), or periods (.).
2472 # For more information, see
2473 # [Identifying
2474 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
Bu Sun Kim65020912020-05-20 12:08:20 -07002475 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002476 # The list of available locations can be obtained by calling
2477 # ListLocations.
2478 # For more information, see https://cloud.google.com/about/locations/.
2479 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
2480 # hyphens (-). The maximum length is 100 characters.
2481 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
2482 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002483 },
2484 ],
2485 }</pre>
2486</div>
2487
2488<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -07002489 <code class="details" id="list">list(parent, responseView=None, pageToken=None, pageSize=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)
2503 responseView: string, The response_view specifies which subset of the Task will be
2504returned.
2505
2506By default response_view is BASIC; not all
2507information is retrieved by default because some data, such as
2508payloads, might be desirable to return only when needed because
2509of its large size or because of the sensitivity of data that it
2510contains.
2511
2512Authorization for FULL requires
2513`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
2514permission on the Task resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002515 pageToken: string, A token identifying the page of results to return.
2516
2517To request the first page results, page_token must be empty. To
2518request the next page of results, page_token must be the value of
2519next_page_token returned
2520from the previous call to ListTasks
2521method.
2522
2523The page token is valid for only 2 hours.
Dan O'Mearadd494642020-05-01 07:42:23 -07002524 pageSize: integer, Maximum page size.
2525
2526Fewer tasks than requested might be returned, even if more tasks exist; use
2527next_page_token in the response to
2528determine if more tasks exist.
2529
2530The maximum page size is 1000. If unspecified, the page size will be the
2531maximum.
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 Kim65020912020-05-20 12:08:20 -07002541 &quot;tasks&quot;: [ # The list of tasks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002542 { # A unit of scheduled work.
Bu Sun Kim65020912020-05-20 12:08:20 -07002543 &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 -07002544 # be set only if
2545 # app_engine_http_target is set
2546 # on the queue.
2547 #
2548 # An App Engine task is a task that has AppEngineHttpRequest set.
2549 #
2550 # The message defines the HTTP request that is sent to an App Engine app when
2551 # the task is dispatched.
2552 #
2553 # This proto can only be used for tasks in a queue which has
2554 # app_engine_http_target set.
2555 #
2556 # Using AppEngineHttpRequest requires
2557 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
2558 # Google IAM permission for the project
2559 # and the following scope:
2560 #
2561 # `https://www.googleapis.com/auth/cloud-platform`
2562 #
2563 # The task will be delivered to the App Engine app which belongs to the same
2564 # project as the queue. For more information, see
2565 # [How Requests are
2566 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2567 # and how routing is affected by
2568 # [dispatch
2569 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
2570 # Traffic is encrypted during transport and never leaves Google datacenters.
2571 # Because this traffic is carried over a communication mechanism internal to
2572 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
2573 # The request to the handler, however, will appear to have used the HTTP
2574 # protocol.
2575 #
2576 # The AppEngineRouting used to construct the URL that the task is
2577 # delivered to can be set at the queue-level or task-level:
2578 #
2579 # * If set,
Dan O'Mearadd494642020-05-01 07:42:23 -07002580 # app_engine_routing_override
2581 # is used for all tasks in the queue, no matter what the setting
2582 # is for the
2583 # task-level app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002584 #
2585 #
2586 # The `url` that the task will be sent to is:
2587 #
2588 # * `url =` host `+`
2589 # relative_url
2590 #
2591 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
2592 # URIs restricted with
2593 # [`login:
2594 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
2595 # Because tasks are not run as any user, they cannot be dispatched to URIs
2596 # restricted with
2597 # [`login:
2598 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
2599 # Task dispatches also do not follow redirects.
2600 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002601 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002602 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07002603 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002604 # not receive response before the deadline. Failed
2605 # tasks will be retried according to the
2606 # retry configuration. `503` (Service Unavailable) is
2607 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07002608 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
2609 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002610 # Requests) response from an app handler does not cause traffic congestion
2611 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -07002612 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002613 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002614 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
2615 # HTTP requests with this http_method, otherwise the task attempt fails with
2616 # error code 405 (Method Not Allowed). See [Writing a push task request
2617 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
2618 # and the App Engine documentation for your runtime on [How Requests are
2619 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
2620 &quot;payload&quot;: &quot;A String&quot;, # Payload.
2621 #
2622 # The payload will be sent as the HTTP message body. A message
2623 # body, and thus a payload, is allowed only if the HTTP method is
2624 # POST or PUT. It is an error to set a data payload on a task with
2625 # an incompatible HttpMethod.
2626 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
2627 #
2628 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002629 # It can contain a path and query string arguments.
Bu Sun Kim65020912020-05-20 12:08:20 -07002630 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002631 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07002632 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002633 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002634 # This map contains the header field names and values.
2635 # Headers can be set when the
2636 # task is created.
2637 # Repeated headers are not supported but a header value can contain commas.
2638 #
2639 # Cloud Tasks sets some headers to default values:
2640 #
2641 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07002642 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07002643 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07002644 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -07002645 # modified `User-Agent`.
2646 #
2647 # If the task has a payload, Cloud
2648 # Tasks sets the following headers:
2649 #
2650 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07002651 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -07002652 # setting `Content-Type` to a particular media type when the
2653 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07002654 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07002655 # * `Content-Length`: This is computed by Cloud Tasks. This value is
2656 # output only. It cannot be changed.
2657 #
2658 # The headers below cannot be set or overridden:
2659 #
2660 # * `Host`
2661 # * `X-Google-*`
2662 # * `X-AppEngine-*`
2663 #
2664 # In addition, Cloud Tasks sets some headers when the task is dispatched,
2665 # such as headers containing information about the task; see
2666 # [request
2667 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
2668 # These headers are set only when the task is dispatched, so they are not
2669 # visible when the task is returned in a Cloud Tasks response.
2670 #
2671 # Although there is no specific limit for the maximum number of headers or
2672 # the size, there is a limit on the maximum size of the Task. For more
2673 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07002674 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07002675 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002676 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002677 #
2678 # If set,
2679 # app_engine_routing_override
2680 # is used for all tasks in the queue, no matter what the setting is for the
2681 # task-level app_engine_routing.
2682 #
2683 # Defines routing characteristics specific to App Engine - service, version,
2684 # and instance.
2685 #
2686 # For more information about services, versions, and instances see
2687 # [An Overview of App
2688 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
2689 # [Microservices Architecture on Google App
2690 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
2691 # [App Engine Standard request
2692 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
2693 # and [App Engine Flex request
2694 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07002695 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002696 #
2697 # By default, the task is sent to an instance which is available when
2698 # the task is attempted.
2699 #
2700 # Requests can only be sent to a specific instance if
2701 # [manual scaling is used in App Engine
2702 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
2703 # App Engine Flex does not support instances. For more information, see
2704 # [App Engine Standard request
2705 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2706 # and [App Engine Flex request
2707 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07002708 &quot;version&quot;: &quot;A String&quot;, # App version.
2709 #
2710 # By default, the task is sent to the version which is the default
2711 # version when the task is attempted.
2712 #
2713 # For some queues or tasks which were created using the App Engine
2714 # Task Queue API, host is not parsable
2715 # into service,
2716 # version, and
2717 # instance. For example, some tasks
2718 # which were created using the App Engine SDK use a custom domain
2719 # name; custom domains are not parsed by Cloud Tasks. If
2720 # host is not parsable, then
2721 # service,
2722 # version, and
2723 # instance are the empty string.
2724 &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 -07002725 #
2726 # For more information, see
2727 # [How Requests are
2728 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
2729 #
2730 # The host is constructed as:
2731 #
2732 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002733 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07002734 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2735 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2736 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2737 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2738 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2739 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
2740 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002741 #
2742 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07002743 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07002744 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002745 # SDK use a custom domain name.
2746 #
2747 # * `service =` service
2748 #
2749 # * `version =` version
2750 #
2751 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002752 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002753 # service
2754 #
2755 # * `instance =` instance
2756 #
2757 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002758 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002759 # service
2760 #
2761 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002762 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002763 # version
2764 #
2765 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07002766 # instance `+ &#x27;.&#x27; +`
2767 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002768 # service
2769 #
2770 # If service is empty, then the task will be sent
2771 # to the service which is the default service when the task is attempted.
2772 #
2773 # If version is empty, then the task will be sent
2774 # to the version which is the default version when the task is attempted.
2775 #
2776 # If instance is empty, then the task
2777 # will be sent to an instance which is available when the task is
2778 # attempted.
2779 #
2780 # If service,
2781 # version, or
2782 # instance is invalid, then the task
2783 # will be sent to the default version of the default service when
2784 # the task is attempted.
Bu Sun Kim65020912020-05-20 12:08:20 -07002785 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002786 #
2787 # By default, the task is sent to the service which is the default
2788 # service when the task is attempted.
2789 #
2790 # For some queues or tasks which were created using the App Engine
2791 # Task Queue API, host is not parsable
2792 # into service,
2793 # version, and
2794 # instance. For example, some tasks
2795 # which were created using the App Engine SDK use a custom domain
2796 # name; custom domains are not parsed by Cloud Tasks. If
2797 # host is not parsable, then
2798 # service,
2799 # version, and
2800 # instance are the empty string.
2801 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002802 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002803 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
2804 # been returned.
2805 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
2806 # set only if pull_target is set on the queue.
2807 #
2808 # A pull task is a task that has PullMessage set.
2809 # LeaseTasks to process the task.
2810 #
2811 # This proto can only be used for tasks in a queue which has
2812 # pull_target set.
2813 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
2814 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
2815 #
2816 # Tags allow similar tasks to be processed in a batch. If you label
2817 # tasks with a tag, your worker can
2818 # lease tasks with the same tag using
2819 # filter. For example, if you want to
2820 # aggregate the events associated with a specific user once a day,
2821 # you could tag tasks with the user ID.
2822 #
2823 # The task&#x27;s tag can only be set when the
2824 # task is created.
2825 #
2826 # The tag must be less than 500 characters.
2827 #
2828 # SDK compatibility: Although the SDK allows tags to be either
2829 # string or
2830 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
2831 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
2832 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
2833 },
2834 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
2835 #
2836 # For App Engine queues, this is when the task will be attempted or retried.
2837 #
2838 # For pull queues, this is the time when the task is available to
2839 # be leased; if a task is currently leased, this is the time when
2840 # the current lease expires, that is, the time that the task was
2841 # leased plus the lease_duration.
2842 #
2843 # `schedule_time` will be truncated to the nearest microsecond.
2844 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
2845 #
2846 # `create_time` will be truncated to the nearest second.
2847 &quot;status&quot;: { # Status of the task. # Output only. The task status.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002848 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
2849 #
2850 # This field is not calculated for pull tasks.
2851 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2852 #
2853 # `response_time` will be truncated to the nearest microsecond.
2854 &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.
2855 #
2856 # If the task has not been attempted or the task is currently running
2857 # then the response status is unset.
2858 # different programming environments, including REST APIs and RPC APIs. It is
2859 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2860 # three pieces of data: error code, error message, and error details.
2861 #
2862 # You can find out more about this error model and how to work with it in the
2863 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2864 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2865 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2866 # user-facing error message should be localized and sent in the
2867 # google.rpc.Status.details field, or localized by the client.
2868 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2869 # message types for APIs to use.
2870 {
2871 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2872 },
2873 ],
2874 },
2875 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
2876 #
2877 # `schedule_time` will be truncated to the nearest microsecond.
2878 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2879 #
2880 # `dispatch_time` will be truncated to the nearest microsecond.
2881 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002882 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
2883 #
2884 # This count includes attempts which have been dispatched but haven&#x27;t
2885 # received a response.
2886 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
2887 #
2888 # Only dispatch_time will be set.
2889 # The other AttemptStatus information is not retained by Cloud Tasks.
2890 #
2891 # This field is not calculated for pull tasks.
2892 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2893 #
2894 # `response_time` will be truncated to the nearest microsecond.
2895 &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.
2896 #
2897 # If the task has not been attempted or the task is currently running
2898 # then the response status is unset.
2899 # different programming environments, including REST APIs and RPC APIs. It is
2900 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2901 # three pieces of data: error code, error message, and error details.
2902 #
2903 # You can find out more about this error model and how to work with it in the
2904 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07002905 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2906 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2907 # user-facing error message should be localized and sent in the
2908 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -07002909 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2910 # message types for APIs to use.
2911 {
2912 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2913 },
2914 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002915 },
2916 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
2917 #
2918 # `schedule_time` will be truncated to the nearest microsecond.
2919 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2920 #
2921 # `dispatch_time` will be truncated to the nearest microsecond.
2922 },
2923 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
2924 #
2925 # This field is not calculated for pull tasks.
Bu Sun Kim65020912020-05-20 12:08:20 -07002926 },
2927 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002928 #
2929 # The task name.
2930 #
2931 # The task name must have the following format:
2932 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
2933 #
2934 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
2935 # hyphens (-), colons (:), or periods (.).
2936 # For more information, see
2937 # [Identifying
2938 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
Bu Sun Kim65020912020-05-20 12:08:20 -07002939 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002940 # The list of available locations can be obtained by calling
2941 # ListLocations.
2942 # For more information, see https://cloud.google.com/about/locations/.
2943 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
2944 # hyphens (-). The maximum length is 100 characters.
2945 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
2946 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002947 },
2948 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002949 &quot;nextPageToken&quot;: &quot;A String&quot;, # A token to retrieve next page of results.
2950 #
2951 # To return the next page of results, call
2952 # ListTasks with this value as the
2953 # page_token.
2954 #
2955 # If the next_page_token is empty, there are no more results.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002956 }</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;scheduleTime&quot;: &quot;A String&quot;, # Required. The task&#x27;s current schedule time, available in the
3002 # schedule_time returned by
3003 # LeaseTasks response or
3004 # RenewLease response. This restriction is
3005 # to ensure that your worker currently holds the lease.
3006 &quot;leaseDuration&quot;: &quot;A String&quot;, # Required. The desired new lease duration, starting from now.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003007 #
3008 #
3009 # The maximum lease duration is 1 week.
3010 # `lease_duration` will be truncated to the nearest second.
3011 }
3012
3013 x__xgafv: string, V1 error format.
3014 Allowed values
3015 1 - v1 error format
3016 2 - v2 error format
3017
3018Returns:
3019 An object of the form:
3020
3021 { # A unit of scheduled work.
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;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003092 #
Bu Sun Kim65020912020-05-20 12:08:20 -07003093 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
3094 # HTTP requests with this http_method, otherwise the task attempt fails with
3095 # error code 405 (Method Not Allowed). See [Writing a push task request
3096 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
3097 # and the App Engine documentation for your runtime on [How Requests are
3098 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
3099 &quot;payload&quot;: &quot;A String&quot;, # Payload.
3100 #
3101 # The payload will be sent as the HTTP message body. A message
3102 # body, and thus a payload, is allowed only if the HTTP method is
3103 # POST or PUT. It is an error to set a data payload on a task with
3104 # an incompatible HttpMethod.
3105 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
3106 #
3107 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003108 # It can contain a path and query string arguments.
Bu Sun Kim65020912020-05-20 12:08:20 -07003109 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003110 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07003111 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003112 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003113 # This map contains the header field names and values.
3114 # Headers can be set when the
3115 # task is created.
3116 # Repeated headers are not supported but a header value can contain commas.
3117 #
3118 # Cloud Tasks sets some headers to default values:
3119 #
3120 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07003121 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07003122 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07003123 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -07003124 # modified `User-Agent`.
3125 #
3126 # If the task has a payload, Cloud
3127 # Tasks sets the following headers:
3128 #
3129 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07003130 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -07003131 # setting `Content-Type` to a particular media type when the
3132 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07003133 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07003134 # * `Content-Length`: This is computed by Cloud Tasks. This value is
3135 # output only. It cannot be changed.
3136 #
3137 # The headers below cannot be set or overridden:
3138 #
3139 # * `Host`
3140 # * `X-Google-*`
3141 # * `X-AppEngine-*`
3142 #
3143 # In addition, Cloud Tasks sets some headers when the task is dispatched,
3144 # such as headers containing information about the task; see
3145 # [request
3146 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
3147 # These headers are set only when the task is dispatched, so they are not
3148 # visible when the task is returned in a Cloud Tasks response.
3149 #
3150 # Although there is no specific limit for the maximum number of headers or
3151 # the size, there is a limit on the maximum size of the Task. For more
3152 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07003153 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07003154 },
Bu Sun Kim65020912020-05-20 12:08:20 -07003155 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003156 #
3157 # If set,
3158 # app_engine_routing_override
3159 # is used for all tasks in the queue, no matter what the setting is for the
3160 # task-level app_engine_routing.
3161 #
3162 # Defines routing characteristics specific to App Engine - service, version,
3163 # and instance.
3164 #
3165 # For more information about services, versions, and instances see
3166 # [An Overview of App
3167 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
3168 # [Microservices Architecture on Google App
3169 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
3170 # [App Engine Standard request
3171 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
3172 # and [App Engine Flex request
3173 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07003174 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003175 #
3176 # By default, the task is sent to an instance which is available when
3177 # the task is attempted.
3178 #
3179 # Requests can only be sent to a specific instance if
3180 # [manual scaling is used in App Engine
3181 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
3182 # App Engine Flex does not support instances. For more information, see
3183 # [App Engine Standard request
3184 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
3185 # and [App Engine Flex request
3186 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07003187 &quot;version&quot;: &quot;A String&quot;, # App version.
3188 #
3189 # By default, the task is sent to the version which is the default
3190 # version when the task is attempted.
3191 #
3192 # For some queues or tasks which were created using the App Engine
3193 # Task Queue API, host is not parsable
3194 # into service,
3195 # version, and
3196 # instance. For example, some tasks
3197 # which were created using the App Engine SDK use a custom domain
3198 # name; custom domains are not parsed by Cloud Tasks. If
3199 # host is not parsable, then
3200 # service,
3201 # version, and
3202 # instance are the empty string.
3203 &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 -07003204 #
3205 # For more information, see
3206 # [How Requests are
3207 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
3208 #
3209 # The host is constructed as:
3210 #
3211 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003212 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07003213 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3214 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3215 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3216 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3217 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3218 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3219 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003220 #
3221 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07003222 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07003223 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003224 # SDK use a custom domain name.
3225 #
3226 # * `service =` service
3227 #
3228 # * `version =` version
3229 #
3230 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003231 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003232 # service
3233 #
3234 # * `instance =` instance
3235 #
3236 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003237 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003238 # service
3239 #
3240 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003241 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003242 # version
3243 #
3244 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003245 # instance `+ &#x27;.&#x27; +`
3246 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003247 # service
3248 #
3249 # If service is empty, then the task will be sent
3250 # to the service which is the default service when the task is attempted.
3251 #
3252 # If version is empty, then the task will be sent
3253 # to the version which is the default version when the task is attempted.
3254 #
3255 # If instance is empty, then the task
3256 # will be sent to an instance which is available when the task is
3257 # attempted.
3258 #
3259 # If service,
3260 # version, or
3261 # instance is invalid, then the task
3262 # will be sent to the default version of the default service when
3263 # the task is attempted.
Bu Sun Kim65020912020-05-20 12:08:20 -07003264 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003265 #
3266 # By default, the task is sent to the service which is the default
3267 # service when the task is attempted.
3268 #
3269 # For some queues or tasks which were created using the App Engine
3270 # Task Queue API, host is not parsable
3271 # into service,
3272 # version, and
3273 # instance. For example, some tasks
3274 # which were created using the App Engine SDK use a custom domain
3275 # name; custom domains are not parsed by Cloud Tasks. If
3276 # host is not parsable, then
3277 # service,
3278 # version, and
3279 # instance are the empty string.
3280 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003281 },
Bu Sun Kim65020912020-05-20 12:08:20 -07003282 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
3283 # been returned.
3284 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
3285 # set only if pull_target is set on the queue.
3286 #
3287 # A pull task is a task that has PullMessage set.
3288 # LeaseTasks to process the task.
3289 #
3290 # This proto can only be used for tasks in a queue which has
3291 # pull_target set.
3292 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
3293 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
3294 #
3295 # Tags allow similar tasks to be processed in a batch. If you label
3296 # tasks with a tag, your worker can
3297 # lease tasks with the same tag using
3298 # filter. For example, if you want to
3299 # aggregate the events associated with a specific user once a day,
3300 # you could tag tasks with the user ID.
3301 #
3302 # The task&#x27;s tag can only be set when the
3303 # task is created.
3304 #
3305 # The tag must be less than 500 characters.
3306 #
3307 # SDK compatibility: Although the SDK allows tags to be either
3308 # string or
3309 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
3310 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
3311 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
3312 },
3313 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
3314 #
3315 # For App Engine queues, this is when the task will be attempted or retried.
3316 #
3317 # For pull queues, this is the time when the task is available to
3318 # be leased; if a task is currently leased, this is the time when
3319 # the current lease expires, that is, the time that the task was
3320 # leased plus the lease_duration.
3321 #
3322 # `schedule_time` will be truncated to the nearest microsecond.
3323 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
3324 #
3325 # `create_time` will be truncated to the nearest second.
3326 &quot;status&quot;: { # Status of the task. # Output only. The task status.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07003327 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
3328 #
3329 # This field is not calculated for pull tasks.
3330 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
3331 #
3332 # `response_time` will be truncated to the nearest microsecond.
3333 &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.
3334 #
3335 # If the task has not been attempted or the task is currently running
3336 # then the response status is unset.
3337 # different programming environments, including REST APIs and RPC APIs. It is
3338 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3339 # three pieces of data: error code, error message, and error details.
3340 #
3341 # You can find out more about this error model and how to work with it in the
3342 # [API Design Guide](https://cloud.google.com/apis/design/errors).
3343 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
3344 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
3345 # user-facing error message should be localized and sent in the
3346 # google.rpc.Status.details field, or localized by the client.
3347 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
3348 # message types for APIs to use.
3349 {
3350 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
3351 },
3352 ],
3353 },
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 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
3358 #
3359 # `dispatch_time` will be truncated to the nearest microsecond.
3360 },
Bu Sun Kim65020912020-05-20 12:08:20 -07003361 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
3362 #
3363 # This count includes attempts which have been dispatched but haven&#x27;t
3364 # received a response.
3365 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
3366 #
3367 # Only dispatch_time will be set.
3368 # The other AttemptStatus information is not retained by Cloud Tasks.
3369 #
3370 # This field is not calculated for pull tasks.
3371 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
3372 #
3373 # `response_time` will be truncated to the nearest microsecond.
3374 &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.
3375 #
3376 # If the task has not been attempted or the task is currently running
3377 # then the response status is unset.
3378 # different programming environments, including REST APIs and RPC APIs. It is
3379 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3380 # three pieces of data: error code, error message, and error details.
3381 #
3382 # You can find out more about this error model and how to work with it in the
3383 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07003384 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
3385 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
3386 # user-facing error message should be localized and sent in the
3387 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -07003388 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
3389 # message types for APIs to use.
3390 {
3391 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
3392 },
3393 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07003394 },
3395 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
3396 #
3397 # `schedule_time` will be truncated to the nearest microsecond.
3398 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
3399 #
3400 # `dispatch_time` will be truncated to the nearest microsecond.
3401 },
3402 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
3403 #
3404 # This field is not calculated for pull tasks.
Bu Sun Kim65020912020-05-20 12:08:20 -07003405 },
3406 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003407 #
3408 # The task name.
3409 #
3410 # The task name must have the following format:
3411 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
3412 #
3413 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
3414 # hyphens (-), colons (:), or periods (.).
3415 # For more information, see
3416 # [Identifying
3417 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
Bu Sun Kim65020912020-05-20 12:08:20 -07003418 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003419 # The list of available locations can be obtained by calling
3420 # ListLocations.
3421 # For more information, see https://cloud.google.com/about/locations/.
3422 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
3423 # hyphens (-). The maximum length is 100 characters.
3424 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
3425 # hyphens (-), or underscores (_). The maximum length is 500 characters.
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;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003560 #
Bu Sun Kim65020912020-05-20 12:08:20 -07003561 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
3562 # HTTP requests with this http_method, otherwise the task attempt fails with
3563 # error code 405 (Method Not Allowed). See [Writing a push task request
3564 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
3565 # and the App Engine documentation for your runtime on [How Requests are
3566 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
3567 &quot;payload&quot;: &quot;A String&quot;, # Payload.
3568 #
3569 # The payload will be sent as the HTTP message body. A message
3570 # body, and thus a payload, is allowed only if the HTTP method is
3571 # POST or PUT. It is an error to set a data payload on a task with
3572 # an incompatible HttpMethod.
3573 &quot;relativeUrl&quot;: &quot;A String&quot;, # The relative URL.
3574 #
3575 # The relative URL must begin with &quot;/&quot; and must be a valid HTTP relative URL.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003576 # It can contain a path and query string arguments.
Bu Sun Kim65020912020-05-20 12:08:20 -07003577 # If the relative URL is empty, then the root path &quot;/&quot; will be used.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003578 # No spaces are allowed, and the maximum length allowed is 2083 characters.
Bu Sun Kim65020912020-05-20 12:08:20 -07003579 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003580 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003581 # This map contains the header field names and values.
3582 # Headers can be set when the
3583 # task is created.
3584 # Repeated headers are not supported but a header value can contain commas.
3585 #
3586 # Cloud Tasks sets some headers to default values:
3587 #
3588 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07003589 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07003590 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07003591 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Dan O'Mearadd494642020-05-01 07:42:23 -07003592 # modified `User-Agent`.
3593 #
3594 # If the task has a payload, Cloud
3595 # Tasks sets the following headers:
3596 #
3597 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07003598 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Dan O'Mearadd494642020-05-01 07:42:23 -07003599 # setting `Content-Type` to a particular media type when the
3600 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07003601 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Dan O'Mearadd494642020-05-01 07:42:23 -07003602 # * `Content-Length`: This is computed by Cloud Tasks. This value is
3603 # output only. It cannot be changed.
3604 #
3605 # The headers below cannot be set or overridden:
3606 #
3607 # * `Host`
3608 # * `X-Google-*`
3609 # * `X-AppEngine-*`
3610 #
3611 # In addition, Cloud Tasks sets some headers when the task is dispatched,
3612 # such as headers containing information about the task; see
3613 # [request
3614 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers).
3615 # These headers are set only when the task is dispatched, so they are not
3616 # visible when the task is returned in a Cloud Tasks response.
3617 #
3618 # Although there is no specific limit for the maximum number of headers or
3619 # the size, there is a limit on the maximum size of the Task. For more
3620 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07003621 &quot;a_key&quot;: &quot;A String&quot;,
Dan O'Mearadd494642020-05-01 07:42:23 -07003622 },
Bu Sun Kim65020912020-05-20 12:08:20 -07003623 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003624 #
3625 # If set,
3626 # app_engine_routing_override
3627 # is used for all tasks in the queue, no matter what the setting is for the
3628 # task-level app_engine_routing.
3629 #
3630 # Defines routing characteristics specific to App Engine - service, version,
3631 # and instance.
3632 #
3633 # For more information about services, versions, and instances see
3634 # [An Overview of App
3635 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
3636 # [Microservices Architecture on Google App
3637 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
3638 # [App Engine Standard request
3639 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
3640 # and [App Engine Flex request
3641 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07003642 &quot;instance&quot;: &quot;A String&quot;, # App instance.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003643 #
3644 # By default, the task is sent to an instance which is available when
3645 # the task is attempted.
3646 #
3647 # Requests can only be sent to a specific instance if
3648 # [manual scaling is used in App Engine
3649 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
3650 # App Engine Flex does not support instances. For more information, see
3651 # [App Engine Standard request
3652 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
3653 # and [App Engine Flex request
3654 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Bu Sun Kim65020912020-05-20 12:08:20 -07003655 &quot;version&quot;: &quot;A String&quot;, # App version.
3656 #
3657 # By default, the task is sent to the version which is the default
3658 # version when the task is attempted.
3659 #
3660 # For some queues or tasks which were created using the App Engine
3661 # Task Queue API, host is not parsable
3662 # into service,
3663 # version, and
3664 # instance. For example, some tasks
3665 # which were created using the App Engine SDK use a custom domain
3666 # name; custom domains are not parsed by Cloud Tasks. If
3667 # host is not parsable, then
3668 # service,
3669 # version, and
3670 # instance are the empty string.
3671 &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 -07003672 #
3673 # For more information, see
3674 # [How Requests are
3675 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
3676 #
3677 # The host is constructed as:
3678 #
3679 #
Dan O'Mearadd494642020-05-01 07:42:23 -07003680 # * `host = [application_domain_name]`&lt;/br&gt;
Bu Sun Kim65020912020-05-20 12:08:20 -07003681 # `| [service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3682 # `| [version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3683 # `| [version_dot_service]+ &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3684 # `| [instance] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3685 # `| [instance_dot_service] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3686 # `| [instance_dot_version] + &#x27;.&#x27; + [application_domain_name]`&lt;/br&gt;
3687 # `| [instance_dot_version_dot_service] + &#x27;.&#x27; + [application_domain_name]`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003688 #
3689 # * `application_domain_name` = The domain name of the app, for
Dan O'Mearadd494642020-05-01 07:42:23 -07003690 # example &lt;app-id&gt;.appspot.com, which is associated with the
Bu Sun Kim65020912020-05-20 12:08:20 -07003691 # queue&#x27;s project ID. Some tasks which were created using the App Engine
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003692 # SDK use a custom domain name.
3693 #
3694 # * `service =` service
3695 #
3696 # * `version =` version
3697 #
3698 # * `version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003699 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003700 # service
3701 #
3702 # * `instance =` instance
3703 #
3704 # * `instance_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003705 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003706 # service
3707 #
3708 # * `instance_dot_version =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003709 # instance `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003710 # version
3711 #
3712 # * `instance_dot_version_dot_service =`
Bu Sun Kim65020912020-05-20 12:08:20 -07003713 # instance `+ &#x27;.&#x27; +`
3714 # version `+ &#x27;.&#x27; +`
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003715 # service
3716 #
3717 # If service is empty, then the task will be sent
3718 # to the service which is the default service when the task is attempted.
3719 #
3720 # If version is empty, then the task will be sent
3721 # to the version which is the default version when the task is attempted.
3722 #
3723 # If instance is empty, then the task
3724 # will be sent to an instance which is available when the task is
3725 # attempted.
3726 #
3727 # If service,
3728 # version, or
3729 # instance is invalid, then the task
3730 # will be sent to the default version of the default service when
3731 # the task is attempted.
Bu Sun Kim65020912020-05-20 12:08:20 -07003732 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003733 #
3734 # By default, the task is sent to the service which is the default
3735 # service when the task is attempted.
3736 #
3737 # For some queues or tasks which were created using the App Engine
3738 # Task Queue API, host is not parsable
3739 # into service,
3740 # version, and
3741 # instance. For example, some tasks
3742 # which were created using the App Engine SDK use a custom domain
3743 # name; custom domains are not parsed by Cloud Tasks. If
3744 # host is not parsable, then
3745 # service,
3746 # version, and
3747 # instance are the empty string.
3748 },
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003749 },
Bu Sun Kim65020912020-05-20 12:08:20 -07003750 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
3751 # been returned.
3752 &quot;pullMessage&quot;: { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be
3753 # set only if pull_target is set on the queue.
3754 #
3755 # A pull task is a task that has PullMessage set.
3756 # LeaseTasks to process the task.
3757 #
3758 # This proto can only be used for tasks in a queue which has
3759 # pull_target set.
3760 &quot;payload&quot;: &quot;A String&quot;, # A data payload consumed by the worker to execute the task.
3761 &quot;tag&quot;: &quot;A String&quot;, # The task&#x27;s tag.
3762 #
3763 # Tags allow similar tasks to be processed in a batch. If you label
3764 # tasks with a tag, your worker can
3765 # lease tasks with the same tag using
3766 # filter. For example, if you want to
3767 # aggregate the events associated with a specific user once a day,
3768 # you could tag tasks with the user ID.
3769 #
3770 # The task&#x27;s tag can only be set when the
3771 # task is created.
3772 #
3773 # The tag must be less than 500 characters.
3774 #
3775 # SDK compatibility: Although the SDK allows tags to be either
3776 # string or
3777 # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-),
3778 # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn&#x27;t UTF-8
3779 # encoded, the tag will be empty when the task is returned by Cloud Tasks.
3780 },
3781 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted.
3782 #
3783 # For App Engine queues, this is when the task will be attempted or retried.
3784 #
3785 # For pull queues, this is the time when the task is available to
3786 # be leased; if a task is currently leased, this is the time when
3787 # the current lease expires, that is, the time that the task was
3788 # leased plus the lease_duration.
3789 #
3790 # `schedule_time` will be truncated to the nearest microsecond.
3791 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
3792 #
3793 # `create_time` will be truncated to the nearest second.
3794 &quot;status&quot;: { # Status of the task. # Output only. The task status.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07003795 &quot;lastAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
3796 #
3797 # This field is not calculated for pull tasks.
3798 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
3799 #
3800 # `response_time` will be truncated to the nearest microsecond.
3801 &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.
3802 #
3803 # If the task has not been attempted or the task is currently running
3804 # then the response status is unset.
3805 # different programming environments, including REST APIs and RPC APIs. It is
3806 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3807 # three pieces of data: error code, error message, and error details.
3808 #
3809 # You can find out more about this error model and how to work with it in the
3810 # [API Design Guide](https://cloud.google.com/apis/design/errors).
3811 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
3812 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
3813 # user-facing error message should be localized and sent in the
3814 # google.rpc.Status.details field, or localized by the client.
3815 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
3816 # message types for APIs to use.
3817 {
3818 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
3819 },
3820 ],
3821 },
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 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
3826 #
3827 # `dispatch_time` will be truncated to the nearest microsecond.
3828 },
Bu Sun Kim65020912020-05-20 12:08:20 -07003829 &quot;attemptDispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
3830 #
3831 # This count includes attempts which have been dispatched but haven&#x27;t
3832 # received a response.
3833 &quot;firstAttemptStatus&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
3834 #
3835 # Only dispatch_time will be set.
3836 # The other AttemptStatus information is not retained by Cloud Tasks.
3837 #
3838 # This field is not calculated for pull tasks.
3839 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
3840 #
3841 # `response_time` will be truncated to the nearest microsecond.
3842 &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.
3843 #
3844 # If the task has not been attempted or the task is currently running
3845 # then the response status is unset.
3846 # different programming environments, including REST APIs and RPC APIs. It is
3847 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
3848 # three pieces of data: error code, error message, and error details.
3849 #
3850 # You can find out more about this error model and how to work with it in the
3851 # [API Design Guide](https://cloud.google.com/apis/design/errors).
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -07003852 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
3853 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
3854 # user-facing error message should be localized and sent in the
3855 # google.rpc.Status.details field, or localized by the client.
Bu Sun Kim65020912020-05-20 12:08:20 -07003856 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
3857 # message types for APIs to use.
3858 {
3859 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
3860 },
3861 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07003862 },
3863 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
3864 #
3865 # `schedule_time` will be truncated to the nearest microsecond.
3866 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
3867 #
3868 # `dispatch_time` will be truncated to the nearest microsecond.
3869 },
3870 &quot;attemptResponseCount&quot;: 42, # Output only. The number of attempts which have received a response.
3871 #
3872 # This field is not calculated for pull tasks.
Bu Sun Kim65020912020-05-20 12:08:20 -07003873 },
3874 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003875 #
3876 # The task name.
3877 #
3878 # The task name must have the following format:
3879 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
3880 #
3881 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
3882 # hyphens (-), colons (:), or periods (.).
3883 # For more information, see
3884 # [Identifying
3885 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
Bu Sun Kim65020912020-05-20 12:08:20 -07003886 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003887 # The list of available locations can be obtained by calling
3888 # ListLocations.
3889 # For more information, see https://cloud.google.com/about/locations/.
3890 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
3891 # hyphens (-). The maximum length is 100 characters.
3892 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
3893 # hyphens (-), or underscores (_). The maximum length is 500 characters.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07003894 }</pre>
3895</div>
3896
3897</body></html>