blob: 61f67bf5effcdede003c7c259e7b10885e39207b [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="cloudtasks_v2.html">Cloud Tasks API</a> . <a href="cloudtasks_v2.projects.html">projects</a> . <a href="cloudtasks_v2.projects.locations.html">locations</a> . <a href="cloudtasks_v2.projects.locations.queues.html">queues</a> . <a href="cloudtasks_v2.projects.locations.queues.tasks.html">tasks</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Creates a task and adds it to a queue.</p>
80<p class="toc_element">
81 <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p>
82<p class="firstline">Deletes a task.</p>
83<p class="toc_element">
84 <code><a href="#get">get(name, responseView=None, x__xgafv=None)</a></code></p>
85<p class="firstline">Gets a task.</p>
86<p class="toc_element">
Bu Sun Kim65020912020-05-20 12:08:20 -070087 <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 -070088<p class="firstline">Lists the tasks in a queue.</p>
89<p class="toc_element">
90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#run">run(name, body=None, x__xgafv=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070094<p class="firstline">Forces a task to run now.</p>
95<h3>Method Details</h3>
96<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -070097 <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070098 <pre>Creates a task and adds it to a queue.
99
100Tasks cannot be updated after creation; there is no UpdateTask command.
101
102* The maximum task size is 100KB.
103
104Args:
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 parent: string, Required. The queue name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700106`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`
107
108The queue must already exist. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700109 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700110 The object takes the form of:
111
112{ # Request message for CreateTask.
Bu Sun Kim65020912020-05-20 12:08:20 -0700113 &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 -0700114 # returned.
115 #
116 # By default response_view is BASIC; not all
117 # information is retrieved by default because some data, such as
118 # payloads, might be desirable to return only when needed because
119 # of its large size or because of the sensitivity of data that it
120 # contains.
121 #
122 # Authorization for FULL requires
123 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
124 # permission on the Task resource.
Bu Sun Kim65020912020-05-20 12:08:20 -0700125 &quot;task&quot;: { # A unit of scheduled work. # Required. The task to add.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700126 #
127 # Task names have the following format:
128 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`.
129 # The user can optionally specify a task name. If a
130 # name is not specified then the system will generate a random
131 # unique task id, which will be set in the task returned in the
132 # response.
133 #
134 # If schedule_time is not set or is in the
135 # past then Cloud Tasks will set it to the current time.
136 #
137 # Task De-duplication:
138 #
139 # Explicitly specifying a task ID enables task de-duplication. If
Bu Sun Kim65020912020-05-20 12:08:20 -0700140 # a task&#x27;s ID is identical to that of an existing task or a task
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700141 # that was deleted or executed recently then the call will fail
142 # with ALREADY_EXISTS.
Bu Sun Kim65020912020-05-20 12:08:20 -0700143 # If the task&#x27;s queue was created using Cloud Tasks, then another task with
144 # the same name can&#x27;t be created for ~1hour after the original task was
145 # deleted or executed. If the task&#x27;s queue was created using queue.yaml or
146 # queue.xml, then another task with the same name can&#x27;t be created
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700147 # for ~9days after the original task was deleted or executed.
148 #
149 # Because there is an extra lookup cost to identify duplicate task
150 # names, these CreateTask calls have significantly
151 # increased latency. Using hashed strings for the task id or for
152 # the prefix of the task id is recommended. Choosing task ids that
153 # are sequential or have sequential prefixes, for example using a
154 # timestamp, causes an increase in latency and error rates in all
155 # task commands. The infrastructure relies on an approximately
156 # uniform distribution of task ids to store and serve tasks
157 # efficiently.
Bu Sun Kim65020912020-05-20 12:08:20 -0700158 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted or retried.
159 #
160 # `schedule_time` will be truncated to the nearest microsecond.
161 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
162 #
163 # `create_time` will be truncated to the nearest second.
164 &quot;httpRequest&quot;: { # HTTP request. # HTTP request that is sent to the worker.
Dan O'Mearadd494642020-05-01 07:42:23 -0700165 #
166 # An HTTP task is a task that has HttpRequest set.
167 #
168 # The task will be pushed to the worker as an HTTP request. If the worker
169 # or the redirected worker acknowledges the task by returning a successful HTTP
170 # response code ([`200` - `299`]), the task will be removed from the queue. If
171 # any other HTTP response code is returned or no response is received, the
172 # task will be retried according to the following:
173 #
174 # * User-specified throttling: retry configuration,
Bu Sun Kim65020912020-05-20 12:08:20 -0700175 # rate limits, and the queue&#x27;s state.
Dan O'Mearadd494642020-05-01 07:42:23 -0700176 #
177 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
Bu Sun Kim65020912020-05-20 12:08:20 -0700178 # temporarily reduce the queue&#x27;s effective rate. User-specified settings
Dan O'Mearadd494642020-05-01 07:42:23 -0700179 # will not be changed.
180 #
181 # System throttling happens because:
182 #
183 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
184 # rate limits will be used. But if the worker returns
185 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
186 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
187 # specified in the `Retry-After` HTTP response header is considered.
188 #
189 # * To prevent traffic spikes and to smooth sudden increases in traffic,
190 # dispatches ramp up slowly when the queue is newly created or idle and
191 # if large numbers of tasks suddenly become available to dispatch (due to
192 # spikes in create task rates, the queue being unpaused, or many tasks
193 # that are scheduled at the same time).
Bu Sun Kim65020912020-05-20 12:08:20 -0700194 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, an
Dan O'Mearadd494642020-05-01 07:42:23 -0700195 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
196 # token will be generated and attached as an `Authorization` header in the
197 # HTTP request.
198 #
199 # This type of authorization can be used for many scenarios, including
200 # calling Cloud Run, or endpoints where you intend to validate the token
201 # yourself.
202 # [OpenID Connect
203 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
204 # This type of authorization can be used for many scenarios, including
205 # calling Cloud Run, or endpoints where you intend to validate the token
206 # yourself.
Bu Sun Kim65020912020-05-20 12:08:20 -0700207 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. If not specified, the URI
Dan O'Mearadd494642020-05-01 07:42:23 -0700208 # specified in target will be used.
Bu Sun Kim65020912020-05-20 12:08:20 -0700209 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
Dan O'Mearadd494642020-05-01 07:42:23 -0700210 # to be used for generating OIDC token.
211 # The service account must be within the same project as the queue. The
212 # caller must have iam.serviceAccounts.actAs permission for the service
213 # account.
214 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700215 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
216 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
217 #
218 # A request body is allowed only if the
219 # HTTP method is POST, PUT, or PATCH. It is an
220 # error to set body on a task with an incompatible HttpMethod.
221 &quot;oauthToken&quot;: { # Contains information needed for generating an # If specified, an
Dan O'Mearadd494642020-05-01 07:42:23 -0700222 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
223 # will be generated and attached as an `Authorization` header in the HTTP
224 # request.
225 #
226 # This type of authorization should generally only be used when calling
227 # Google APIs hosted on *.googleapis.com.
228 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
229 # This type of authorization should generally only be used when calling Google
230 # APIs hosted on *.googleapis.com.
Bu Sun Kim65020912020-05-20 12:08:20 -0700231 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
Dan O'Mearadd494642020-05-01 07:42:23 -0700232 # to be used for generating OAuth token.
233 # The service account must be within the same project as the queue. The
234 # caller must have iam.serviceAccounts.actAs permission for the service
235 # account.
Bu Sun Kim65020912020-05-20 12:08:20 -0700236 &quot;scope&quot;: &quot;A String&quot;, # OAuth scope to be used for generating OAuth access token.
237 # If not specified, &quot;https://www.googleapis.com/auth/cloud-platform&quot;
238 # will be used.
Dan O'Mearadd494642020-05-01 07:42:23 -0700239 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700240 &quot;headers&quot;: { # HTTP request headers.
241 #
242 # This map contains the header field names and values.
243 # Headers can be set when the
244 # task is created.
245 #
246 # These headers represent a subset of the headers that will accompany the
247 # task&#x27;s HTTP request. Some HTTP request headers will be ignored or replaced.
248 #
249 # A partial list of headers that will be ignored or replaced is:
250 #
251 # * Host: This will be computed by Cloud Tasks and derived from
252 # HttpRequest.url.
253 # * Content-Length: This will be computed by Cloud Tasks.
254 # * User-Agent: This will be set to `&quot;Google-Cloud-Tasks&quot;`.
255 # * X-Google-*: Google use only.
256 # * X-AppEngine-*: Google use only.
257 #
258 # `Content-Type` won&#x27;t be set by Cloud Tasks. You can explicitly set
259 # `Content-Type` to a media type when the
260 # task is created.
261 # For example, `Content-Type` can be set to `&quot;application/octet-stream&quot;` or
262 # `&quot;application/json&quot;`.
263 #
264 # Headers which can have multiple values (according to RFC2616) can be
265 # specified using comma-separated values.
266 #
267 # The size of the headers must be less than 80KB.
268 &quot;a_key&quot;: &quot;A String&quot;,
269 },
270 &quot;url&quot;: &quot;A String&quot;, # Required. The full url path that the request will be sent to.
271 #
272 # This string must begin with either &quot;http://&quot; or &quot;https://&quot;. Some examples
273 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
274 # encode some characters for safety and compatibility. The maximum allowed
275 # URL length is 2083 characters after encoding.
276 #
277 # The `Location` header response from a redirect response [`300` - `399`]
278 # may be followed. The redirect is not counted as a separate attempt.
Dan O'Mearadd494642020-05-01 07:42:23 -0700279 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700280 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
281 #
282 # The task name.
283 #
284 # The task name must have the following format:
285 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
286 #
287 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
288 # hyphens (-), colons (:), or periods (.).
289 # For more information, see
290 # [Identifying
291 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
292 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
293 # The list of available locations can be obtained by calling
294 # ListLocations.
295 # For more information, see https://cloud.google.com/about/locations/.
296 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
297 # hyphens (-). The maximum length is 100 characters.
298 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
299 # hyphens (-), or underscores (_). The maximum length is 500 characters.
300 &quot;dispatchDeadline&quot;: &quot;A String&quot;, # The deadline for requests sent to the worker. If the worker does not
301 # respond by this deadline then the request is cancelled and the attempt
302 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
303 # task according to the RetryConfig.
304 #
305 # Note that when the request is cancelled, Cloud Tasks will stop listing for
306 # the response, but whether the worker stops processing depends on the
307 # worker. For example, if the worker is stuck, it may not react to cancelled
308 # requests.
309 #
310 # The default and maximum values depend on the type of request:
311 #
312 # * For HTTP tasks, the default is 10 minutes. The deadline
313 # must be in the interval [15 seconds, 30 minutes].
314 #
315 # * For App Engine tasks, 0 indicates that the
316 # request has the default deadline. The default deadline depends on the
317 # [scaling
318 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
319 # of the service: 10 minutes for standard apps with automatic scaling, 24
320 # hours for standard apps with manual and basic scaling, and 60 minutes for
321 # flex apps. If the request deadline is set, it must be in the interval [15
322 # seconds, 24 hours 15 seconds]. Regardless of the task&#x27;s
323 # `dispatch_deadline`, the app handler will not run for longer than than
324 # the service&#x27;s timeout. We recommend setting the `dispatch_deadline` to
325 # at most a few seconds more than the app handler&#x27;s timeout. For more
326 # information see
327 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
328 #
329 # `dispatch_deadline` will be truncated to the nearest millisecond. The
330 # deadline is an approximate deadline.
331 &quot;dispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
332 #
333 # This count includes attempts which have been dispatched but haven&#x27;t
334 # received a response.
335 &quot;firstAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
336 #
337 # Only dispatch_time will be set.
338 # The other Attempt information is not retained by Cloud Tasks.
339 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
340 #
341 # `schedule_time` will be truncated to the nearest microsecond.
342 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
343 #
344 # `dispatch_time` will be truncated to the nearest microsecond.
345 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
346 #
347 # `response_time` will be truncated to the nearest microsecond.
348 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
349 #
350 # If `response_time` is unset, then the task has not been attempted or is
351 # currently running and the `response_status` field is meaningless.
352 # different programming environments, including REST APIs and RPC APIs. It is
353 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
354 # three pieces of data: error code, error message, and error details.
355 #
356 # You can find out more about this error model and how to work with it in the
357 # [API Design Guide](https://cloud.google.com/apis/design/errors).
358 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
359 # message types for APIs to use.
360 {
361 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
362 },
363 ],
364 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
365 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
366 # user-facing error message should be localized and sent in the
367 # google.rpc.Status.details field, or localized by the client.
368 },
369 },
370 &quot;lastAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
371 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
372 #
373 # `schedule_time` will be truncated to the nearest microsecond.
374 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
375 #
376 # `dispatch_time` will be truncated to the nearest microsecond.
377 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
378 #
379 # `response_time` will be truncated to the nearest microsecond.
380 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
381 #
382 # If `response_time` is unset, then the task has not been attempted or is
383 # currently running and the `response_status` field is meaningless.
384 # different programming environments, including REST APIs and RPC APIs. It is
385 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
386 # three pieces of data: error code, error message, and error details.
387 #
388 # You can find out more about this error model and how to work with it in the
389 # [API Design Guide](https://cloud.google.com/apis/design/errors).
390 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
391 # message types for APIs to use.
392 {
393 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
394 },
395 ],
396 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
397 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
398 # user-facing error message should be localized and sent in the
399 # google.rpc.Status.details field, or localized by the client.
400 },
401 },
402 &quot;responseCount&quot;: 42, # Output only. The number of attempts which have received a response.
403 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700404 #
405 # An App Engine task is a task that has AppEngineHttpRequest set.
406 #
407 # The message defines the HTTP request that is sent to an App Engine app when
408 # the task is dispatched.
409 #
410 # Using AppEngineHttpRequest requires
411 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
412 # Google IAM permission for the project
413 # and the following scope:
414 #
415 # `https://www.googleapis.com/auth/cloud-platform`
416 #
417 # The task will be delivered to the App Engine app which belongs to the same
418 # project as the queue. For more information, see
419 # [How Requests are
420 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
421 # and how routing is affected by
422 # [dispatch
423 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
424 # Traffic is encrypted during transport and never leaves Google datacenters.
425 # Because this traffic is carried over a communication mechanism internal to
426 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
427 # The request to the handler, however, will appear to have used the HTTP
428 # protocol.
429 #
430 # The AppEngineRouting used to construct the URL that the task is
431 # delivered to can be set at the queue-level or task-level:
432 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700433 # * If app_engine_routing_override is set on the
434 # queue, this value is used for all
435 # tasks in the queue, no matter what the setting is for the task-level
436 # app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700437 #
438 #
439 # The `url` that the task will be sent to is:
440 #
441 # * `url =` host `+`
442 # relative_uri
443 #
444 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
445 # URIs restricted with
446 # [`login:
447 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
448 # Because tasks are not run as any user, they cannot be dispatched to URIs
449 # restricted with
450 # [`login:
451 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
452 # Task dispatches also do not follow redirects.
453 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700454 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700455 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -0700456 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700457 # not receive response before the deadline. Failed
458 # tasks will be retried according to the
459 # retry configuration. `503` (Service Unavailable) is
460 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -0700461 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
462 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700463 # Requests) response from an app handler does not cause traffic congestion
464 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -0700465 &quot;relativeUri&quot;: &quot;A String&quot;, # The relative URI.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700466 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700467 # The relative URI must begin with &quot;/&quot; and must be a valid HTTP relative URI.
468 # It can contain a path and query string arguments.
469 # If the relative URI is empty, then the root path &quot;/&quot; will be used.
470 # No spaces are allowed, and the maximum length allowed is 2083 characters.
471 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700472 #
473 # This map contains the header field names and values.
474 # Headers can be set when the
475 # task is created.
476 # Repeated headers are not supported but a header value can contain commas.
477 #
478 # Cloud Tasks sets some headers to default values:
479 #
480 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -0700481 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700482 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -0700483 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700484 # modified `User-Agent`.
485 #
486 # If the task has a body, Cloud
487 # Tasks sets the following headers:
488 #
489 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -0700490 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700491 # setting `Content-Type` to a particular media type when the
492 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -0700493 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700494 # * `Content-Length`: This is computed by Cloud Tasks. This value is
495 # output only. It cannot be changed.
496 #
497 # The headers below cannot be set or overridden:
498 #
499 # * `Host`
500 # * `X-Google-*`
501 # * `X-AppEngine-*`
502 #
503 # In addition, Cloud Tasks sets some headers when the task is dispatched,
504 # such as headers containing information about the task; see
505 # [request
Dan O'Mearadd494642020-05-01 07:42:23 -0700506 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700507 # These headers are set only when the task is dispatched, so they are not
508 # visible when the task is returned in a Cloud Tasks response.
509 #
510 # Although there is no specific limit for the maximum number of headers or
511 # the size, there is a limit on the maximum size of the Task. For more
512 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700513 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700514 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700515 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700516 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700517 # * If app_engine_routing_override is set on the
518 # queue, this value is used for all
519 # tasks in the queue, no matter what the setting is for the task-level
520 # app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700521 #
522 # Defines routing characteristics specific to App Engine - service, version,
523 # and instance.
524 #
525 # For more information about services, versions, and instances see
526 # [An Overview of App
527 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
528 # [Microservices Architecture on Google App
529 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
530 # [App Engine Standard request
531 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
532 # and [App Engine Flex request
533 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Dan O'Mearadd494642020-05-01 07:42:23 -0700534 #
535 # Using AppEngineRouting requires
536 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
537 # Google IAM permission for the project
538 # and the following scope:
539 #
540 # `https://www.googleapis.com/auth/cloud-platform`
Bu Sun Kim65020912020-05-20 12:08:20 -0700541 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700542 #
543 # By default, the task is sent to the service which is the default
544 # service when the task is attempted.
545 #
546 # For some queues or tasks which were created using the App Engine
547 # Task Queue API, host is not parsable
548 # into service,
549 # version, and
550 # instance. For example, some tasks
551 # which were created using the App Engine SDK use a custom domain
552 # name; custom domains are not parsed by Cloud Tasks. If
553 # host is not parsable, then
554 # service,
555 # version, and
556 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -0700557 &quot;instance&quot;: &quot;A String&quot;, # App instance.
558 #
559 # By default, the task is sent to an instance which is available when
560 # the task is attempted.
561 #
562 # Requests can only be sent to a specific instance if
563 # [manual scaling is used in App Engine
564 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
565 # App Engine Flex does not support instances. For more information, see
566 # [App Engine Standard request
567 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
568 # and [App Engine Flex request
569 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
570 &quot;version&quot;: &quot;A String&quot;, # App version.
571 #
572 # By default, the task is sent to the version which is the default
573 # version when the task is attempted.
574 #
575 # For some queues or tasks which were created using the App Engine
576 # Task Queue API, host is not parsable
577 # into service,
578 # version, and
579 # instance. For example, some tasks
580 # which were created using the App Engine SDK use a custom domain
581 # name; custom domains are not parsed by Cloud Tasks. If
582 # host is not parsable, then
583 # service,
584 # version, and
585 # instance are the empty string.
586 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
587 #
588 # The host is constructed from the domain name of the app associated with
589 # the queue&#x27;s project ID (for example &lt;app-id&gt;.appspot.com), and the
590 # service, version,
591 # and instance. Tasks which were created using
592 # the App Engine SDK might have a custom domain name.
593 #
594 # For more information, see
595 # [How Requests are
596 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700597 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700598 &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 -0700599 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700600 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
Dan O'Mearadd494642020-05-01 07:42:23 -0700601 # HTTP requests with this http_method, otherwise the task attempt fails with
602 # error code 405 (Method Not Allowed). See [Writing a push task request
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700603 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
Dan O'Mearadd494642020-05-01 07:42:23 -0700604 # and the App Engine documentation for your runtime on [How Requests are
605 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim65020912020-05-20 12:08:20 -0700606 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
607 #
608 # A request body is allowed only if the HTTP method is POST or PUT. It is
609 # an error to set a body on a task with an incompatible HttpMethod.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700610 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700611 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700612 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700613 },
614 }
615
616 x__xgafv: string, V1 error format.
617 Allowed values
618 1 - v1 error format
619 2 - v2 error format
620
621Returns:
622 An object of the form:
623
624 { # A unit of scheduled work.
Bu Sun Kim65020912020-05-20 12:08:20 -0700625 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted or retried.
626 #
627 # `schedule_time` will be truncated to the nearest microsecond.
628 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
629 #
630 # `create_time` will be truncated to the nearest second.
631 &quot;httpRequest&quot;: { # HTTP request. # HTTP request that is sent to the worker.
Dan O'Mearadd494642020-05-01 07:42:23 -0700632 #
633 # An HTTP task is a task that has HttpRequest set.
634 #
635 # The task will be pushed to the worker as an HTTP request. If the worker
636 # or the redirected worker acknowledges the task by returning a successful HTTP
637 # response code ([`200` - `299`]), the task will be removed from the queue. If
638 # any other HTTP response code is returned or no response is received, the
639 # task will be retried according to the following:
640 #
641 # * User-specified throttling: retry configuration,
Bu Sun Kim65020912020-05-20 12:08:20 -0700642 # rate limits, and the queue&#x27;s state.
Dan O'Mearadd494642020-05-01 07:42:23 -0700643 #
644 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
Bu Sun Kim65020912020-05-20 12:08:20 -0700645 # temporarily reduce the queue&#x27;s effective rate. User-specified settings
Dan O'Mearadd494642020-05-01 07:42:23 -0700646 # will not be changed.
647 #
648 # System throttling happens because:
649 #
650 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
651 # rate limits will be used. But if the worker returns
652 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
653 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
654 # specified in the `Retry-After` HTTP response header is considered.
655 #
656 # * To prevent traffic spikes and to smooth sudden increases in traffic,
657 # dispatches ramp up slowly when the queue is newly created or idle and
658 # if large numbers of tasks suddenly become available to dispatch (due to
659 # spikes in create task rates, the queue being unpaused, or many tasks
660 # that are scheduled at the same time).
Bu Sun Kim65020912020-05-20 12:08:20 -0700661 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, an
Dan O'Mearadd494642020-05-01 07:42:23 -0700662 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
663 # token will be generated and attached as an `Authorization` header in the
664 # HTTP request.
665 #
666 # This type of authorization can be used for many scenarios, including
667 # calling Cloud Run, or endpoints where you intend to validate the token
668 # yourself.
669 # [OpenID Connect
670 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
671 # This type of authorization can be used for many scenarios, including
672 # calling Cloud Run, or endpoints where you intend to validate the token
673 # yourself.
Bu Sun Kim65020912020-05-20 12:08:20 -0700674 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. If not specified, the URI
Dan O'Mearadd494642020-05-01 07:42:23 -0700675 # specified in target will be used.
Bu Sun Kim65020912020-05-20 12:08:20 -0700676 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
Dan O'Mearadd494642020-05-01 07:42:23 -0700677 # to be used for generating OIDC token.
678 # The service account must be within the same project as the queue. The
679 # caller must have iam.serviceAccounts.actAs permission for the service
680 # account.
681 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700682 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
683 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
684 #
685 # A request body is allowed only if the
686 # HTTP method is POST, PUT, or PATCH. It is an
687 # error to set body on a task with an incompatible HttpMethod.
688 &quot;oauthToken&quot;: { # Contains information needed for generating an # If specified, an
Dan O'Mearadd494642020-05-01 07:42:23 -0700689 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
690 # will be generated and attached as an `Authorization` header in the HTTP
691 # request.
692 #
693 # This type of authorization should generally only be used when calling
694 # Google APIs hosted on *.googleapis.com.
695 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
696 # This type of authorization should generally only be used when calling Google
697 # APIs hosted on *.googleapis.com.
Bu Sun Kim65020912020-05-20 12:08:20 -0700698 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
Dan O'Mearadd494642020-05-01 07:42:23 -0700699 # to be used for generating OAuth token.
700 # The service account must be within the same project as the queue. The
701 # caller must have iam.serviceAccounts.actAs permission for the service
702 # account.
Bu Sun Kim65020912020-05-20 12:08:20 -0700703 &quot;scope&quot;: &quot;A String&quot;, # OAuth scope to be used for generating OAuth access token.
704 # If not specified, &quot;https://www.googleapis.com/auth/cloud-platform&quot;
705 # will be used.
Dan O'Mearadd494642020-05-01 07:42:23 -0700706 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700707 &quot;headers&quot;: { # HTTP request headers.
708 #
709 # This map contains the header field names and values.
710 # Headers can be set when the
711 # task is created.
712 #
713 # These headers represent a subset of the headers that will accompany the
714 # task&#x27;s HTTP request. Some HTTP request headers will be ignored or replaced.
715 #
716 # A partial list of headers that will be ignored or replaced is:
717 #
718 # * Host: This will be computed by Cloud Tasks and derived from
719 # HttpRequest.url.
720 # * Content-Length: This will be computed by Cloud Tasks.
721 # * User-Agent: This will be set to `&quot;Google-Cloud-Tasks&quot;`.
722 # * X-Google-*: Google use only.
723 # * X-AppEngine-*: Google use only.
724 #
725 # `Content-Type` won&#x27;t be set by Cloud Tasks. You can explicitly set
726 # `Content-Type` to a media type when the
727 # task is created.
728 # For example, `Content-Type` can be set to `&quot;application/octet-stream&quot;` or
729 # `&quot;application/json&quot;`.
730 #
731 # Headers which can have multiple values (according to RFC2616) can be
732 # specified using comma-separated values.
733 #
734 # The size of the headers must be less than 80KB.
735 &quot;a_key&quot;: &quot;A String&quot;,
736 },
737 &quot;url&quot;: &quot;A String&quot;, # Required. The full url path that the request will be sent to.
738 #
739 # This string must begin with either &quot;http://&quot; or &quot;https://&quot;. Some examples
740 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
741 # encode some characters for safety and compatibility. The maximum allowed
742 # URL length is 2083 characters after encoding.
743 #
744 # The `Location` header response from a redirect response [`300` - `399`]
745 # may be followed. The redirect is not counted as a separate attempt.
Dan O'Mearadd494642020-05-01 07:42:23 -0700746 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700747 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
748 #
749 # The task name.
750 #
751 # The task name must have the following format:
752 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
753 #
754 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
755 # hyphens (-), colons (:), or periods (.).
756 # For more information, see
757 # [Identifying
758 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
759 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
760 # The list of available locations can be obtained by calling
761 # ListLocations.
762 # For more information, see https://cloud.google.com/about/locations/.
763 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
764 # hyphens (-). The maximum length is 100 characters.
765 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
766 # hyphens (-), or underscores (_). The maximum length is 500 characters.
767 &quot;dispatchDeadline&quot;: &quot;A String&quot;, # The deadline for requests sent to the worker. If the worker does not
768 # respond by this deadline then the request is cancelled and the attempt
769 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
770 # task according to the RetryConfig.
771 #
772 # Note that when the request is cancelled, Cloud Tasks will stop listing for
773 # the response, but whether the worker stops processing depends on the
774 # worker. For example, if the worker is stuck, it may not react to cancelled
775 # requests.
776 #
777 # The default and maximum values depend on the type of request:
778 #
779 # * For HTTP tasks, the default is 10 minutes. The deadline
780 # must be in the interval [15 seconds, 30 minutes].
781 #
782 # * For App Engine tasks, 0 indicates that the
783 # request has the default deadline. The default deadline depends on the
784 # [scaling
785 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
786 # of the service: 10 minutes for standard apps with automatic scaling, 24
787 # hours for standard apps with manual and basic scaling, and 60 minutes for
788 # flex apps. If the request deadline is set, it must be in the interval [15
789 # seconds, 24 hours 15 seconds]. Regardless of the task&#x27;s
790 # `dispatch_deadline`, the app handler will not run for longer than than
791 # the service&#x27;s timeout. We recommend setting the `dispatch_deadline` to
792 # at most a few seconds more than the app handler&#x27;s timeout. For more
793 # information see
794 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
795 #
796 # `dispatch_deadline` will be truncated to the nearest millisecond. The
797 # deadline is an approximate deadline.
798 &quot;dispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
799 #
800 # This count includes attempts which have been dispatched but haven&#x27;t
801 # received a response.
802 &quot;firstAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
803 #
804 # Only dispatch_time will be set.
805 # The other Attempt information is not retained by Cloud Tasks.
806 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
807 #
808 # `schedule_time` will be truncated to the nearest microsecond.
809 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
810 #
811 # `dispatch_time` will be truncated to the nearest microsecond.
812 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
813 #
814 # `response_time` will be truncated to the nearest microsecond.
815 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
816 #
817 # If `response_time` is unset, then the task has not been attempted or is
818 # currently running and the `response_status` field is meaningless.
819 # different programming environments, including REST APIs and RPC APIs. It is
820 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
821 # three pieces of data: error code, error message, and error details.
822 #
823 # You can find out more about this error model and how to work with it in the
824 # [API Design Guide](https://cloud.google.com/apis/design/errors).
825 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
826 # message types for APIs to use.
827 {
828 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
829 },
830 ],
831 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
832 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
833 # user-facing error message should be localized and sent in the
834 # google.rpc.Status.details field, or localized by the client.
835 },
836 },
837 &quot;lastAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
838 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
839 #
840 # `schedule_time` will be truncated to the nearest microsecond.
841 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
842 #
843 # `dispatch_time` will be truncated to the nearest microsecond.
844 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
845 #
846 # `response_time` will be truncated to the nearest microsecond.
847 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
848 #
849 # If `response_time` is unset, then the task has not been attempted or is
850 # currently running and the `response_status` field is meaningless.
851 # different programming environments, including REST APIs and RPC APIs. It is
852 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
853 # three pieces of data: error code, error message, and error details.
854 #
855 # You can find out more about this error model and how to work with it in the
856 # [API Design Guide](https://cloud.google.com/apis/design/errors).
857 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
858 # message types for APIs to use.
859 {
860 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
861 },
862 ],
863 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
864 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
865 # user-facing error message should be localized and sent in the
866 # google.rpc.Status.details field, or localized by the client.
867 },
868 },
869 &quot;responseCount&quot;: 42, # Output only. The number of attempts which have received a response.
870 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700871 #
872 # An App Engine task is a task that has AppEngineHttpRequest set.
873 #
874 # The message defines the HTTP request that is sent to an App Engine app when
875 # the task is dispatched.
876 #
877 # Using AppEngineHttpRequest requires
878 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
879 # Google IAM permission for the project
880 # and the following scope:
881 #
882 # `https://www.googleapis.com/auth/cloud-platform`
883 #
884 # The task will be delivered to the App Engine app which belongs to the same
885 # project as the queue. For more information, see
886 # [How Requests are
887 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
888 # and how routing is affected by
889 # [dispatch
890 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
891 # Traffic is encrypted during transport and never leaves Google datacenters.
892 # Because this traffic is carried over a communication mechanism internal to
893 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
894 # The request to the handler, however, will appear to have used the HTTP
895 # protocol.
896 #
897 # The AppEngineRouting used to construct the URL that the task is
898 # delivered to can be set at the queue-level or task-level:
899 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700900 # * If app_engine_routing_override is set on the
901 # queue, this value is used for all
902 # tasks in the queue, no matter what the setting is for the task-level
903 # app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700904 #
905 #
906 # The `url` that the task will be sent to is:
907 #
908 # * `url =` host `+`
909 # relative_uri
910 #
911 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
912 # URIs restricted with
913 # [`login:
914 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
915 # Because tasks are not run as any user, they cannot be dispatched to URIs
916 # restricted with
917 # [`login:
918 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
919 # Task dispatches also do not follow redirects.
920 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700921 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700922 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -0700923 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700924 # not receive response before the deadline. Failed
925 # tasks will be retried according to the
926 # retry configuration. `503` (Service Unavailable) is
927 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -0700928 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
929 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700930 # Requests) response from an app handler does not cause traffic congestion
931 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -0700932 &quot;relativeUri&quot;: &quot;A String&quot;, # The relative URI.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700933 #
Bu Sun Kim65020912020-05-20 12:08:20 -0700934 # The relative URI must begin with &quot;/&quot; and must be a valid HTTP relative URI.
935 # It can contain a path and query string arguments.
936 # If the relative URI is empty, then the root path &quot;/&quot; will be used.
937 # No spaces are allowed, and the maximum length allowed is 2083 characters.
938 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700939 #
940 # This map contains the header field names and values.
941 # Headers can be set when the
942 # task is created.
943 # Repeated headers are not supported but a header value can contain commas.
944 #
945 # Cloud Tasks sets some headers to default values:
946 #
947 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -0700948 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700949 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -0700950 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700951 # modified `User-Agent`.
952 #
953 # If the task has a body, Cloud
954 # Tasks sets the following headers:
955 #
956 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -0700957 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700958 # setting `Content-Type` to a particular media type when the
959 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -0700960 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700961 # * `Content-Length`: This is computed by Cloud Tasks. This value is
962 # output only. It cannot be changed.
963 #
964 # The headers below cannot be set or overridden:
965 #
966 # * `Host`
967 # * `X-Google-*`
968 # * `X-AppEngine-*`
969 #
970 # In addition, Cloud Tasks sets some headers when the task is dispatched,
971 # such as headers containing information about the task; see
972 # [request
Dan O'Mearadd494642020-05-01 07:42:23 -0700973 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700974 # These headers are set only when the task is dispatched, so they are not
975 # visible when the task is returned in a Cloud Tasks response.
976 #
977 # Although there is no specific limit for the maximum number of headers or
978 # the size, there is a limit on the maximum size of the Task. For more
979 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -0700980 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700981 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700982 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700983 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700984 # * If app_engine_routing_override is set on the
985 # queue, this value is used for all
986 # tasks in the queue, no matter what the setting is for the task-level
987 # app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700988 #
989 # Defines routing characteristics specific to App Engine - service, version,
990 # and instance.
991 #
992 # For more information about services, versions, and instances see
993 # [An Overview of App
994 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
995 # [Microservices Architecture on Google App
996 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
997 # [App Engine Standard request
998 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
999 # and [App Engine Flex request
1000 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Dan O'Mearadd494642020-05-01 07:42:23 -07001001 #
1002 # Using AppEngineRouting requires
1003 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1004 # Google IAM permission for the project
1005 # and the following scope:
1006 #
1007 # `https://www.googleapis.com/auth/cloud-platform`
Bu Sun Kim65020912020-05-20 12:08:20 -07001008 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001009 #
1010 # By default, the task is sent to the service which is the default
1011 # service when the task is attempted.
1012 #
1013 # For some queues or tasks which were created using the App Engine
1014 # Task Queue API, host is not parsable
1015 # into service,
1016 # version, and
1017 # instance. For example, some tasks
1018 # which were created using the App Engine SDK use a custom domain
1019 # name; custom domains are not parsed by Cloud Tasks. If
1020 # host is not parsable, then
1021 # service,
1022 # version, and
1023 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -07001024 &quot;instance&quot;: &quot;A String&quot;, # App instance.
1025 #
1026 # By default, the task is sent to an instance which is available when
1027 # the task is attempted.
1028 #
1029 # Requests can only be sent to a specific instance if
1030 # [manual scaling is used in App Engine
1031 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
1032 # App Engine Flex does not support instances. For more information, see
1033 # [App Engine Standard request
1034 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1035 # and [App Engine Flex request
1036 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1037 &quot;version&quot;: &quot;A String&quot;, # App version.
1038 #
1039 # By default, the task is sent to the version which is the default
1040 # version when the task is attempted.
1041 #
1042 # For some queues or tasks which were created using the App Engine
1043 # Task Queue API, host is not parsable
1044 # into service,
1045 # version, and
1046 # instance. For example, some tasks
1047 # which were created using the App Engine SDK use a custom domain
1048 # name; custom domains are not parsed by Cloud Tasks. If
1049 # host is not parsable, then
1050 # service,
1051 # version, and
1052 # instance are the empty string.
1053 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
1054 #
1055 # The host is constructed from the domain name of the app associated with
1056 # the queue&#x27;s project ID (for example &lt;app-id&gt;.appspot.com), and the
1057 # service, version,
1058 # and instance. Tasks which were created using
1059 # the App Engine SDK might have a custom domain name.
1060 #
1061 # For more information, see
1062 # [How Requests are
1063 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001064 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001065 &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 -07001066 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001067 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
Dan O'Mearadd494642020-05-01 07:42:23 -07001068 # HTTP requests with this http_method, otherwise the task attempt fails with
1069 # error code 405 (Method Not Allowed). See [Writing a push task request
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001070 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
Dan O'Mearadd494642020-05-01 07:42:23 -07001071 # and the App Engine documentation for your runtime on [How Requests are
1072 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim65020912020-05-20 12:08:20 -07001073 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
1074 #
1075 # A request body is allowed only if the HTTP method is POST or PUT. It is
1076 # an error to set a body on a task with an incompatible HttpMethod.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001077 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001078 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001079 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001080 }</pre>
1081</div>
1082
1083<div class="method">
1084 <code class="details" id="delete">delete(name, x__xgafv=None)</code>
1085 <pre>Deletes a task.
1086
1087A task can be deleted if it is scheduled or dispatched. A task
1088cannot be deleted if it has executed successfully or permanently
1089failed.
1090
1091Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001092 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001093`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
1094 x__xgafv: string, V1 error format.
1095 Allowed values
1096 1 - v1 error format
1097 2 - v2 error format
1098
1099Returns:
1100 An object of the form:
1101
1102 { # A generic empty message that you can re-use to avoid defining duplicated
1103 # empty messages in your APIs. A typical example is to use it as the request
1104 # or the response type of an API method. For instance:
1105 #
1106 # service Foo {
1107 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
1108 # }
1109 #
1110 # The JSON representation for `Empty` is empty JSON object `{}`.
1111 }</pre>
1112</div>
1113
1114<div class="method">
1115 <code class="details" id="get">get(name, responseView=None, x__xgafv=None)</code>
1116 <pre>Gets a task.
1117
1118Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001119 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001120`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
1121 responseView: string, The response_view specifies which subset of the Task will be
1122returned.
1123
1124By default response_view is BASIC; not all
1125information is retrieved by default because some data, such as
1126payloads, might be desirable to return only when needed because
1127of its large size or because of the sensitivity of data that it
1128contains.
1129
1130Authorization for FULL requires
1131`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1132permission on the Task resource.
1133 x__xgafv: string, V1 error format.
1134 Allowed values
1135 1 - v1 error format
1136 2 - v2 error format
1137
1138Returns:
1139 An object of the form:
1140
1141 { # A unit of scheduled work.
Bu Sun Kim65020912020-05-20 12:08:20 -07001142 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted or retried.
1143 #
1144 # `schedule_time` will be truncated to the nearest microsecond.
1145 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
1146 #
1147 # `create_time` will be truncated to the nearest second.
1148 &quot;httpRequest&quot;: { # HTTP request. # HTTP request that is sent to the worker.
Dan O'Mearadd494642020-05-01 07:42:23 -07001149 #
1150 # An HTTP task is a task that has HttpRequest set.
1151 #
1152 # The task will be pushed to the worker as an HTTP request. If the worker
1153 # or the redirected worker acknowledges the task by returning a successful HTTP
1154 # response code ([`200` - `299`]), the task will be removed from the queue. If
1155 # any other HTTP response code is returned or no response is received, the
1156 # task will be retried according to the following:
1157 #
1158 # * User-specified throttling: retry configuration,
Bu Sun Kim65020912020-05-20 12:08:20 -07001159 # rate limits, and the queue&#x27;s state.
Dan O'Mearadd494642020-05-01 07:42:23 -07001160 #
1161 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
Bu Sun Kim65020912020-05-20 12:08:20 -07001162 # temporarily reduce the queue&#x27;s effective rate. User-specified settings
Dan O'Mearadd494642020-05-01 07:42:23 -07001163 # will not be changed.
1164 #
1165 # System throttling happens because:
1166 #
1167 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
1168 # rate limits will be used. But if the worker returns
1169 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
1170 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
1171 # specified in the `Retry-After` HTTP response header is considered.
1172 #
1173 # * To prevent traffic spikes and to smooth sudden increases in traffic,
1174 # dispatches ramp up slowly when the queue is newly created or idle and
1175 # if large numbers of tasks suddenly become available to dispatch (due to
1176 # spikes in create task rates, the queue being unpaused, or many tasks
1177 # that are scheduled at the same time).
Bu Sun Kim65020912020-05-20 12:08:20 -07001178 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, an
Dan O'Mearadd494642020-05-01 07:42:23 -07001179 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
1180 # token will be generated and attached as an `Authorization` header in the
1181 # HTTP request.
1182 #
1183 # This type of authorization can be used for many scenarios, including
1184 # calling Cloud Run, or endpoints where you intend to validate the token
1185 # yourself.
1186 # [OpenID Connect
1187 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
1188 # This type of authorization can be used for many scenarios, including
1189 # calling Cloud Run, or endpoints where you intend to validate the token
1190 # yourself.
Bu Sun Kim65020912020-05-20 12:08:20 -07001191 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. If not specified, the URI
Dan O'Mearadd494642020-05-01 07:42:23 -07001192 # specified in target will be used.
Bu Sun Kim65020912020-05-20 12:08:20 -07001193 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
Dan O'Mearadd494642020-05-01 07:42:23 -07001194 # to be used for generating OIDC token.
1195 # The service account must be within the same project as the queue. The
1196 # caller must have iam.serviceAccounts.actAs permission for the service
1197 # account.
1198 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001199 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
1200 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
1201 #
1202 # A request body is allowed only if the
1203 # HTTP method is POST, PUT, or PATCH. It is an
1204 # error to set body on a task with an incompatible HttpMethod.
1205 &quot;oauthToken&quot;: { # Contains information needed for generating an # If specified, an
Dan O'Mearadd494642020-05-01 07:42:23 -07001206 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
1207 # will be generated and attached as an `Authorization` header in the HTTP
1208 # request.
1209 #
1210 # This type of authorization should generally only be used when calling
1211 # Google APIs hosted on *.googleapis.com.
1212 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
1213 # This type of authorization should generally only be used when calling Google
1214 # APIs hosted on *.googleapis.com.
Bu Sun Kim65020912020-05-20 12:08:20 -07001215 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
Dan O'Mearadd494642020-05-01 07:42:23 -07001216 # to be used for generating OAuth token.
1217 # The service account must be within the same project as the queue. The
1218 # caller must have iam.serviceAccounts.actAs permission for the service
1219 # account.
Bu Sun Kim65020912020-05-20 12:08:20 -07001220 &quot;scope&quot;: &quot;A String&quot;, # OAuth scope to be used for generating OAuth access token.
1221 # If not specified, &quot;https://www.googleapis.com/auth/cloud-platform&quot;
1222 # will be used.
Dan O'Mearadd494642020-05-01 07:42:23 -07001223 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001224 &quot;headers&quot;: { # HTTP request headers.
1225 #
1226 # This map contains the header field names and values.
1227 # Headers can be set when the
1228 # task is created.
1229 #
1230 # These headers represent a subset of the headers that will accompany the
1231 # task&#x27;s HTTP request. Some HTTP request headers will be ignored or replaced.
1232 #
1233 # A partial list of headers that will be ignored or replaced is:
1234 #
1235 # * Host: This will be computed by Cloud Tasks and derived from
1236 # HttpRequest.url.
1237 # * Content-Length: This will be computed by Cloud Tasks.
1238 # * User-Agent: This will be set to `&quot;Google-Cloud-Tasks&quot;`.
1239 # * X-Google-*: Google use only.
1240 # * X-AppEngine-*: Google use only.
1241 #
1242 # `Content-Type` won&#x27;t be set by Cloud Tasks. You can explicitly set
1243 # `Content-Type` to a media type when the
1244 # task is created.
1245 # For example, `Content-Type` can be set to `&quot;application/octet-stream&quot;` or
1246 # `&quot;application/json&quot;`.
1247 #
1248 # Headers which can have multiple values (according to RFC2616) can be
1249 # specified using comma-separated values.
1250 #
1251 # The size of the headers must be less than 80KB.
1252 &quot;a_key&quot;: &quot;A String&quot;,
1253 },
1254 &quot;url&quot;: &quot;A String&quot;, # Required. The full url path that the request will be sent to.
1255 #
1256 # This string must begin with either &quot;http://&quot; or &quot;https://&quot;. Some examples
1257 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
1258 # encode some characters for safety and compatibility. The maximum allowed
1259 # URL length is 2083 characters after encoding.
1260 #
1261 # The `Location` header response from a redirect response [`300` - `399`]
1262 # may be followed. The redirect is not counted as a separate attempt.
Dan O'Mearadd494642020-05-01 07:42:23 -07001263 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001264 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
1265 #
1266 # The task name.
1267 #
1268 # The task name must have the following format:
1269 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1270 #
1271 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1272 # hyphens (-), colons (:), or periods (.).
1273 # For more information, see
1274 # [Identifying
1275 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1276 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
1277 # The list of available locations can be obtained by calling
1278 # ListLocations.
1279 # For more information, see https://cloud.google.com/about/locations/.
1280 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1281 # hyphens (-). The maximum length is 100 characters.
1282 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1283 # hyphens (-), or underscores (_). The maximum length is 500 characters.
1284 &quot;dispatchDeadline&quot;: &quot;A String&quot;, # The deadline for requests sent to the worker. If the worker does not
1285 # respond by this deadline then the request is cancelled and the attempt
1286 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
1287 # task according to the RetryConfig.
1288 #
1289 # Note that when the request is cancelled, Cloud Tasks will stop listing for
1290 # the response, but whether the worker stops processing depends on the
1291 # worker. For example, if the worker is stuck, it may not react to cancelled
1292 # requests.
1293 #
1294 # The default and maximum values depend on the type of request:
1295 #
1296 # * For HTTP tasks, the default is 10 minutes. The deadline
1297 # must be in the interval [15 seconds, 30 minutes].
1298 #
1299 # * For App Engine tasks, 0 indicates that the
1300 # request has the default deadline. The default deadline depends on the
1301 # [scaling
1302 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
1303 # of the service: 10 minutes for standard apps with automatic scaling, 24
1304 # hours for standard apps with manual and basic scaling, and 60 minutes for
1305 # flex apps. If the request deadline is set, it must be in the interval [15
1306 # seconds, 24 hours 15 seconds]. Regardless of the task&#x27;s
1307 # `dispatch_deadline`, the app handler will not run for longer than than
1308 # the service&#x27;s timeout. We recommend setting the `dispatch_deadline` to
1309 # at most a few seconds more than the app handler&#x27;s timeout. For more
1310 # information see
1311 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
1312 #
1313 # `dispatch_deadline` will be truncated to the nearest millisecond. The
1314 # deadline is an approximate deadline.
1315 &quot;dispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
1316 #
1317 # This count includes attempts which have been dispatched but haven&#x27;t
1318 # received a response.
1319 &quot;firstAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
1320 #
1321 # Only dispatch_time will be set.
1322 # The other Attempt information is not retained by Cloud Tasks.
1323 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1324 #
1325 # `schedule_time` will be truncated to the nearest microsecond.
1326 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1327 #
1328 # `dispatch_time` will be truncated to the nearest microsecond.
1329 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1330 #
1331 # `response_time` will be truncated to the nearest microsecond.
1332 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
1333 #
1334 # If `response_time` is unset, then the task has not been attempted or is
1335 # currently running and the `response_status` field is meaningless.
1336 # different programming environments, including REST APIs and RPC APIs. It is
1337 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1338 # three pieces of data: error code, error message, and error details.
1339 #
1340 # You can find out more about this error model and how to work with it in the
1341 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1342 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1343 # message types for APIs to use.
1344 {
1345 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1346 },
1347 ],
1348 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1349 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1350 # user-facing error message should be localized and sent in the
1351 # google.rpc.Status.details field, or localized by the client.
1352 },
1353 },
1354 &quot;lastAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
1355 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1356 #
1357 # `schedule_time` will be truncated to the nearest microsecond.
1358 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1359 #
1360 # `dispatch_time` will be truncated to the nearest microsecond.
1361 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1362 #
1363 # `response_time` will be truncated to the nearest microsecond.
1364 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
1365 #
1366 # If `response_time` is unset, then the task has not been attempted or is
1367 # currently running and the `response_status` field is meaningless.
1368 # different programming environments, including REST APIs and RPC APIs. It is
1369 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1370 # three pieces of data: error code, error message, and error details.
1371 #
1372 # You can find out more about this error model and how to work with it in the
1373 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1374 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1375 # message types for APIs to use.
1376 {
1377 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1378 },
1379 ],
1380 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1381 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1382 # user-facing error message should be localized and sent in the
1383 # google.rpc.Status.details field, or localized by the client.
1384 },
1385 },
1386 &quot;responseCount&quot;: 42, # Output only. The number of attempts which have received a response.
1387 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001388 #
1389 # An App Engine task is a task that has AppEngineHttpRequest set.
1390 #
1391 # The message defines the HTTP request that is sent to an App Engine app when
1392 # the task is dispatched.
1393 #
1394 # Using AppEngineHttpRequest requires
1395 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1396 # Google IAM permission for the project
1397 # and the following scope:
1398 #
1399 # `https://www.googleapis.com/auth/cloud-platform`
1400 #
1401 # The task will be delivered to the App Engine app which belongs to the same
1402 # project as the queue. For more information, see
1403 # [How Requests are
1404 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1405 # and how routing is affected by
1406 # [dispatch
1407 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
1408 # Traffic is encrypted during transport and never leaves Google datacenters.
1409 # Because this traffic is carried over a communication mechanism internal to
1410 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
1411 # The request to the handler, however, will appear to have used the HTTP
1412 # protocol.
1413 #
1414 # The AppEngineRouting used to construct the URL that the task is
1415 # delivered to can be set at the queue-level or task-level:
1416 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001417 # * If app_engine_routing_override is set on the
1418 # queue, this value is used for all
1419 # tasks in the queue, no matter what the setting is for the task-level
1420 # app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001421 #
1422 #
1423 # The `url` that the task will be sent to is:
1424 #
1425 # * `url =` host `+`
1426 # relative_uri
1427 #
1428 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
1429 # URIs restricted with
1430 # [`login:
1431 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
1432 # Because tasks are not run as any user, they cannot be dispatched to URIs
1433 # restricted with
1434 # [`login:
1435 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
1436 # Task dispatches also do not follow redirects.
1437 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001438 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001439 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07001440 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001441 # not receive response before the deadline. Failed
1442 # tasks will be retried according to the
1443 # retry configuration. `503` (Service Unavailable) is
1444 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07001445 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
1446 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001447 # Requests) response from an app handler does not cause traffic congestion
1448 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -07001449 &quot;relativeUri&quot;: &quot;A String&quot;, # The relative URI.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001450 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001451 # The relative URI must begin with &quot;/&quot; and must be a valid HTTP relative URI.
1452 # It can contain a path and query string arguments.
1453 # If the relative URI is empty, then the root path &quot;/&quot; will be used.
1454 # No spaces are allowed, and the maximum length allowed is 2083 characters.
1455 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001456 #
1457 # This map contains the header field names and values.
1458 # Headers can be set when the
1459 # task is created.
1460 # Repeated headers are not supported but a header value can contain commas.
1461 #
1462 # Cloud Tasks sets some headers to default values:
1463 #
1464 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07001465 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001466 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07001467 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001468 # modified `User-Agent`.
1469 #
1470 # If the task has a body, Cloud
1471 # Tasks sets the following headers:
1472 #
1473 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07001474 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001475 # setting `Content-Type` to a particular media type when the
1476 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07001477 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001478 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1479 # output only. It cannot be changed.
1480 #
1481 # The headers below cannot be set or overridden:
1482 #
1483 # * `Host`
1484 # * `X-Google-*`
1485 # * `X-AppEngine-*`
1486 #
1487 # In addition, Cloud Tasks sets some headers when the task is dispatched,
1488 # such as headers containing information about the task; see
1489 # [request
Dan O'Mearadd494642020-05-01 07:42:23 -07001490 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001491 # These headers are set only when the task is dispatched, so they are not
1492 # visible when the task is returned in a Cloud Tasks response.
1493 #
1494 # Although there is no specific limit for the maximum number of headers or
1495 # the size, there is a limit on the maximum size of the Task. For more
1496 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07001497 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001498 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001499 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001500 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001501 # * If app_engine_routing_override is set on the
1502 # queue, this value is used for all
1503 # tasks in the queue, no matter what the setting is for the task-level
1504 # app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001505 #
1506 # Defines routing characteristics specific to App Engine - service, version,
1507 # and instance.
1508 #
1509 # For more information about services, versions, and instances see
1510 # [An Overview of App
1511 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
1512 # [Microservices Architecture on Google App
1513 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
1514 # [App Engine Standard request
1515 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
1516 # and [App Engine Flex request
1517 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Dan O'Mearadd494642020-05-01 07:42:23 -07001518 #
1519 # Using AppEngineRouting requires
1520 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1521 # Google IAM permission for the project
1522 # and the following scope:
1523 #
1524 # `https://www.googleapis.com/auth/cloud-platform`
Bu Sun Kim65020912020-05-20 12:08:20 -07001525 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001526 #
1527 # By default, the task is sent to the service which is the default
1528 # service when the task is attempted.
1529 #
1530 # For some queues or tasks which were created using the App Engine
1531 # Task Queue API, host is not parsable
1532 # into service,
1533 # version, and
1534 # instance. For example, some tasks
1535 # which were created using the App Engine SDK use a custom domain
1536 # name; custom domains are not parsed by Cloud Tasks. If
1537 # host is not parsable, then
1538 # service,
1539 # version, and
1540 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -07001541 &quot;instance&quot;: &quot;A String&quot;, # App instance.
1542 #
1543 # By default, the task is sent to an instance which is available when
1544 # the task is attempted.
1545 #
1546 # Requests can only be sent to a specific instance if
1547 # [manual scaling is used in App Engine
1548 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
1549 # App Engine Flex does not support instances. For more information, see
1550 # [App Engine Standard request
1551 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1552 # and [App Engine Flex request
1553 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
1554 &quot;version&quot;: &quot;A String&quot;, # App version.
1555 #
1556 # By default, the task is sent to the version which is the default
1557 # version when the task is attempted.
1558 #
1559 # For some queues or tasks which were created using the App Engine
1560 # Task Queue API, host is not parsable
1561 # into service,
1562 # version, and
1563 # instance. For example, some tasks
1564 # which were created using the App Engine SDK use a custom domain
1565 # name; custom domains are not parsed by Cloud Tasks. If
1566 # host is not parsable, then
1567 # service,
1568 # version, and
1569 # instance are the empty string.
1570 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
1571 #
1572 # The host is constructed from the domain name of the app associated with
1573 # the queue&#x27;s project ID (for example &lt;app-id&gt;.appspot.com), and the
1574 # service, version,
1575 # and instance. Tasks which were created using
1576 # the App Engine SDK might have a custom domain name.
1577 #
1578 # For more information, see
1579 # [How Requests are
1580 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001581 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001582 &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 -07001583 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001584 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
Dan O'Mearadd494642020-05-01 07:42:23 -07001585 # HTTP requests with this http_method, otherwise the task attempt fails with
1586 # error code 405 (Method Not Allowed). See [Writing a push task request
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001587 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
Dan O'Mearadd494642020-05-01 07:42:23 -07001588 # and the App Engine documentation for your runtime on [How Requests are
1589 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim65020912020-05-20 12:08:20 -07001590 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
1591 #
1592 # A request body is allowed only if the HTTP method is POST or PUT. It is
1593 # an error to set a body on a task with an incompatible HttpMethod.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001594 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001595 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001596 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001597 }</pre>
1598</div>
1599
1600<div class="method">
Bu Sun Kim65020912020-05-20 12:08:20 -07001601 <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 -07001602 <pre>Lists the tasks in a queue.
1603
1604By default, only the BASIC view is retrieved
1605due to performance considerations;
1606response_view controls the
1607subset of information which is returned.
1608
1609The tasks may be returned in any order. The ordering may change at any
1610time.
1611
1612Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07001613 parent: string, Required. The queue name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001614`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` (required)
1615 responseView: string, The response_view specifies which subset of the Task will be
1616returned.
1617
1618By default response_view is BASIC; not all
1619information is retrieved by default because some data, such as
1620payloads, might be desirable to return only when needed because
1621of its large size or because of the sensitivity of data that it
1622contains.
1623
1624Authorization for FULL requires
1625`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
1626permission on the Task resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001627 pageToken: string, A token identifying the page of results to return.
1628
1629To request the first page results, page_token must be empty. To
1630request the next page of results, page_token must be the value of
1631next_page_token returned
1632from the previous call to ListTasks
1633method.
1634
1635The page token is valid for only 2 hours.
Bu Sun Kim65020912020-05-20 12:08:20 -07001636 pageSize: integer, Maximum page size.
1637
1638Fewer tasks than requested might be returned, even if more tasks exist; use
1639next_page_token in the response to
1640determine if more tasks exist.
1641
1642The maximum page size is 1000. If unspecified, the page size will be the
1643maximum.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001644 x__xgafv: string, V1 error format.
1645 Allowed values
1646 1 - v1 error format
1647 2 - v2 error format
1648
1649Returns:
1650 An object of the form:
1651
1652 { # Response message for listing tasks using ListTasks.
Bu Sun Kim65020912020-05-20 12:08:20 -07001653 &quot;tasks&quot;: [ # The list of tasks.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001654 { # A unit of scheduled work.
Bu Sun Kim65020912020-05-20 12:08:20 -07001655 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted or retried.
1656 #
1657 # `schedule_time` will be truncated to the nearest microsecond.
1658 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
1659 #
1660 # `create_time` will be truncated to the nearest second.
1661 &quot;httpRequest&quot;: { # HTTP request. # HTTP request that is sent to the worker.
Dan O'Mearadd494642020-05-01 07:42:23 -07001662 #
1663 # An HTTP task is a task that has HttpRequest set.
1664 #
1665 # The task will be pushed to the worker as an HTTP request. If the worker
1666 # or the redirected worker acknowledges the task by returning a successful HTTP
1667 # response code ([`200` - `299`]), the task will be removed from the queue. If
1668 # any other HTTP response code is returned or no response is received, the
1669 # task will be retried according to the following:
1670 #
1671 # * User-specified throttling: retry configuration,
Bu Sun Kim65020912020-05-20 12:08:20 -07001672 # rate limits, and the queue&#x27;s state.
Dan O'Mearadd494642020-05-01 07:42:23 -07001673 #
1674 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
Bu Sun Kim65020912020-05-20 12:08:20 -07001675 # temporarily reduce the queue&#x27;s effective rate. User-specified settings
Dan O'Mearadd494642020-05-01 07:42:23 -07001676 # will not be changed.
1677 #
1678 # System throttling happens because:
1679 #
1680 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
1681 # rate limits will be used. But if the worker returns
1682 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
1683 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
1684 # specified in the `Retry-After` HTTP response header is considered.
1685 #
1686 # * To prevent traffic spikes and to smooth sudden increases in traffic,
1687 # dispatches ramp up slowly when the queue is newly created or idle and
1688 # if large numbers of tasks suddenly become available to dispatch (due to
1689 # spikes in create task rates, the queue being unpaused, or many tasks
1690 # that are scheduled at the same time).
Bu Sun Kim65020912020-05-20 12:08:20 -07001691 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, an
Dan O'Mearadd494642020-05-01 07:42:23 -07001692 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
1693 # token will be generated and attached as an `Authorization` header in the
1694 # HTTP request.
1695 #
1696 # This type of authorization can be used for many scenarios, including
1697 # calling Cloud Run, or endpoints where you intend to validate the token
1698 # yourself.
1699 # [OpenID Connect
1700 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
1701 # This type of authorization can be used for many scenarios, including
1702 # calling Cloud Run, or endpoints where you intend to validate the token
1703 # yourself.
Bu Sun Kim65020912020-05-20 12:08:20 -07001704 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. If not specified, the URI
Dan O'Mearadd494642020-05-01 07:42:23 -07001705 # specified in target will be used.
Bu Sun Kim65020912020-05-20 12:08:20 -07001706 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
Dan O'Mearadd494642020-05-01 07:42:23 -07001707 # to be used for generating OIDC token.
1708 # The service account must be within the same project as the queue. The
1709 # caller must have iam.serviceAccounts.actAs permission for the service
1710 # account.
1711 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001712 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
1713 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
1714 #
1715 # A request body is allowed only if the
1716 # HTTP method is POST, PUT, or PATCH. It is an
1717 # error to set body on a task with an incompatible HttpMethod.
1718 &quot;oauthToken&quot;: { # Contains information needed for generating an # If specified, an
Dan O'Mearadd494642020-05-01 07:42:23 -07001719 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
1720 # will be generated and attached as an `Authorization` header in the HTTP
1721 # request.
1722 #
1723 # This type of authorization should generally only be used when calling
1724 # Google APIs hosted on *.googleapis.com.
1725 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
1726 # This type of authorization should generally only be used when calling Google
1727 # APIs hosted on *.googleapis.com.
Bu Sun Kim65020912020-05-20 12:08:20 -07001728 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
Dan O'Mearadd494642020-05-01 07:42:23 -07001729 # to be used for generating OAuth token.
1730 # The service account must be within the same project as the queue. The
1731 # caller must have iam.serviceAccounts.actAs permission for the service
1732 # account.
Bu Sun Kim65020912020-05-20 12:08:20 -07001733 &quot;scope&quot;: &quot;A String&quot;, # OAuth scope to be used for generating OAuth access token.
1734 # If not specified, &quot;https://www.googleapis.com/auth/cloud-platform&quot;
1735 # will be used.
Dan O'Mearadd494642020-05-01 07:42:23 -07001736 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001737 &quot;headers&quot;: { # HTTP request headers.
1738 #
1739 # This map contains the header field names and values.
1740 # Headers can be set when the
1741 # task is created.
1742 #
1743 # These headers represent a subset of the headers that will accompany the
1744 # task&#x27;s HTTP request. Some HTTP request headers will be ignored or replaced.
1745 #
1746 # A partial list of headers that will be ignored or replaced is:
1747 #
1748 # * Host: This will be computed by Cloud Tasks and derived from
1749 # HttpRequest.url.
1750 # * Content-Length: This will be computed by Cloud Tasks.
1751 # * User-Agent: This will be set to `&quot;Google-Cloud-Tasks&quot;`.
1752 # * X-Google-*: Google use only.
1753 # * X-AppEngine-*: Google use only.
1754 #
1755 # `Content-Type` won&#x27;t be set by Cloud Tasks. You can explicitly set
1756 # `Content-Type` to a media type when the
1757 # task is created.
1758 # For example, `Content-Type` can be set to `&quot;application/octet-stream&quot;` or
1759 # `&quot;application/json&quot;`.
1760 #
1761 # Headers which can have multiple values (according to RFC2616) can be
1762 # specified using comma-separated values.
1763 #
1764 # The size of the headers must be less than 80KB.
1765 &quot;a_key&quot;: &quot;A String&quot;,
1766 },
1767 &quot;url&quot;: &quot;A String&quot;, # Required. The full url path that the request will be sent to.
1768 #
1769 # This string must begin with either &quot;http://&quot; or &quot;https://&quot;. Some examples
1770 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
1771 # encode some characters for safety and compatibility. The maximum allowed
1772 # URL length is 2083 characters after encoding.
1773 #
1774 # The `Location` header response from a redirect response [`300` - `399`]
1775 # may be followed. The redirect is not counted as a separate attempt.
Dan O'Mearadd494642020-05-01 07:42:23 -07001776 },
Bu Sun Kim65020912020-05-20 12:08:20 -07001777 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
1778 #
1779 # The task name.
1780 #
1781 # The task name must have the following format:
1782 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
1783 #
1784 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
1785 # hyphens (-), colons (:), or periods (.).
1786 # For more information, see
1787 # [Identifying
1788 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
1789 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
1790 # The list of available locations can be obtained by calling
1791 # ListLocations.
1792 # For more information, see https://cloud.google.com/about/locations/.
1793 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
1794 # hyphens (-). The maximum length is 100 characters.
1795 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
1796 # hyphens (-), or underscores (_). The maximum length is 500 characters.
1797 &quot;dispatchDeadline&quot;: &quot;A String&quot;, # The deadline for requests sent to the worker. If the worker does not
1798 # respond by this deadline then the request is cancelled and the attempt
1799 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
1800 # task according to the RetryConfig.
1801 #
1802 # Note that when the request is cancelled, Cloud Tasks will stop listing for
1803 # the response, but whether the worker stops processing depends on the
1804 # worker. For example, if the worker is stuck, it may not react to cancelled
1805 # requests.
1806 #
1807 # The default and maximum values depend on the type of request:
1808 #
1809 # * For HTTP tasks, the default is 10 minutes. The deadline
1810 # must be in the interval [15 seconds, 30 minutes].
1811 #
1812 # * For App Engine tasks, 0 indicates that the
1813 # request has the default deadline. The default deadline depends on the
1814 # [scaling
1815 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
1816 # of the service: 10 minutes for standard apps with automatic scaling, 24
1817 # hours for standard apps with manual and basic scaling, and 60 minutes for
1818 # flex apps. If the request deadline is set, it must be in the interval [15
1819 # seconds, 24 hours 15 seconds]. Regardless of the task&#x27;s
1820 # `dispatch_deadline`, the app handler will not run for longer than than
1821 # the service&#x27;s timeout. We recommend setting the `dispatch_deadline` to
1822 # at most a few seconds more than the app handler&#x27;s timeout. For more
1823 # information see
1824 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
1825 #
1826 # `dispatch_deadline` will be truncated to the nearest millisecond. The
1827 # deadline is an approximate deadline.
1828 &quot;dispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
1829 #
1830 # This count includes attempts which have been dispatched but haven&#x27;t
1831 # received a response.
1832 &quot;firstAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
1833 #
1834 # Only dispatch_time will be set.
1835 # The other Attempt information is not retained by Cloud Tasks.
1836 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1837 #
1838 # `schedule_time` will be truncated to the nearest microsecond.
1839 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1840 #
1841 # `dispatch_time` will be truncated to the nearest microsecond.
1842 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1843 #
1844 # `response_time` will be truncated to the nearest microsecond.
1845 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
1846 #
1847 # If `response_time` is unset, then the task has not been attempted or is
1848 # currently running and the `response_status` field is meaningless.
1849 # different programming environments, including REST APIs and RPC APIs. It is
1850 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1851 # three pieces of data: error code, error message, and error details.
1852 #
1853 # You can find out more about this error model and how to work with it in the
1854 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1855 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1856 # message types for APIs to use.
1857 {
1858 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1859 },
1860 ],
1861 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1862 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1863 # user-facing error message should be localized and sent in the
1864 # google.rpc.Status.details field, or localized by the client.
1865 },
1866 },
1867 &quot;lastAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
1868 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
1869 #
1870 # `schedule_time` will be truncated to the nearest microsecond.
1871 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
1872 #
1873 # `dispatch_time` will be truncated to the nearest microsecond.
1874 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
1875 #
1876 # `response_time` will be truncated to the nearest microsecond.
1877 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
1878 #
1879 # If `response_time` is unset, then the task has not been attempted or is
1880 # currently running and the `response_status` field is meaningless.
1881 # different programming environments, including REST APIs and RPC APIs. It is
1882 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
1883 # three pieces of data: error code, error message, and error details.
1884 #
1885 # You can find out more about this error model and how to work with it in the
1886 # [API Design Guide](https://cloud.google.com/apis/design/errors).
1887 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
1888 # message types for APIs to use.
1889 {
1890 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
1891 },
1892 ],
1893 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
1894 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
1895 # user-facing error message should be localized and sent in the
1896 # google.rpc.Status.details field, or localized by the client.
1897 },
1898 },
1899 &quot;responseCount&quot;: 42, # Output only. The number of attempts which have received a response.
1900 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001901 #
1902 # An App Engine task is a task that has AppEngineHttpRequest set.
1903 #
1904 # The message defines the HTTP request that is sent to an App Engine app when
1905 # the task is dispatched.
1906 #
1907 # Using AppEngineHttpRequest requires
1908 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
1909 # Google IAM permission for the project
1910 # and the following scope:
1911 #
1912 # `https://www.googleapis.com/auth/cloud-platform`
1913 #
1914 # The task will be delivered to the App Engine app which belongs to the same
1915 # project as the queue. For more information, see
1916 # [How Requests are
1917 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
1918 # and how routing is affected by
1919 # [dispatch
1920 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
1921 # Traffic is encrypted during transport and never leaves Google datacenters.
1922 # Because this traffic is carried over a communication mechanism internal to
1923 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
1924 # The request to the handler, however, will appear to have used the HTTP
1925 # protocol.
1926 #
1927 # The AppEngineRouting used to construct the URL that the task is
1928 # delivered to can be set at the queue-level or task-level:
1929 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001930 # * If app_engine_routing_override is set on the
1931 # queue, this value is used for all
1932 # tasks in the queue, no matter what the setting is for the task-level
1933 # app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001934 #
1935 #
1936 # The `url` that the task will be sent to is:
1937 #
1938 # * `url =` host `+`
1939 # relative_uri
1940 #
1941 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
1942 # URIs restricted with
1943 # [`login:
1944 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
1945 # Because tasks are not run as any user, they cannot be dispatched to URIs
1946 # restricted with
1947 # [`login:
1948 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
1949 # Task dispatches also do not follow redirects.
1950 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001951 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001952 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07001953 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001954 # not receive response before the deadline. Failed
1955 # tasks will be retried according to the
1956 # retry configuration. `503` (Service Unavailable) is
1957 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07001958 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
1959 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001960 # Requests) response from an app handler does not cause traffic congestion
1961 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -07001962 &quot;relativeUri&quot;: &quot;A String&quot;, # The relative URI.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001963 #
Bu Sun Kim65020912020-05-20 12:08:20 -07001964 # The relative URI must begin with &quot;/&quot; and must be a valid HTTP relative URI.
1965 # It can contain a path and query string arguments.
1966 # If the relative URI is empty, then the root path &quot;/&quot; will be used.
1967 # No spaces are allowed, and the maximum length allowed is 2083 characters.
1968 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001969 #
1970 # This map contains the header field names and values.
1971 # Headers can be set when the
1972 # task is created.
1973 # Repeated headers are not supported but a header value can contain commas.
1974 #
1975 # Cloud Tasks sets some headers to default values:
1976 #
1977 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07001978 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001979 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07001980 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001981 # modified `User-Agent`.
1982 #
1983 # If the task has a body, Cloud
1984 # Tasks sets the following headers:
1985 #
1986 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07001987 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001988 # setting `Content-Type` to a particular media type when the
1989 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07001990 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001991 # * `Content-Length`: This is computed by Cloud Tasks. This value is
1992 # output only. It cannot be changed.
1993 #
1994 # The headers below cannot be set or overridden:
1995 #
1996 # * `Host`
1997 # * `X-Google-*`
1998 # * `X-AppEngine-*`
1999 #
2000 # In addition, Cloud Tasks sets some headers when the task is dispatched,
2001 # such as headers containing information about the task; see
2002 # [request
Dan O'Mearadd494642020-05-01 07:42:23 -07002003 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002004 # These headers are set only when the task is dispatched, so they are not
2005 # visible when the task is returned in a Cloud Tasks response.
2006 #
2007 # Although there is no specific limit for the maximum number of headers or
2008 # the size, there is a limit on the maximum size of the Task. For more
2009 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07002010 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002011 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002012 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002013 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002014 # * If app_engine_routing_override is set on the
2015 # queue, this value is used for all
2016 # tasks in the queue, no matter what the setting is for the task-level
2017 # app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002018 #
2019 # Defines routing characteristics specific to App Engine - service, version,
2020 # and instance.
2021 #
2022 # For more information about services, versions, and instances see
2023 # [An Overview of App
2024 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
2025 # [Microservices Architecture on Google App
2026 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
2027 # [App Engine Standard request
2028 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
2029 # and [App Engine Flex request
2030 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Dan O'Mearadd494642020-05-01 07:42:23 -07002031 #
2032 # Using AppEngineRouting requires
2033 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
2034 # Google IAM permission for the project
2035 # and the following scope:
2036 #
2037 # `https://www.googleapis.com/auth/cloud-platform`
Bu Sun Kim65020912020-05-20 12:08:20 -07002038 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002039 #
2040 # By default, the task is sent to the service which is the default
2041 # service when the task is attempted.
2042 #
2043 # For some queues or tasks which were created using the App Engine
2044 # Task Queue API, host is not parsable
2045 # into service,
2046 # version, and
2047 # instance. For example, some tasks
2048 # which were created using the App Engine SDK use a custom domain
2049 # name; custom domains are not parsed by Cloud Tasks. If
2050 # host is not parsable, then
2051 # service,
2052 # version, and
2053 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -07002054 &quot;instance&quot;: &quot;A String&quot;, # App instance.
2055 #
2056 # By default, the task is sent to an instance which is available when
2057 # the task is attempted.
2058 #
2059 # Requests can only be sent to a specific instance if
2060 # [manual scaling is used in App Engine
2061 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
2062 # App Engine Flex does not support instances. For more information, see
2063 # [App Engine Standard request
2064 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2065 # and [App Engine Flex request
2066 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
2067 &quot;version&quot;: &quot;A String&quot;, # App version.
2068 #
2069 # By default, the task is sent to the version which is the default
2070 # version when the task is attempted.
2071 #
2072 # For some queues or tasks which were created using the App Engine
2073 # Task Queue API, host is not parsable
2074 # into service,
2075 # version, and
2076 # instance. For example, some tasks
2077 # which were created using the App Engine SDK use a custom domain
2078 # name; custom domains are not parsed by Cloud Tasks. If
2079 # host is not parsable, then
2080 # service,
2081 # version, and
2082 # instance are the empty string.
2083 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
2084 #
2085 # The host is constructed from the domain name of the app associated with
2086 # the queue&#x27;s project ID (for example &lt;app-id&gt;.appspot.com), and the
2087 # service, version,
2088 # and instance. Tasks which were created using
2089 # the App Engine SDK might have a custom domain name.
2090 #
2091 # For more information, see
2092 # [How Requests are
2093 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002094 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002095 &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 -07002096 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002097 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
Dan O'Mearadd494642020-05-01 07:42:23 -07002098 # HTTP requests with this http_method, otherwise the task attempt fails with
2099 # error code 405 (Method Not Allowed). See [Writing a push task request
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002100 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
Dan O'Mearadd494642020-05-01 07:42:23 -07002101 # and the App Engine documentation for your runtime on [How Requests are
2102 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim65020912020-05-20 12:08:20 -07002103 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
2104 #
2105 # A request body is allowed only if the HTTP method is POST or PUT. It is
2106 # an error to set a body on a task with an incompatible HttpMethod.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002107 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002108 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002109 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002110 },
2111 ],
Bu Sun Kim65020912020-05-20 12:08:20 -07002112 &quot;nextPageToken&quot;: &quot;A String&quot;, # A token to retrieve next page of results.
2113 #
2114 # To return the next page of results, call
2115 # ListTasks with this value as the
2116 # page_token.
2117 #
2118 # If the next_page_token is empty, there are no more results.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002119 }</pre>
2120</div>
2121
2122<div class="method">
2123 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
2124 <pre>Retrieves the next page of results.
2125
2126Args:
2127 previous_request: The request for the previous page. (required)
2128 previous_response: The response from the request for the previous page. (required)
2129
2130Returns:
Bu Sun Kim65020912020-05-20 12:08:20 -07002131 A request object that you can call &#x27;execute()&#x27; on to request the next
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002132 page. Returns None if there are no more items in the collection.
2133 </pre>
2134</div>
2135
2136<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07002137 <code class="details" id="run">run(name, body=None, x__xgafv=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002138 <pre>Forces a task to run now.
2139
2140When this method is called, Cloud Tasks will dispatch the task, even if
2141the task is already running, the queue has reached its RateLimits or
2142is PAUSED.
2143
2144This command is meant to be used for manual debugging. For
2145example, RunTask can be used to retry a failed
2146task after a fix has been made or to manually force a task to be
2147dispatched now.
2148
2149The dispatched task is returned. That is, the task that is returned
2150contains the status after the task is dispatched but
2151before the task is received by its target.
2152
Bu Sun Kim65020912020-05-20 12:08:20 -07002153If Cloud Tasks receives a successful response from the task&#x27;s
2154target, then the task will be deleted; otherwise the task&#x27;s
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002155schedule_time will be reset to the time that
2156RunTask was called plus the retry delay specified
Bu Sun Kim65020912020-05-20 12:08:20 -07002157in the queue&#x27;s RetryConfig.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002158
2159RunTask returns
2160NOT_FOUND when it is called on a
2161task that has already succeeded or permanently failed.
2162
2163Args:
Dan O'Mearadd494642020-05-01 07:42:23 -07002164 name: string, Required. The task name. For example:
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002165`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07002166 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002167 The object takes the form of:
2168
2169{ # Request message for forcing a task to run now using
2170 # RunTask.
Bu Sun Kim65020912020-05-20 12:08:20 -07002171 &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 -07002172 # returned.
2173 #
2174 # By default response_view is BASIC; not all
2175 # information is retrieved by default because some data, such as
2176 # payloads, might be desirable to return only when needed because
2177 # of its large size or because of the sensitivity of data that it
2178 # contains.
2179 #
2180 # Authorization for FULL requires
2181 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/)
2182 # permission on the Task resource.
2183 }
2184
2185 x__xgafv: string, V1 error format.
2186 Allowed values
2187 1 - v1 error format
2188 2 - v2 error format
2189
2190Returns:
2191 An object of the form:
2192
2193 { # A unit of scheduled work.
Bu Sun Kim65020912020-05-20 12:08:20 -07002194 &quot;scheduleTime&quot;: &quot;A String&quot;, # The time when the task is scheduled to be attempted or retried.
2195 #
2196 # `schedule_time` will be truncated to the nearest microsecond.
2197 &quot;createTime&quot;: &quot;A String&quot;, # Output only. The time that the task was created.
2198 #
2199 # `create_time` will be truncated to the nearest second.
2200 &quot;httpRequest&quot;: { # HTTP request. # HTTP request that is sent to the worker.
Dan O'Mearadd494642020-05-01 07:42:23 -07002201 #
2202 # An HTTP task is a task that has HttpRequest set.
2203 #
2204 # The task will be pushed to the worker as an HTTP request. If the worker
2205 # or the redirected worker acknowledges the task by returning a successful HTTP
2206 # response code ([`200` - `299`]), the task will be removed from the queue. If
2207 # any other HTTP response code is returned or no response is received, the
2208 # task will be retried according to the following:
2209 #
2210 # * User-specified throttling: retry configuration,
Bu Sun Kim65020912020-05-20 12:08:20 -07002211 # rate limits, and the queue&#x27;s state.
Dan O'Mearadd494642020-05-01 07:42:23 -07002212 #
2213 # * System throttling: To prevent the worker from overloading, Cloud Tasks may
Bu Sun Kim65020912020-05-20 12:08:20 -07002214 # temporarily reduce the queue&#x27;s effective rate. User-specified settings
Dan O'Mearadd494642020-05-01 07:42:23 -07002215 # will not be changed.
2216 #
2217 # System throttling happens because:
2218 #
2219 # * Cloud Tasks backs off on all errors. Normally the backoff specified in
2220 # rate limits will be used. But if the worker returns
2221 # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of
2222 # errors is high, Cloud Tasks will use a higher backoff rate. The retry
2223 # specified in the `Retry-After` HTTP response header is considered.
2224 #
2225 # * To prevent traffic spikes and to smooth sudden increases in traffic,
2226 # dispatches ramp up slowly when the queue is newly created or idle and
2227 # if large numbers of tasks suddenly become available to dispatch (due to
2228 # spikes in create task rates, the queue being unpaused, or many tasks
2229 # that are scheduled at the same time).
Bu Sun Kim65020912020-05-20 12:08:20 -07002230 &quot;oidcToken&quot;: { # Contains information needed for generating an # If specified, an
Dan O'Mearadd494642020-05-01 07:42:23 -07002231 # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect)
2232 # token will be generated and attached as an `Authorization` header in the
2233 # HTTP request.
2234 #
2235 # This type of authorization can be used for many scenarios, including
2236 # calling Cloud Run, or endpoints where you intend to validate the token
2237 # yourself.
2238 # [OpenID Connect
2239 # token](https://developers.google.com/identity/protocols/OpenIDConnect).
2240 # This type of authorization can be used for many scenarios, including
2241 # calling Cloud Run, or endpoints where you intend to validate the token
2242 # yourself.
Bu Sun Kim65020912020-05-20 12:08:20 -07002243 &quot;audience&quot;: &quot;A String&quot;, # Audience to be used when generating OIDC token. If not specified, the URI
Dan O'Mearadd494642020-05-01 07:42:23 -07002244 # specified in target will be used.
Bu Sun Kim65020912020-05-20 12:08:20 -07002245 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
Dan O'Mearadd494642020-05-01 07:42:23 -07002246 # to be used for generating OIDC token.
2247 # The service account must be within the same project as the queue. The
2248 # caller must have iam.serviceAccounts.actAs permission for the service
2249 # account.
2250 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002251 &quot;httpMethod&quot;: &quot;A String&quot;, # The HTTP method to use for the request. The default is POST.
2252 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
2253 #
2254 # A request body is allowed only if the
2255 # HTTP method is POST, PUT, or PATCH. It is an
2256 # error to set body on a task with an incompatible HttpMethod.
2257 &quot;oauthToken&quot;: { # Contains information needed for generating an # If specified, an
Dan O'Mearadd494642020-05-01 07:42:23 -07002258 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2)
2259 # will be generated and attached as an `Authorization` header in the HTTP
2260 # request.
2261 #
2262 # This type of authorization should generally only be used when calling
2263 # Google APIs hosted on *.googleapis.com.
2264 # [OAuth token](https://developers.google.com/identity/protocols/OAuth2).
2265 # This type of authorization should generally only be used when calling Google
2266 # APIs hosted on *.googleapis.com.
Bu Sun Kim65020912020-05-20 12:08:20 -07002267 &quot;serviceAccountEmail&quot;: &quot;A String&quot;, # [Service account email](https://cloud.google.com/iam/docs/service-accounts)
Dan O'Mearadd494642020-05-01 07:42:23 -07002268 # to be used for generating OAuth token.
2269 # The service account must be within the same project as the queue. The
2270 # caller must have iam.serviceAccounts.actAs permission for the service
2271 # account.
Bu Sun Kim65020912020-05-20 12:08:20 -07002272 &quot;scope&quot;: &quot;A String&quot;, # OAuth scope to be used for generating OAuth access token.
2273 # If not specified, &quot;https://www.googleapis.com/auth/cloud-platform&quot;
2274 # will be used.
Dan O'Mearadd494642020-05-01 07:42:23 -07002275 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002276 &quot;headers&quot;: { # HTTP request headers.
2277 #
2278 # This map contains the header field names and values.
2279 # Headers can be set when the
2280 # task is created.
2281 #
2282 # These headers represent a subset of the headers that will accompany the
2283 # task&#x27;s HTTP request. Some HTTP request headers will be ignored or replaced.
2284 #
2285 # A partial list of headers that will be ignored or replaced is:
2286 #
2287 # * Host: This will be computed by Cloud Tasks and derived from
2288 # HttpRequest.url.
2289 # * Content-Length: This will be computed by Cloud Tasks.
2290 # * User-Agent: This will be set to `&quot;Google-Cloud-Tasks&quot;`.
2291 # * X-Google-*: Google use only.
2292 # * X-AppEngine-*: Google use only.
2293 #
2294 # `Content-Type` won&#x27;t be set by Cloud Tasks. You can explicitly set
2295 # `Content-Type` to a media type when the
2296 # task is created.
2297 # For example, `Content-Type` can be set to `&quot;application/octet-stream&quot;` or
2298 # `&quot;application/json&quot;`.
2299 #
2300 # Headers which can have multiple values (according to RFC2616) can be
2301 # specified using comma-separated values.
2302 #
2303 # The size of the headers must be less than 80KB.
2304 &quot;a_key&quot;: &quot;A String&quot;,
2305 },
2306 &quot;url&quot;: &quot;A String&quot;, # Required. The full url path that the request will be sent to.
2307 #
2308 # This string must begin with either &quot;http://&quot; or &quot;https://&quot;. Some examples
2309 # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will
2310 # encode some characters for safety and compatibility. The maximum allowed
2311 # URL length is 2083 characters after encoding.
2312 #
2313 # The `Location` header response from a redirect response [`300` - `399`]
2314 # may be followed. The redirect is not counted as a separate attempt.
Dan O'Mearadd494642020-05-01 07:42:23 -07002315 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002316 &quot;name&quot;: &quot;A String&quot;, # Optionally caller-specified in CreateTask.
2317 #
2318 # The task name.
2319 #
2320 # The task name must have the following format:
2321 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`
2322 #
2323 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]),
2324 # hyphens (-), colons (:), or periods (.).
2325 # For more information, see
2326 # [Identifying
2327 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects)
2328 # * `LOCATION_ID` is the canonical ID for the task&#x27;s location.
2329 # The list of available locations can be obtained by calling
2330 # ListLocations.
2331 # For more information, see https://cloud.google.com/about/locations/.
2332 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or
2333 # hyphens (-). The maximum length is 100 characters.
2334 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]),
2335 # hyphens (-), or underscores (_). The maximum length is 500 characters.
2336 &quot;dispatchDeadline&quot;: &quot;A String&quot;, # The deadline for requests sent to the worker. If the worker does not
2337 # respond by this deadline then the request is cancelled and the attempt
2338 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the
2339 # task according to the RetryConfig.
2340 #
2341 # Note that when the request is cancelled, Cloud Tasks will stop listing for
2342 # the response, but whether the worker stops processing depends on the
2343 # worker. For example, if the worker is stuck, it may not react to cancelled
2344 # requests.
2345 #
2346 # The default and maximum values depend on the type of request:
2347 #
2348 # * For HTTP tasks, the default is 10 minutes. The deadline
2349 # must be in the interval [15 seconds, 30 minutes].
2350 #
2351 # * For App Engine tasks, 0 indicates that the
2352 # request has the default deadline. The default deadline depends on the
2353 # [scaling
2354 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling)
2355 # of the service: 10 minutes for standard apps with automatic scaling, 24
2356 # hours for standard apps with manual and basic scaling, and 60 minutes for
2357 # flex apps. If the request deadline is set, it must be in the interval [15
2358 # seconds, 24 hours 15 seconds]. Regardless of the task&#x27;s
2359 # `dispatch_deadline`, the app handler will not run for longer than than
2360 # the service&#x27;s timeout. We recommend setting the `dispatch_deadline` to
2361 # at most a few seconds more than the app handler&#x27;s timeout. For more
2362 # information see
2363 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts).
2364 #
2365 # `dispatch_deadline` will be truncated to the nearest millisecond. The
2366 # deadline is an approximate deadline.
2367 &quot;dispatchCount&quot;: 42, # Output only. The number of attempts dispatched.
2368 #
2369 # This count includes attempts which have been dispatched but haven&#x27;t
2370 # received a response.
2371 &quot;firstAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s first attempt.
2372 #
2373 # Only dispatch_time will be set.
2374 # The other Attempt information is not retained by Cloud Tasks.
2375 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
2376 #
2377 # `schedule_time` will be truncated to the nearest microsecond.
2378 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2379 #
2380 # `dispatch_time` will be truncated to the nearest microsecond.
2381 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2382 #
2383 # `response_time` will be truncated to the nearest microsecond.
2384 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
2385 #
2386 # If `response_time` is unset, then the task has not been attempted or is
2387 # currently running and the `response_status` field is meaningless.
2388 # different programming environments, including REST APIs and RPC APIs. It is
2389 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2390 # three pieces of data: error code, error message, and error details.
2391 #
2392 # You can find out more about this error model and how to work with it in the
2393 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2394 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2395 # message types for APIs to use.
2396 {
2397 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2398 },
2399 ],
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 },
2405 },
2406 &quot;lastAttempt&quot;: { # The status of a task attempt. # Output only. The status of the task&#x27;s last attempt.
2407 &quot;scheduleTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was scheduled.
2408 #
2409 # `schedule_time` will be truncated to the nearest microsecond.
2410 &quot;dispatchTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt was dispatched.
2411 #
2412 # `dispatch_time` will be truncated to the nearest microsecond.
2413 &quot;responseTime&quot;: &quot;A String&quot;, # Output only. The time that this attempt response was received.
2414 #
2415 # `response_time` will be truncated to the nearest microsecond.
2416 &quot;responseStatus&quot;: { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt.
2417 #
2418 # If `response_time` is unset, then the task has not been attempted or is
2419 # currently running and the `response_status` field is meaningless.
2420 # different programming environments, including REST APIs and RPC APIs. It is
2421 # used by [gRPC](https://github.com/grpc). Each `Status` message contains
2422 # three pieces of data: error code, error message, and error details.
2423 #
2424 # You can find out more about this error model and how to work with it in the
2425 # [API Design Guide](https://cloud.google.com/apis/design/errors).
2426 &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of
2427 # message types for APIs to use.
2428 {
2429 &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
2430 },
2431 ],
2432 &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
2433 &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any
2434 # user-facing error message should be localized and sent in the
2435 # google.rpc.Status.details field, or localized by the client.
2436 },
2437 },
2438 &quot;responseCount&quot;: 42, # Output only. The number of attempts which have received a response.
2439 &quot;appEngineHttpRequest&quot;: { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002440 #
2441 # An App Engine task is a task that has AppEngineHttpRequest set.
2442 #
2443 # The message defines the HTTP request that is sent to an App Engine app when
2444 # the task is dispatched.
2445 #
2446 # Using AppEngineHttpRequest requires
2447 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
2448 # Google IAM permission for the project
2449 # and the following scope:
2450 #
2451 # `https://www.googleapis.com/auth/cloud-platform`
2452 #
2453 # The task will be delivered to the App Engine app which belongs to the same
2454 # project as the queue. For more information, see
2455 # [How Requests are
2456 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2457 # and how routing is affected by
2458 # [dispatch
2459 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref).
2460 # Traffic is encrypted during transport and never leaves Google datacenters.
2461 # Because this traffic is carried over a communication mechanism internal to
2462 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS).
2463 # The request to the handler, however, will appear to have used the HTTP
2464 # protocol.
2465 #
2466 # The AppEngineRouting used to construct the URL that the task is
2467 # delivered to can be set at the queue-level or task-level:
2468 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002469 # * If app_engine_routing_override is set on the
2470 # queue, this value is used for all
2471 # tasks in the queue, no matter what the setting is for the task-level
2472 # app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002473 #
2474 #
2475 # The `url` that the task will be sent to is:
2476 #
2477 # * `url =` host `+`
2478 # relative_uri
2479 #
2480 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and
2481 # URIs restricted with
2482 # [`login:
2483 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref).
2484 # Because tasks are not run as any user, they cannot be dispatched to URIs
2485 # restricted with
2486 # [`login:
2487 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref)
2488 # Task dispatches also do not follow redirects.
2489 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002490 # The task attempt has succeeded if the app&#x27;s request handler returns an HTTP
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002491 # response code in the range [`200` - `299`]. The task attempt has failed if
Bu Sun Kim65020912020-05-20 12:08:20 -07002492 # the app&#x27;s handler returns a non-2xx response code or Cloud Tasks does
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002493 # not receive response before the deadline. Failed
2494 # tasks will be retried according to the
2495 # retry configuration. `503` (Service Unavailable) is
2496 # considered an App Engine system error instead of an application error and
Bu Sun Kim65020912020-05-20 12:08:20 -07002497 # will cause Cloud Tasks&#x27; traffic congestion control to temporarily throttle
2498 # the queue&#x27;s dispatches. Unlike other types of task targets, a `429` (Too Many
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002499 # Requests) response from an app handler does not cause traffic congestion
2500 # control to throttle the queue.
Bu Sun Kim65020912020-05-20 12:08:20 -07002501 &quot;relativeUri&quot;: &quot;A String&quot;, # The relative URI.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002502 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002503 # The relative URI must begin with &quot;/&quot; and must be a valid HTTP relative URI.
2504 # It can contain a path and query string arguments.
2505 # If the relative URI is empty, then the root path &quot;/&quot; will be used.
2506 # No spaces are allowed, and the maximum length allowed is 2083 characters.
2507 &quot;headers&quot;: { # HTTP request headers.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002508 #
2509 # This map contains the header field names and values.
2510 # Headers can be set when the
2511 # task is created.
2512 # Repeated headers are not supported but a header value can contain commas.
2513 #
2514 # Cloud Tasks sets some headers to default values:
2515 #
2516 # * `User-Agent`: By default, this header is
Bu Sun Kim65020912020-05-20 12:08:20 -07002517 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002518 # This header can be modified, but Cloud Tasks will append
Bu Sun Kim65020912020-05-20 12:08:20 -07002519 # `&quot;AppEngine-Google; (+http://code.google.com/appengine)&quot;` to the
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002520 # modified `User-Agent`.
2521 #
2522 # If the task has a body, Cloud
2523 # Tasks sets the following headers:
2524 #
2525 # * `Content-Type`: By default, the `Content-Type` header is set to
Bu Sun Kim65020912020-05-20 12:08:20 -07002526 # `&quot;application/octet-stream&quot;`. The default can be overridden by explicitly
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002527 # setting `Content-Type` to a particular media type when the
2528 # task is created.
Bu Sun Kim65020912020-05-20 12:08:20 -07002529 # For example, `Content-Type` can be set to `&quot;application/json&quot;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002530 # * `Content-Length`: This is computed by Cloud Tasks. This value is
2531 # output only. It cannot be changed.
2532 #
2533 # The headers below cannot be set or overridden:
2534 #
2535 # * `Host`
2536 # * `X-Google-*`
2537 # * `X-AppEngine-*`
2538 #
2539 # In addition, Cloud Tasks sets some headers when the task is dispatched,
2540 # such as headers containing information about the task; see
2541 # [request
Dan O'Mearadd494642020-05-01 07:42:23 -07002542 # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002543 # These headers are set only when the task is dispatched, so they are not
2544 # visible when the task is returned in a Cloud Tasks response.
2545 #
2546 # Although there is no specific limit for the maximum number of headers or
2547 # the size, there is a limit on the maximum size of the Task. For more
2548 # information, see the CreateTask documentation.
Bu Sun Kim65020912020-05-20 12:08:20 -07002549 &quot;a_key&quot;: &quot;A String&quot;,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002550 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002551 &quot;appEngineRouting&quot;: { # App Engine Routing. # Task-level setting for App Engine routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002552 #
Dan O'Mearadd494642020-05-01 07:42:23 -07002553 # * If app_engine_routing_override is set on the
2554 # queue, this value is used for all
2555 # tasks in the queue, no matter what the setting is for the task-level
2556 # app_engine_routing.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002557 #
2558 # Defines routing characteristics specific to App Engine - service, version,
2559 # and instance.
2560 #
2561 # For more information about services, versions, and instances see
2562 # [An Overview of App
2563 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),
2564 # [Microservices Architecture on Google App
2565 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),
2566 # [App Engine Standard request
2567 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),
2568 # and [App Engine Flex request
2569 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
Dan O'Mearadd494642020-05-01 07:42:23 -07002570 #
2571 # Using AppEngineRouting requires
2572 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)
2573 # Google IAM permission for the project
2574 # and the following scope:
2575 #
2576 # `https://www.googleapis.com/auth/cloud-platform`
Bu Sun Kim65020912020-05-20 12:08:20 -07002577 &quot;service&quot;: &quot;A String&quot;, # App service.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002578 #
2579 # By default, the task is sent to the service which is the default
2580 # service when the task is attempted.
2581 #
2582 # For some queues or tasks which were created using the App Engine
2583 # Task Queue API, host is not parsable
2584 # into service,
2585 # version, and
2586 # instance. For example, some tasks
2587 # which were created using the App Engine SDK use a custom domain
2588 # name; custom domains are not parsed by Cloud Tasks. If
2589 # host is not parsable, then
2590 # service,
2591 # version, and
2592 # instance are the empty string.
Bu Sun Kim65020912020-05-20 12:08:20 -07002593 &quot;instance&quot;: &quot;A String&quot;, # App instance.
2594 #
2595 # By default, the task is sent to an instance which is available when
2596 # the task is attempted.
2597 #
2598 # Requests can only be sent to a specific instance if
2599 # [manual scaling is used in App Engine
2600 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).
2601 # App Engine Flex does not support instances. For more information, see
2602 # [App Engine Standard request
2603 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)
2604 # and [App Engine Flex request
2605 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).
2606 &quot;version&quot;: &quot;A String&quot;, # App version.
2607 #
2608 # By default, the task is sent to the version which is the default
2609 # version when the task is attempted.
2610 #
2611 # For some queues or tasks which were created using the App Engine
2612 # Task Queue API, host is not parsable
2613 # into service,
2614 # version, and
2615 # instance. For example, some tasks
2616 # which were created using the App Engine SDK use a custom domain
2617 # name; custom domains are not parsed by Cloud Tasks. If
2618 # host is not parsable, then
2619 # service,
2620 # version, and
2621 # instance are the empty string.
2622 &quot;host&quot;: &quot;A String&quot;, # Output only. The host that the task is sent to.
2623 #
2624 # The host is constructed from the domain name of the app associated with
2625 # the queue&#x27;s project ID (for example &lt;app-id&gt;.appspot.com), and the
2626 # service, version,
2627 # and instance. Tasks which were created using
2628 # the App Engine SDK might have a custom domain name.
2629 #
2630 # For more information, see
2631 # [How Requests are
2632 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002633 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002634 &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 -07002635 #
Bu Sun Kim65020912020-05-20 12:08:20 -07002636 # The app&#x27;s request handler for the task&#x27;s target URL must be able to handle
Dan O'Mearadd494642020-05-01 07:42:23 -07002637 # HTTP requests with this http_method, otherwise the task attempt fails with
2638 # error code 405 (Method Not Allowed). See [Writing a push task request
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002639 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler)
Dan O'Mearadd494642020-05-01 07:42:23 -07002640 # and the App Engine documentation for your runtime on [How Requests are
2641 # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled).
Bu Sun Kim65020912020-05-20 12:08:20 -07002642 &quot;body&quot;: &quot;A String&quot;, # HTTP request body.
2643 #
2644 # A request body is allowed only if the HTTP method is POST or PUT. It is
2645 # an error to set a body on a task with an incompatible HttpMethod.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002646 },
Bu Sun Kim65020912020-05-20 12:08:20 -07002647 &quot;view&quot;: &quot;A String&quot;, # Output only. The view specifies which subset of the Task has
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002648 # been returned.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07002649 }</pre>
2650</div>
2651
2652</body></html>