Generated from protobuf message google.cloud.tasks.v2.AppEngineRouting
Namespace
Google \ Cloud \ Tasks \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ service
string
App service. By default, the task is sent to the service which is the default service when the task is attempted. For some queues or tasks which were created using the App Engine Task Queue API, host is not parsable into service, version, and instance. For example, some tasks which were created using the App Engine SDK use a custom domain name; custom domains are not parsed by Cloud Tasks. If host is not parsable, then service, version, and instance are the empty string.
↳ version
string
App version. By default, the task is sent to the version which is the default version when the task is attempted. For some queues or tasks which were created using the App Engine Task Queue API, host is not parsable into service, version, and instance. For example, some tasks which were created using the App Engine SDK use a custom domain name; custom domains are not parsed by Cloud Tasks. If host is not parsable, then service, version, and instance are the empty string.
Output only. The host that the task is sent to. The host is constructed from the domain name of the app associated with the queue's project ID (for example
getService
App service.
By default, the task is sent to the service which is the default
service when the task is attempted.
For some queues or tasks which were created using the App Engine
Task Queue API, host is not
parsable into service,
version, and
instance. For example,
some tasks which were created using the App Engine SDK use a custom domain
name; custom domains are not parsed by Cloud Tasks. If
host is not parsable, then
service,
version, and
instance are the empty
string.
Returns
Type
Description
string
setService
App service.
By default, the task is sent to the service which is the default
service when the task is attempted.
For some queues or tasks which were created using the App Engine
Task Queue API, host is not
parsable into service,
version, and
instance. For example,
some tasks which were created using the App Engine SDK use a custom domain
name; custom domains are not parsed by Cloud Tasks. If
host is not parsable, then
service,
version, and
instance are the empty
string.
Parameter
Name
Description
var
string
Returns
Type
Description
$this
getVersion
App version.
By default, the task is sent to the version which is the default
version when the task is attempted.
For some queues or tasks which were created using the App Engine
Task Queue API, host is not
parsable into service,
version, and
instance. For example,
some tasks which were created using the App Engine SDK use a custom domain
name; custom domains are not parsed by Cloud Tasks. If
host is not parsable, then
service,
version, and
instance are the empty
string.
Returns
Type
Description
string
setVersion
App version.
By default, the task is sent to the version which is the default
version when the task is attempted.
For some queues or tasks which were created using the App Engine
Task Queue API, host is not
parsable into service,
version, and
instance. For example,
some tasks which were created using the App Engine SDK use a custom domain
name; custom domains are not parsed by Cloud Tasks. If
host is not parsable, then
service,
version, and
instance are the empty
string.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Google Cloud Tasks V2 Client - Class AppEngineRouting (2.0.2)\n\nVersion latestkeyboard_arrow_down\n\n- [2.0.2 (latest)](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting)\n- [2.0.1](/php/docs/reference/cloud-tasks/2.0.1/V2.AppEngineRouting)\n- [1.15.2](/php/docs/reference/cloud-tasks/1.15.2/V2.AppEngineRouting)\n- [1.14.6](/php/docs/reference/cloud-tasks/1.14.6/V2.AppEngineRouting)\n- [1.13.2](/php/docs/reference/cloud-tasks/1.13.2/V2.AppEngineRouting)\n- [1.12.2](/php/docs/reference/cloud-tasks/1.12.2/V2.AppEngineRouting)\n- [1.11.11](/php/docs/reference/cloud-tasks/1.11.11/V2.AppEngineRouting) \nReference documentation and code samples for the Google Cloud Tasks V2 Client class AppEngineRouting.\n\nApp Engine Routing.\n\nDefines routing characteristics specific to App Engine - service, version,\nand instance.\nFor more information about services, versions, and instances see\n[An Overview of App\nEngine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine),\n[Microservices Architecture on Google App\nEngine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine),\n[App Engine Standard request\nrouting](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed),\nand [App Engine Flex request\nrouting](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).\nUsing [AppEngineRouting](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting) requires\n[`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control)\nGoogle IAM permission for the project\nand the following scope:\n`https://www.googleapis.com/auth/cloud-platform`\n\nGenerated from protobuf message `google.cloud.tasks.v2.AppEngineRouting`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Tasks \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getService\n\nApp service.\n\nBy default, the task is sent to the service which is the default\nservice when the task is attempted.\nFor some queues or tasks which were created using the App Engine\nTask Queue API, [host](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getHost__) is not\nparsable into [service](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getService__),\n[version](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getVersion__), and\n[instance](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getInstance__). For example,\nsome tasks which were created using the App Engine SDK use a custom domain\nname; custom domains are not parsed by Cloud Tasks. If\n[host](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getHost__) is not parsable, then\n[service](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getService__),\n[version](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getVersion__), and\n[instance](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getInstance__) are the empty\nstring.\n\n### setService\n\nApp service.\n\nBy default, the task is sent to the service which is the default\nservice when the task is attempted.\nFor some queues or tasks which were created using the App Engine\nTask Queue API, [host](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getHost__) is not\nparsable into [service](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getService__),\n[version](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getVersion__), and\n[instance](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getInstance__). For example,\nsome tasks which were created using the App Engine SDK use a custom domain\nname; custom domains are not parsed by Cloud Tasks. If\n[host](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getHost__) is not parsable, then\n[service](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getService__),\n[version](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getVersion__), and\n[instance](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getInstance__) are the empty\nstring.\n\n### getVersion\n\nApp version.\n\nBy default, the task is sent to the version which is the default\nversion when the task is attempted.\nFor some queues or tasks which were created using the App Engine\nTask Queue API, [host](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getHost__) is not\nparsable into [service](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getService__),\n[version](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getVersion__), and\n[instance](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getInstance__). For example,\nsome tasks which were created using the App Engine SDK use a custom domain\nname; custom domains are not parsed by Cloud Tasks. If\n[host](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getHost__) is not parsable, then\n[service](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getService__),\n[version](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getVersion__), and\n[instance](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getInstance__) are the empty\nstring.\n\n### setVersion\n\nApp version.\n\nBy default, the task is sent to the version which is the default\nversion when the task is attempted.\nFor some queues or tasks which were created using the App Engine\nTask Queue API, [host](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getHost__) is not\nparsable into [service](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getService__),\n[version](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getVersion__), and\n[instance](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getInstance__). For example,\nsome tasks which were created using the App Engine SDK use a custom domain\nname; custom domains are not parsed by Cloud Tasks. If\n[host](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getHost__) is not parsable, then\n[service](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getService__),\n[version](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getVersion__), and\n[instance](/php/docs/reference/cloud-tasks/latest/V2.AppEngineRouting#_Google_Cloud_Tasks_V2_AppEngineRouting__getInstance__) are the empty\nstring.\n\n### getInstance\n\nApp instance.\n\nBy default, the task is sent to an instance which is available when\nthe task is attempted.\nRequests can only be sent to a specific instance if\n[manual scaling is used in App Engine\nStandard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).\nApp Engine Flex does not support instances. For more information, see\n[App Engine Standard request\nrouting](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)\nand [App Engine Flex request\nrouting](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).\n\n### setInstance\n\nApp instance.\n\nBy default, the task is sent to an instance which is available when\nthe task is attempted.\nRequests can only be sent to a specific instance if\n[manual scaling is used in App Engine\nStandard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes).\nApp Engine Flex does not support instances. For more information, see\n[App Engine Standard request\nrouting](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed)\nand [App Engine Flex request\nrouting](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed).\n\n### getHost\n\nOutput only. The host that the task is sent to.\n\nThe host is constructed from the domain name of the app associated with\nthe queue's project ID (for example\n\n\n### setHost\n\nOutput only. The host that the task is sent to.\n\nThe host is constructed from the domain name of the app associated with\nthe queue's project ID (for example"]]