1// Copyright 2023 Google LLC 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15syntax = "proto3"; 16 17package google.cloud.tasks.v2beta3; 18 19option go_package = "cloud.google.com/go/cloudtasks/apiv2beta3/cloudtaskspb;cloudtaskspb"; 20option java_multiple_files = true; 21option java_outer_classname = "TargetProto"; 22option java_package = "com.google.cloud.tasks.v2beta3"; 23 24// Pull Message. 25// 26// This proto can only be used for tasks in a queue which has 27// [PULL][google.cloud.tasks.v2beta3.Queue.type] type. It currently exists for 28// backwards compatibility with the App Engine Task Queue SDK. This message type 29// maybe returned with methods 30// [list][google.cloud.tasks.v2beta3.CloudTask.ListTasks] and 31// [get][google.cloud.tasks.v2beta3.CloudTask.ListTasks], when the response view 32// is [FULL][google.cloud.tasks.v2beta3.Task.View.Full]. 33message PullMessage { 34 // A data payload consumed by the worker to execute the task. 35 bytes payload = 1; 36 37 // The tasks's tag. 38 // 39 // The tag is less than 500 characters. 40 // 41 // SDK compatibility: Although the SDK allows tags to be either 42 // string or 43 // [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), 44 // only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 45 // encoded, the tag will be empty when the task is returned by Cloud Tasks. 46 string tag = 2; 47} 48 49// PathOverride. 50// 51// Path message defines path override for HTTP targets. 52message PathOverride { 53 // The URI path (e.g., /users/1234). Default is an empty string. 54 string path = 1; 55} 56 57// QueryOverride. 58// 59// Query message defines query override for HTTP targets. 60message QueryOverride { 61 // The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty 62 // string. 63 string query_params = 1; 64} 65 66// URI Override. 67// 68// When specified, all the HTTP tasks inside the queue will be partially or 69// fully overridden depending on the configured values. 70message UriOverride { 71 // The Scheme for an HTTP request. By default, it is HTTPS. 72 enum Scheme { 73 // Scheme unspecified. Defaults to HTTPS. 74 SCHEME_UNSPECIFIED = 0; 75 76 // Convert the scheme to HTTP, e.g., https://www.google.ca will change to 77 // http://www.google.ca. 78 HTTP = 1; 79 80 // Convert the scheme to HTTPS, e.g., http://www.google.ca will change to 81 // https://www.google.ca. 82 HTTPS = 2; 83 } 84 85 // UriOverrideEnforceMode mode is to define enforcing mode for the override 86 // modes. 87 enum UriOverrideEnforceMode { 88 // OverrideMode Unspecified. Defaults to ALWAYS. 89 URI_OVERRIDE_ENFORCE_MODE_UNSPECIFIED = 0; 90 91 // In the IF_NOT_EXISTS mode, queue-level configuration is only 92 // applied where task-level configuration does not exist. 93 IF_NOT_EXISTS = 1; 94 95 // In the ALWAYS mode, queue-level configuration overrides all 96 // task-level configuration 97 ALWAYS = 2; 98 } 99 100 // Scheme override. 101 // 102 // When specified, the task URI scheme is replaced by the provided value (HTTP 103 // or HTTPS). 104 optional Scheme scheme = 1; 105 106 // Host override. 107 // 108 // When specified, replaces the host part of the task URL. For example, 109 // if the task URL is "https://www.google.com," and host value is set to 110 // "example.net", the overridden URI will be changed to "https://example.net." 111 // Host value cannot be an empty string (INVALID_ARGUMENT). 112 optional string host = 2; 113 114 // Port override. 115 // 116 // When specified, replaces the port part of the task URI. For instance, 117 // for a URI http://www.google.com/foo and port=123, the overridden URI 118 // becomes http://www.google.com:123/foo. Note that the port value must be a 119 // positive integer. Setting the port to 0 (Zero) clears the URI port. 120 optional int64 port = 3; 121 122 // URI path. 123 // 124 // When specified, replaces the existing path of the task URL. Setting the 125 // path value to an empty string clears the URI path segment. 126 PathOverride path_override = 4; 127 128 // URI Query. 129 // 130 // When specified, replaces the query part of the task URI. Setting the 131 // query value to an empty string clears the URI query segment. 132 QueryOverride query_override = 5; 133 134 // URI Override Enforce Mode 135 // 136 // When specified, determines the Target UriOverride mode. If not specified, 137 // it defaults to ALWAYS. 138 UriOverrideEnforceMode uri_override_enforce_mode = 6; 139} 140 141// HTTP target. 142// 143// When specified as a [Queue][target_type], all the tasks with [HttpRequest] 144// will be overridden according to the target. 145message HttpTarget { 146 // Defines a header message. A header can have a key and a value. 147 message Header { 148 // The Key of the header. 149 string key = 1; 150 151 // The Value of the header. 152 string value = 2; 153 } 154 155 // Wraps the Header object. 156 message HeaderOverride { 157 // header embodying a key and a value. 158 Header header = 1; 159 } 160 161 // URI override. 162 // 163 // When specified, overrides the execution URI for all the tasks in the queue. 164 UriOverride uri_override = 1; 165 166 // The HTTP method to use for the request. 167 // 168 // When specified, it overrides 169 // [HttpRequest][google.cloud.tasks.v2beta3.HttpTarget.http_method] for the 170 // task. Note that if the value is set to [HttpMethod][GET] the 171 // [HttpRequest][body] of the task will be ignored at execution time. 172 HttpMethod http_method = 2; 173 174 // HTTP target headers. 175 // 176 // This map contains the header field names and values. 177 // Headers will be set when running the 178 // [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] and/or 179 // [BufferTask][google.cloud.tasks.v2beta3.CloudTasks.BufferTask]. 180 // 181 // These headers represent a subset of the headers that will be configured for 182 // the task's HTTP request. Some HTTP request headers will be ignored or 183 // replaced. 184 // 185 // A partial list of headers that will be ignored or replaced is: 186 // * Several predefined headers, prefixed with "X-CloudTasks-", can 187 // be used to define properties of the task. 188 // * Host: This will be computed by Cloud Tasks and derived from 189 // [HttpRequest.url][google.cloud.tasks.v2beta3.Target.HttpRequest.url]. 190 // * Content-Length: This will be computed by Cloud Tasks. 191 // 192 // `Content-Type` won't be set by Cloud Tasks. You can explicitly set 193 // `Content-Type` to a media type when the 194 // [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 195 // For example,`Content-Type` can be set to `"application/octet-stream"` or 196 // `"application/json"`. The default value is set to `"application/json"`. 197 // 198 // * User-Agent: This will be set to `"Google-Cloud-Tasks"`. 199 // 200 // Headers which can have multiple values (according to RFC2616) can be 201 // specified using comma-separated values. 202 // 203 // The size of the headers must be less than 80KB. 204 // Queue-level headers to override headers of all the tasks in the queue. 205 repeated HeaderOverride header_overrides = 3; 206 207 // The mode for generating an `Authorization` header for HTTP requests. 208 // 209 // If specified, all `Authorization` headers in the 210 // [HttpRequest.headers][google.cloud.tasks.v2beta3.HttpRequest.headers] field 211 // will be overridden. 212 oneof authorization_header { 213 // If specified, an 214 // [OAuth token](https://developers.google.com/identity/protocols/OAuth2) 215 // will be generated and attached as the `Authorization` header in the HTTP 216 // request. 217 // 218 // This type of authorization should generally only be used when calling 219 // Google APIs hosted on *.googleapis.com. 220 OAuthToken oauth_token = 5; 221 222 // If specified, an 223 // [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) 224 // token will be generated and attached as an `Authorization` header in the 225 // HTTP request. 226 // 227 // This type of authorization can be used for many scenarios, including 228 // calling Cloud Run, or endpoints where you intend to validate the token 229 // yourself. 230 OidcToken oidc_token = 6; 231 } 232} 233 234// HTTP request. 235// 236// The task will be pushed to the worker as an HTTP request. If the worker 237// or the redirected worker acknowledges the task by returning a successful HTTP 238// response code ([`200` - `299`]), the task will be removed from the queue. If 239// any other HTTP response code is returned or no response is received, the 240// task will be retried according to the following: 241// 242// * User-specified throttling: [retry 243// configuration][google.cloud.tasks.v2beta3.Queue.retry_config], 244// [rate limits][google.cloud.tasks.v2beta3.Queue.rate_limits], and the 245// [queue's state][google.cloud.tasks.v2beta3.Queue.state]. 246// 247// * System throttling: To prevent the worker from overloading, Cloud Tasks may 248// temporarily reduce the queue's effective rate. User-specified settings 249// will not be changed. 250// 251// System throttling happens because: 252// 253// * Cloud Tasks backs off on all errors. Normally the backoff specified in 254// [rate limits][google.cloud.tasks.v2beta3.Queue.rate_limits] will be used. 255// But if the worker returns `429` (Too Many Requests), `503` (Service 256// Unavailable), or the rate of errors is high, Cloud Tasks will use a 257// higher backoff rate. The retry specified in the `Retry-After` HTTP 258// response header is considered. 259// 260// * To prevent traffic spikes and to smooth sudden increases in traffic, 261// dispatches ramp up slowly when the queue is newly created or idle and 262// if large numbers of tasks suddenly become available to dispatch (due to 263// spikes in create task rates, the queue being unpaused, or many tasks 264// that are scheduled at the same time). 265message HttpRequest { 266 // Required. The full url path that the request will be sent to. 267 // 268 // This string must begin with either "http://" or "https://". Some examples 269 // are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will 270 // encode some characters for safety and compatibility. The maximum allowed 271 // URL length is 2083 characters after encoding. 272 // 273 // The `Location` header response from a redirect response [`300` - `399`] 274 // may be followed. The redirect is not counted as a separate attempt. 275 string url = 1; 276 277 // The HTTP method to use for the request. The default is POST. 278 HttpMethod http_method = 2; 279 280 // HTTP request headers. 281 // 282 // This map contains the header field names and values. 283 // Headers can be set when the 284 // [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 285 // 286 // These headers represent a subset of the headers that will accompany the 287 // task's HTTP request. Some HTTP request headers will be ignored or replaced. 288 // 289 // A partial list of headers that will be ignored or replaced is: 290 // 291 // * Any header that is prefixed with "X-CloudTasks-" will be treated 292 // as service header. Service headers define properties of the task and are 293 // predefined in CloudTask. 294 // * Host: This will be computed by Cloud Tasks and derived from 295 // [HttpRequest.url][google.cloud.tasks.v2beta3.HttpRequest.url]. 296 // * Content-Length: This will be computed by Cloud Tasks. 297 // * User-Agent: This will be set to `"Google-Cloud-Tasks"`. 298 // * `X-Google-*`: Google use only. 299 // * `X-AppEngine-*`: Google use only. 300 // 301 // `Content-Type` won't be set by Cloud Tasks. You can explicitly set 302 // `Content-Type` to a media type when the 303 // [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 304 // For example, `Content-Type` can be set to `"application/octet-stream"` or 305 // `"application/json"`. 306 // 307 // Headers which can have multiple values (according to RFC2616) can be 308 // specified using comma-separated values. 309 // 310 // The size of the headers must be less than 80KB. 311 map<string, string> headers = 3; 312 313 // HTTP request body. 314 // 315 // A request body is allowed only if the 316 // [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, 317 // PUT, or PATCH. It is an error to set body on a task with an incompatible 318 // [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. 319 bytes body = 4; 320 321 // The mode for generating an `Authorization` header for HTTP requests. 322 // 323 // If specified, all `Authorization` headers in the 324 // [HttpRequest.headers][google.cloud.tasks.v2beta3.HttpRequest.headers] field 325 // will be overridden. 326 oneof authorization_header { 327 // If specified, an 328 // [OAuth token](https://developers.google.com/identity/protocols/OAuth2) 329 // will be generated and attached as an `Authorization` header in the HTTP 330 // request. 331 // 332 // This type of authorization should generally only be used when calling 333 // Google APIs hosted on *.googleapis.com. 334 OAuthToken oauth_token = 5; 335 336 // If specified, an 337 // [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) 338 // token will be generated and attached as an `Authorization` header in the 339 // HTTP request. 340 // 341 // This type of authorization can be used for many scenarios, including 342 // calling Cloud Run, or endpoints where you intend to validate the token 343 // yourself. 344 OidcToken oidc_token = 6; 345 } 346} 347 348// App Engine HTTP queue. 349// 350// The task will be delivered to the App Engine application hostname 351// specified by its 352// [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] and 353// [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest]. The 354// documentation for 355// [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] 356// explains how the task's host URL is constructed. 357// 358// Using [AppEngineHttpQueue][google.cloud.tasks.v2beta3.AppEngineHttpQueue] 359// requires 360// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) 361// Google IAM permission for the project 362// and the following scope: 363// 364// `https://www.googleapis.com/auth/cloud-platform` 365message AppEngineHttpQueue { 366 // Overrides for the 367 // [task-level 368 // app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. 369 // 370 // If set, `app_engine_routing_override` is used for all tasks in 371 // the queue, no matter what the setting is for the 372 // [task-level 373 // app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. 374 AppEngineRouting app_engine_routing_override = 1; 375} 376 377// App Engine HTTP request. 378// 379// The message defines the HTTP request that is sent to an App Engine app when 380// the task is dispatched. 381// 382// Using [AppEngineHttpRequest][google.cloud.tasks.v2beta3.AppEngineHttpRequest] 383// requires 384// [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) 385// Google IAM permission for the project 386// and the following scope: 387// 388// `https://www.googleapis.com/auth/cloud-platform` 389// 390// The task will be delivered to the App Engine app which belongs to the same 391// project as the queue. For more information, see 392// [How Requests are 393// Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 394// and how routing is affected by 395// [dispatch 396// files](https://cloud.google.com/appengine/docs/python/config/dispatchref). 397// Traffic is encrypted during transport and never leaves Google datacenters. 398// Because this traffic is carried over a communication mechanism internal to 399// Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). 400// The request to the handler, however, will appear to have used the HTTP 401// protocol. 402// 403// The [AppEngineRouting][google.cloud.tasks.v2beta3.AppEngineRouting] used to 404// construct the URL that the task is delivered to can be set at the queue-level 405// or task-level: 406// 407// * If set, 408// [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] 409// is used for all tasks in the queue, no matter what the setting 410// is for the 411// [task-level 412// app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. 413// 414// 415// The `url` that the task will be sent to is: 416// 417// * `url =` [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] `+` 418// [relative_uri][google.cloud.tasks.v2beta3.AppEngineHttpRequest.relative_uri] 419// 420// Tasks can be dispatched to secure app handlers, unsecure app handlers, and 421// URIs restricted with 422// [`login: 423// admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). 424// Because tasks are not run as any user, they cannot be dispatched to URIs 425// restricted with 426// [`login: 427// required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) 428// Task dispatches also do not follow redirects. 429// 430// The task attempt has succeeded if the app's request handler returns an HTTP 431// response code in the range [`200` - `299`]. The task attempt has failed if 432// the app's handler returns a non-2xx response code or Cloud Tasks does 433// not receive response before the 434// [deadline][google.cloud.tasks.v2beta3.Task.dispatch_deadline]. Failed tasks 435// will be retried according to the [retry 436// configuration][google.cloud.tasks.v2beta3.Queue.retry_config]. `503` (Service 437// Unavailable) is considered an App Engine system error instead of an 438// application error and will cause Cloud Tasks' traffic congestion control to 439// temporarily throttle the queue's dispatches. Unlike other types of task 440// targets, a `429` (Too Many Requests) response from an app handler does not 441// cause traffic congestion control to throttle the queue. 442message AppEngineHttpRequest { 443 // The HTTP method to use for the request. The default is POST. 444 // 445 // The app's request handler for the task's target URL must be able to handle 446 // HTTP requests with this http_method, otherwise the task attempt fails with 447 // error code 405 (Method Not Allowed). See [Writing a push task request 448 // handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 449 // and the App Engine documentation for your runtime on [How Requests are 450 // Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). 451 HttpMethod http_method = 1; 452 453 // Task-level setting for App Engine routing. 454 // 455 // If set, 456 // [app_engine_routing_override][google.cloud.tasks.v2beta3.AppEngineHttpQueue.app_engine_routing_override] 457 // is used for all tasks in the queue, no matter what the setting is for the 458 // [task-level 459 // app_engine_routing][google.cloud.tasks.v2beta3.AppEngineHttpRequest.app_engine_routing]. 460 AppEngineRouting app_engine_routing = 2; 461 462 // The relative URI. 463 // 464 // The relative URI must begin with "/" and must be a valid HTTP relative URI. 465 // It can contain a path and query string arguments. 466 // If the relative URI is empty, then the root path "/" will be used. 467 // No spaces are allowed, and the maximum length allowed is 2083 characters. 468 string relative_uri = 3; 469 470 // HTTP request headers. 471 // 472 // This map contains the header field names and values. 473 // Headers can be set when the 474 // [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 475 // Repeated headers are not supported but a header value can contain commas. 476 // 477 // Cloud Tasks sets some headers to default values: 478 // 479 // * `User-Agent`: By default, this header is 480 // `"AppEngine-Google; (+http://code.google.com/appengine)"`. 481 // This header can be modified, but Cloud Tasks will append 482 // `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 483 // modified `User-Agent`. 484 // 485 // If the task has a 486 // [body][google.cloud.tasks.v2beta3.AppEngineHttpRequest.body], Cloud Tasks 487 // sets the following headers: 488 // 489 // * `Content-Type`: By default, the `Content-Type` header is set to 490 // `"application/octet-stream"`. The default can be overridden by explicitly 491 // setting `Content-Type` to a particular media type when the 492 // [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. 493 // For example, `Content-Type` can be set to `"application/json"`. 494 // * `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 506 // headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). 507 // 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 512 // [Task][google.cloud.tasks.v2beta3.Task]. For more information, see the 513 // [CreateTask][google.cloud.tasks.v2beta3.CloudTasks.CreateTask] 514 // documentation. 515 map<string, string> headers = 4; 516 517 // HTTP request body. 518 // 519 // A request body is allowed only if the HTTP method is POST or PUT. It is 520 // an error to set a body on a task with an incompatible 521 // [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. 522 bytes body = 5; 523} 524 525// App Engine Routing. 526// 527// Defines routing characteristics specific to App Engine - service, version, 528// and instance. 529// 530// For more information about services, versions, and instances see 531// [An Overview of App 532// Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), 533// [Microservices Architecture on Google App 534// Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), 535// [App Engine Standard request 536// routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), 537// and [App Engine Flex request 538// routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 539message AppEngineRouting { 540 // App service. 541 // 542 // By default, the task is sent to the service which is the default 543 // service when the task is attempted. 544 // 545 // For some queues or tasks which were created using the App Engine 546 // Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is 547 // not parsable into 548 // [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], 549 // [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and 550 // [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For 551 // example, some tasks which were created using the App Engine SDK use a 552 // custom domain name; custom domains are not parsed by Cloud Tasks. If 553 // [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, 554 // then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], 555 // [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and 556 // [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the 557 // empty string. 558 string service = 1; 559 560 // App version. 561 // 562 // By default, the task is sent to the version which is the default 563 // version when the task is attempted. 564 // 565 // For some queues or tasks which were created using the App Engine 566 // Task Queue API, [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is 567 // not parsable into 568 // [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], 569 // [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and 570 // [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. For 571 // example, some tasks which were created using the App Engine SDK use a 572 // custom domain name; custom domains are not parsed by Cloud Tasks. If 573 // [host][google.cloud.tasks.v2beta3.AppEngineRouting.host] is not parsable, 574 // then [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], 575 // [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and 576 // [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance] are the 577 // empty string. 578 string version = 2; 579 580 // App instance. 581 // 582 // By default, the task is sent to an instance which is available when 583 // the task is attempted. 584 // 585 // Requests can only be sent to a specific instance if 586 // [manual scaling is used in App Engine 587 // Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). 588 // App Engine Flex does not support instances. For more information, see 589 // [App Engine Standard request 590 // routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 591 // and [App Engine Flex request 592 // routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 593 string instance = 3; 594 595 // Output only. The host that the task is sent to. 596 // 597 // The host is constructed from the domain name of the app associated with 598 // the queue's project ID (for example <app-id>.appspot.com), and the 599 // [service][google.cloud.tasks.v2beta3.AppEngineRouting.service], 600 // [version][google.cloud.tasks.v2beta3.AppEngineRouting.version], and 601 // [instance][google.cloud.tasks.v2beta3.AppEngineRouting.instance]. Tasks 602 // which were created using the App Engine SDK might have a custom domain 603 // name. 604 // 605 // For more information, see 606 // [How Requests are 607 // Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). 608 string host = 4; 609} 610 611// The HTTP method used to execute the task. 612enum HttpMethod { 613 // HTTP method unspecified 614 HTTP_METHOD_UNSPECIFIED = 0; 615 616 // HTTP POST 617 POST = 1; 618 619 // HTTP GET 620 GET = 2; 621 622 // HTTP HEAD 623 HEAD = 3; 624 625 // HTTP PUT 626 PUT = 4; 627 628 // HTTP DELETE 629 DELETE = 5; 630 631 // HTTP PATCH 632 PATCH = 6; 633 634 // HTTP OPTIONS 635 OPTIONS = 7; 636} 637 638// Contains information needed for generating an 639// [OAuth token](https://developers.google.com/identity/protocols/OAuth2). 640// This type of authorization should generally only be used when calling Google 641// APIs hosted on *.googleapis.com. 642message OAuthToken { 643 // [Service account email](https://cloud.google.com/iam/docs/service-accounts) 644 // to be used for generating OAuth token. 645 // The service account must be within the same project as the queue. The 646 // caller must have iam.serviceAccounts.actAs permission for the service 647 // account. 648 string service_account_email = 1; 649 650 // OAuth scope to be used for generating OAuth access token. 651 // If not specified, "https://www.googleapis.com/auth/cloud-platform" 652 // will be used. 653 string scope = 2; 654} 655 656// Contains information needed for generating an 657// [OpenID Connect 658// token](https://developers.google.com/identity/protocols/OpenIDConnect). 659// This type of authorization can be used for many scenarios, including 660// calling Cloud Run, or endpoints where you intend to validate the token 661// yourself. 662message OidcToken { 663 // [Service account email](https://cloud.google.com/iam/docs/service-accounts) 664 // to be used for generating OIDC token. 665 // The service account must be within the same project as the queue. The 666 // caller must have iam.serviceAccounts.actAs permission for the service 667 // account. 668 string service_account_email = 1; 669 670 // Audience to be used when generating OIDC token. If not specified, the URI 671 // specified in target will be used. 672 string audience = 2; 673} 674