Package types (2.20.0) Stay organized with collections Save and categorize content based on your preferences.
API documentation fortasks_v2.types package.
Classes
AppEngineHttpRequest
App Engine HTTP request.
The message defines the HTTP request that is sent to an App Engineapp when the task is dispatched.
UsingAppEngineHttpRequestrequires`appengine.applications.gethttps://cloud.google.com/appengine/docs/admin-api/access-control`__Google IAM permission for the project and the following scope:
https://www.googleapis.com/auth/cloud-platform
The task will be delivered to the App Engine app which belongs tothe same project as the queue. For more information, seeHowRequests areRouted <https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed>and how routing is affected bydispatchfiles <https://cloud.google.com/appengine/docs/python/config/dispatchref>.Traffic is encrypted during transport and never leaves Googledatacenters. Because this traffic is carried over a communicationmechanism internal to Google, you cannot explicitly set the protocol(for example, HTTP or HTTPS). The request to the handler, however,will appear to have used the HTTP protocol.
TheAppEngineRouting usedto construct the URL that the task is delivered to can be set at thequeue-level or task-level:
- If [app_engine_routing_override is set on thequeue][google.cloud.tasks.v2.Queue.app_engine_routing_override],this value is used for all tasks in the queue, no matter what thesetting is for the [task-levelapp_engine_routing][google.cloud.tasks.v2.AppEngineHttpRequest.app_engine_routing].
Theurl that the task will be sent to is:
url =host+relative_uri
Tasks can be dispatched to secure app handlers, unsecure apphandlers, and URIs restricted withlogin: admin`` <https://cloud.google.com/appengine/docs/standard/python/config/appref>`__.Because tasks are not run as any user, they cannot be dispatched toURIs restricted withlogin: required` <https://cloud.google.com/appengine/docs/standard/python/config/appref>__Task dispatches also do not follow redirects.
The task attempt has succeeded if the app's request handler returnsan HTTP response code in the range [200 -299]. The taskattempt has failed if the app's handler returns a non-2xx responsecode or Cloud Tasks does not receive response before thedeadline. Failedtasks will be retried according to the [retryconfiguration][google.cloud.tasks.v2.Queue.retry_config].503(Service Unavailable) is considered an App Engine system errorinstead of an application error and will cause Cloud Tasks' trafficcongestion control to temporarily throttle the queue's dispatches.Unlike other types of task targets, a429 (Too Many Requests)response from an app handler does not cause traffic congestioncontrol to throttle the queue.
AppEngineRouting
App Engine Routing.
Defines routing characteristics specific to App Engine - service,version, and instance.
For more information about services, versions, and instances seeAnOverview of AppEngine <https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine>,Microservices Architecture on Google AppEngine <https://cloud.google.com/appengine/docs/python/microservices-on-app-engine>,App Engine Standard requestrouting <https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed>,andApp Engine Flex requestrouting <https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed>.
UsingAppEngineRoutingrequires`appengine.applications.gethttps://cloud.google.com/appengine/docs/admin-api/access-control`__Google IAM permission for the project and the following scope:
https://www.googleapis.com/auth/cloud-platform
Attempt
The status of a task attempt.
CreateQueueRequest
Request message forCreateQueue.
CreateTaskRequest
Request message forCreateTask.
DeleteQueueRequest
Request message forDeleteQueue.
DeleteTaskRequest
Request message for deleting a task usingDeleteTask.
GetQueueRequest
Request message forGetQueue.
GetTaskRequest
Request message for getting a task usingGetTask.
HttpMethod
The HTTP method used to deliver the task.
HttpRequest
HTTP request.
The task will be pushed to the worker as an HTTP request. If theworker or the redirected worker acknowledges the task by returning asuccessful HTTP response code ([200 -299]), the task willbe removed from the queue. If any other HTTP response code isreturned or no response is received, the task will be retriedaccording to the following:
User-specified throttling: [retryconfiguration][google.cloud.tasks.v2.Queue.retry_config], [ratelimits][google.cloud.tasks.v2.Queue.rate_limits], and the [queue'sstate][google.cloud.tasks.v2.Queue.state].
System throttling: To prevent the worker from overloading, CloudTasks may temporarily reduce the queue's effective rate.User-specified settings will not be changed.
System throttling happens because:
Cloud Tasks backs off on all errors. Normally the backoffspecified in [ratelimits][google.cloud.tasks.v2.Queue.rate_limits] will be used. Butif the worker returns
429(Too Many Requests),503(Service Unavailable), or the rate of errors is high, Cloud Taskswill use a higher backoff rate. The retry specified in theRetry-AfterHTTP response header is considered.To prevent traffic spikes and to smooth sudden increases intraffic, dispatches ramp up slowly when the queue is newly createdor idle and if large numbers of tasks suddenly become available todispatch (due to spikes in create task rates, the queue beingunpaused, or many tasks that are scheduled at the same time).
This message hasoneof_ fields (mutually exclusive fields).For each oneof, at most one member field can be set at the same time.Setting any member of the oneof automatically clears all othermembers.
.. _oneof:https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
ListQueuesRequest
Request message forListQueues.
ListQueuesResponse
Response message forListQueues.
ListTasksRequest
Request message for listing tasks usingListTasks.
ListTasksResponse
Response message for listing tasks usingListTasks.
OAuthToken
Contains information needed for generating anOAuthtoken <https://developers.google.com/identity/protocols/OAuth2>__.This type of authorization should generally only be used whencalling Google APIs hosted on *.googleapis.com.
OidcToken
Contains information needed for generating anOpenID Connecttoken <https://developers.google.com/identity/protocols/OpenIDConnect>__.This type of authorization can be used for many scenarios, includingcalling Cloud Run, or endpoints where you intend to validate thetoken yourself.
PauseQueueRequest
Request message forPauseQueue.
PurgeQueueRequest
Request message forPurgeQueue.
Queue
A queue is a container of related tasks. Queues areconfigured to manage how those tasks are dispatched.Configurable properties include rate limits, retry options,queue types, and others.
RateLimits
Rate limits.
This message determines the maximum rate that tasks can bedispatched by a queue, regardless of whether the dispatch is a firsttask attempt or a retry.
Note: The debugging command,RunTask, will run a taskeven if the queue has reached itsRateLimits.
ResumeQueueRequest
Request message forResumeQueue.
RetryConfig
Retry config.
These settings determine when a failed task attempt is retried.
RunTaskRequest
Request message for forcing a task to run now usingRunTask.
StackdriverLoggingConfig
Configuration options for writing logs toStackdriverLogging <https://cloud.google.com/logging/docs/>__.
Task
A unit of scheduled work.
This message hasoneof_ fields (mutually exclusive fields).For each oneof, at most one member field can be set at the same time.Setting any member of the oneof automatically clears all othermembers.
.. _oneof:https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields
UpdateQueueRequest
Request message forUpdateQueue.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.