1<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"> 78 <code><a href="#create">create(parent, body, x__xgafv=None)</a></code></p> 79<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"> 87 <code><a href="#list">list(parent, responseView=None, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p> 88<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"> 93 <code><a href="#run">run(name, body, x__xgafv=None)</a></code></p> 94<p class="firstline">Forces a task to run now.</p> 95<h3>Method Details</h3> 96<div class="method"> 97 <code class="details" id="create">create(parent, body, x__xgafv=None)</code> 98 <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: 105 parent: string, Required. 106 107The queue name. For example: 108`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` 109 110The queue must already exist. (required) 111 body: object, The request body. (required) 112 The object takes the form of: 113 114{ # Request message for CreateTask. 115 "responseView": "A String", # The response_view specifies which subset of the Task will be 116 # returned. 117 # 118 # By default response_view is BASIC; not all 119 # information is retrieved by default because some data, such as 120 # payloads, might be desirable to return only when needed because 121 # of its large size or because of the sensitivity of data that it 122 # contains. 123 # 124 # Authorization for FULL requires 125 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) 126 # permission on the Task resource. 127 "task": { # A unit of scheduled work. # Required. 128 # 129 # The task to add. 130 # 131 # Task names have the following format: 132 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. 133 # The user can optionally specify a task name. If a 134 # name is not specified then the system will generate a random 135 # unique task id, which will be set in the task returned in the 136 # response. 137 # 138 # If schedule_time is not set or is in the 139 # past then Cloud Tasks will set it to the current time. 140 # 141 # Task De-duplication: 142 # 143 # Explicitly specifying a task ID enables task de-duplication. If 144 # a task's ID is identical to that of an existing task or a task 145 # that was deleted or executed recently then the call will fail 146 # with ALREADY_EXISTS. 147 # If the task's queue was created using Cloud Tasks, then another task with 148 # the same name can't be created for ~1hour after the original task was 149 # deleted or executed. If the task's queue was created using queue.yaml or 150 # queue.xml, then another task with the same name can't be created 151 # for ~9days after the original task was deleted or executed. 152 # 153 # Because there is an extra lookup cost to identify duplicate task 154 # names, these CreateTask calls have significantly 155 # increased latency. Using hashed strings for the task id or for 156 # the prefix of the task id is recommended. Choosing task ids that 157 # are sequential or have sequential prefixes, for example using a 158 # timestamp, causes an increase in latency and error rates in all 159 # task commands. The infrastructure relies on an approximately 160 # uniform distribution of task ids to store and serve tasks 161 # efficiently. 162 "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler. 163 # 164 # An App Engine task is a task that has AppEngineHttpRequest set. 165 # 166 # The message defines the HTTP request that is sent to an App Engine app when 167 # the task is dispatched. 168 # 169 # Using AppEngineHttpRequest requires 170 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) 171 # Google IAM permission for the project 172 # and the following scope: 173 # 174 # `https://www.googleapis.com/auth/cloud-platform` 175 # 176 # The task will be delivered to the App Engine app which belongs to the same 177 # project as the queue. For more information, see 178 # [How Requests are 179 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 180 # and how routing is affected by 181 # [dispatch 182 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). 183 # Traffic is encrypted during transport and never leaves Google datacenters. 184 # Because this traffic is carried over a communication mechanism internal to 185 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). 186 # The request to the handler, however, will appear to have used the HTTP 187 # protocol. 188 # 189 # The AppEngineRouting used to construct the URL that the task is 190 # delivered to can be set at the queue-level or task-level: 191 # 192 # * If set, 193 # app_engine_routing_override 194 # is used for all tasks in the queue, no matter what the setting 195 # is for the 196 # task-level app_engine_routing. 197 # 198 # 199 # The `url` that the task will be sent to is: 200 # 201 # * `url =` host `+` 202 # relative_uri 203 # 204 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and 205 # URIs restricted with 206 # [`login: 207 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). 208 # Because tasks are not run as any user, they cannot be dispatched to URIs 209 # restricted with 210 # [`login: 211 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) 212 # Task dispatches also do not follow redirects. 213 # 214 # The task attempt has succeeded if the app's request handler returns an HTTP 215 # response code in the range [`200` - `299`]. The task attempt has failed if 216 # the app's handler returns a non-2xx response code or Cloud Tasks does 217 # not receive response before the deadline. Failed 218 # tasks will be retried according to the 219 # retry configuration. `503` (Service Unavailable) is 220 # considered an App Engine system error instead of an application error and 221 # will cause Cloud Tasks' traffic congestion control to temporarily throttle 222 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many 223 # Requests) response from an app handler does not cause traffic congestion 224 # control to throttle the queue. 225 "body": "A String", # HTTP request body. 226 # 227 # A request body is allowed only if the HTTP method is POST or PUT. It is 228 # an error to set a body on a task with an incompatible HttpMethod. 229 "headers": { # HTTP request headers. 230 # 231 # This map contains the header field names and values. 232 # Headers can be set when the 233 # task is created. 234 # Repeated headers are not supported but a header value can contain commas. 235 # 236 # Cloud Tasks sets some headers to default values: 237 # 238 # * `User-Agent`: By default, this header is 239 # `"AppEngine-Google; (+http://code.google.com/appengine)"`. 240 # This header can be modified, but Cloud Tasks will append 241 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 242 # modified `User-Agent`. 243 # 244 # If the task has a body, Cloud 245 # Tasks sets the following headers: 246 # 247 # * `Content-Type`: By default, the `Content-Type` header is set to 248 # `"application/octet-stream"`. The default can be overridden by explicitly 249 # setting `Content-Type` to a particular media type when the 250 # task is created. 251 # For example, `Content-Type` can be set to `"application/json"`. 252 # * `Content-Length`: This is computed by Cloud Tasks. This value is 253 # output only. It cannot be changed. 254 # 255 # The headers below cannot be set or overridden: 256 # 257 # * `Host` 258 # * `X-Google-*` 259 # * `X-AppEngine-*` 260 # 261 # In addition, Cloud Tasks sets some headers when the task is dispatched, 262 # such as headers containing information about the task; see 263 # [request 264 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 265 # These headers are set only when the task is dispatched, so they are not 266 # visible when the task is returned in a Cloud Tasks response. 267 # 268 # Although there is no specific limit for the maximum number of headers or 269 # the size, there is a limit on the maximum size of the Task. For more 270 # information, see the CreateTask documentation. 271 "a_key": "A String", 272 }, 273 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. 274 # 275 # If set, 276 # app_engine_routing_override 277 # is used for all tasks in the queue, no matter what the setting is for the 278 # task-level app_engine_routing. 279 # 280 # Defines routing characteristics specific to App Engine - service, version, 281 # and instance. 282 # 283 # For more information about services, versions, and instances see 284 # [An Overview of App 285 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), 286 # [Microservices Architecture on Google App 287 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), 288 # [App Engine Standard request 289 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), 290 # and [App Engine Flex request 291 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 292 "instance": "A String", # App instance. 293 # 294 # By default, the task is sent to an instance which is available when 295 # the task is attempted. 296 # 297 # Requests can only be sent to a specific instance if 298 # [manual scaling is used in App Engine 299 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). 300 # App Engine Flex does not support instances. For more information, see 301 # [App Engine Standard request 302 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 303 # and [App Engine Flex request 304 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 305 "host": "A String", # Output only. The host that the task is sent to. 306 # 307 # The host is constructed from the domain name of the app associated with 308 # the queue's project ID (for example <app-id>.appspot.com), and the 309 # service, version, 310 # and instance. Tasks which were created using 311 # the App Engine SDK might have a custom domain name. 312 # 313 # For more information, see 314 # [How Requests are 315 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). 316 "version": "A String", # App version. 317 # 318 # By default, the task is sent to the version which is the default 319 # version when the task is attempted. 320 # 321 # For some queues or tasks which were created using the App Engine 322 # Task Queue API, host is not parsable 323 # into service, 324 # version, and 325 # instance. For example, some tasks 326 # which were created using the App Engine SDK use a custom domain 327 # name; custom domains are not parsed by Cloud Tasks. If 328 # host is not parsable, then 329 # service, 330 # version, and 331 # instance are the empty string. 332 "service": "A String", # App service. 333 # 334 # By default, the task is sent to the service which is the default 335 # service when the task is attempted. 336 # 337 # For some queues or tasks which were created using the App Engine 338 # Task Queue API, host is not parsable 339 # into service, 340 # version, and 341 # instance. For example, some tasks 342 # which were created using the App Engine SDK use a custom domain 343 # name; custom domains are not parsed by Cloud Tasks. If 344 # host is not parsable, then 345 # service, 346 # version, and 347 # instance are the empty string. 348 }, 349 "relativeUri": "A String", # The relative URI. 350 # 351 # The relative URI must begin with "/" and must be a valid HTTP relative URI. 352 # It can contain a path and query string arguments. 353 # If the relative URI is empty, then the root path "/" will be used. 354 # No spaces are allowed, and the maximum length allowed is 2083 characters. 355 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. 356 # 357 # The app's request handler for the task's target URL must be able to handle 358 # HTTP requests with this http_method, otherwise the task attempt will fail 359 # with error code 405 (Method Not Allowed). See 360 # [Writing a push task request 361 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 362 # and the documentation for the request handlers in the language your app is 363 # written in e.g. 364 # [Python Request 365 # Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). 366 }, 367 "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt. 368 # 369 # Only dispatch_time will be set. 370 # The other Attempt information is not retained by Cloud Tasks. 371 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. 372 # 373 # `schedule_time` will be truncated to the nearest microsecond. 374 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. 375 # 376 # If `response_time` is unset, then the task has not been attempted or is 377 # currently running and the `response_status` field is meaningless. 378 # different programming environments, including REST APIs and RPC APIs. It is 379 # used by [gRPC](https://github.com/grpc). Each `Status` message contains 380 # three pieces of data: error code, error message, and error details. 381 # 382 # You can find out more about this error model and how to work with it in the 383 # [API Design Guide](https://cloud.google.com/apis/design/errors). 384 "message": "A String", # A developer-facing error message, which should be in English. Any 385 # user-facing error message should be localized and sent in the 386 # google.rpc.Status.details field, or localized by the client. 387 "code": 42, # The status code, which should be an enum value of google.rpc.Code. 388 "details": [ # A list of messages that carry the error details. There is a common set of 389 # message types for APIs to use. 390 { 391 "a_key": "", # Properties of the object. Contains field @type with type URL. 392 }, 393 ], 394 }, 395 "responseTime": "A String", # Output only. The time that this attempt response was received. 396 # 397 # `response_time` will be truncated to the nearest microsecond. 398 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. 399 # 400 # `dispatch_time` will be truncated to the nearest microsecond. 401 }, 402 "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt. 403 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. 404 # 405 # `schedule_time` will be truncated to the nearest microsecond. 406 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. 407 # 408 # If `response_time` is unset, then the task has not been attempted or is 409 # currently running and the `response_status` field is meaningless. 410 # different programming environments, including REST APIs and RPC APIs. It is 411 # used by [gRPC](https://github.com/grpc). Each `Status` message contains 412 # three pieces of data: error code, error message, and error details. 413 # 414 # You can find out more about this error model and how to work with it in the 415 # [API Design Guide](https://cloud.google.com/apis/design/errors). 416 "message": "A String", # A developer-facing error message, which should be in English. Any 417 # user-facing error message should be localized and sent in the 418 # google.rpc.Status.details field, or localized by the client. 419 "code": 42, # The status code, which should be an enum value of google.rpc.Code. 420 "details": [ # A list of messages that carry the error details. There is a common set of 421 # message types for APIs to use. 422 { 423 "a_key": "", # Properties of the object. Contains field @type with type URL. 424 }, 425 ], 426 }, 427 "responseTime": "A String", # Output only. The time that this attempt response was received. 428 # 429 # `response_time` will be truncated to the nearest microsecond. 430 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. 431 # 432 # `dispatch_time` will be truncated to the nearest microsecond. 433 }, 434 "name": "A String", # Optionally caller-specified in CreateTask. 435 # 436 # The task name. 437 # 438 # The task name must have the following format: 439 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` 440 # 441 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), 442 # hyphens (-), colons (:), or periods (.). 443 # For more information, see 444 # [Identifying 445 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) 446 # * `LOCATION_ID` is the canonical ID for the task's location. 447 # The list of available locations can be obtained by calling 448 # ListLocations. 449 # For more information, see https://cloud.google.com/about/locations/. 450 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or 451 # hyphens (-). The maximum length is 100 characters. 452 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), 453 # hyphens (-), or underscores (_). The maximum length is 500 characters. 454 "scheduleTime": "A String", # The time when the task is scheduled to be attempted. 455 # 456 # For App Engine queues, this is when the task will be attempted or retried. 457 # 458 # `schedule_time` will be truncated to the nearest microsecond. 459 "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not 460 # respond by this deadline then the request is cancelled and the attempt 461 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the 462 # task according to the RetryConfig. 463 # 464 # Note that when the request is cancelled, Cloud Tasks will stop listing for 465 # the response, but whether the worker stops processing depends on the 466 # worker. For example, if the worker is stuck, it may not react to cancelled 467 # requests. 468 # 469 # The default and maximum values depend on the type of request: 470 # 471 # 472 # * For App Engine tasks, 0 indicates that the 473 # request has the default deadline. The default deadline depends on the 474 # [scaling 475 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) 476 # of the service: 10 minutes for standard apps with automatic scaling, 24 477 # hours for standard apps with manual and basic scaling, and 60 minutes for 478 # flex apps. If the request deadline is set, it must be in the interval [15 479 # seconds, 24 hours 15 seconds]. Regardless of the task's 480 # `dispatch_deadline`, the app handler will not run for longer than than 481 # the service's timeout. We recommend setting the `dispatch_deadline` to 482 # at most a few seconds more than the app handler's timeout. For more 483 # information see 484 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). 485 # 486 # `dispatch_deadline` will be truncated to the nearest millisecond. The 487 # deadline is an approximate deadline. 488 "view": "A String", # Output only. The view specifies which subset of the Task has 489 # been returned. 490 "createTime": "A String", # Output only. The time that the task was created. 491 # 492 # `create_time` will be truncated to the nearest second. 493 "dispatchCount": 42, # Output only. The number of attempts dispatched. 494 # 495 # This count includes attempts which have been dispatched but haven't 496 # received a response. 497 "responseCount": 42, # Output only. The number of attempts which have received a response. 498 }, 499 } 500 501 x__xgafv: string, V1 error format. 502 Allowed values 503 1 - v1 error format 504 2 - v2 error format 505 506Returns: 507 An object of the form: 508 509 { # A unit of scheduled work. 510 "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler. 511 # 512 # An App Engine task is a task that has AppEngineHttpRequest set. 513 # 514 # The message defines the HTTP request that is sent to an App Engine app when 515 # the task is dispatched. 516 # 517 # Using AppEngineHttpRequest requires 518 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) 519 # Google IAM permission for the project 520 # and the following scope: 521 # 522 # `https://www.googleapis.com/auth/cloud-platform` 523 # 524 # The task will be delivered to the App Engine app which belongs to the same 525 # project as the queue. For more information, see 526 # [How Requests are 527 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 528 # and how routing is affected by 529 # [dispatch 530 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). 531 # Traffic is encrypted during transport and never leaves Google datacenters. 532 # Because this traffic is carried over a communication mechanism internal to 533 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). 534 # The request to the handler, however, will appear to have used the HTTP 535 # protocol. 536 # 537 # The AppEngineRouting used to construct the URL that the task is 538 # delivered to can be set at the queue-level or task-level: 539 # 540 # * If set, 541 # app_engine_routing_override 542 # is used for all tasks in the queue, no matter what the setting 543 # is for the 544 # task-level app_engine_routing. 545 # 546 # 547 # The `url` that the task will be sent to is: 548 # 549 # * `url =` host `+` 550 # relative_uri 551 # 552 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and 553 # URIs restricted with 554 # [`login: 555 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). 556 # Because tasks are not run as any user, they cannot be dispatched to URIs 557 # restricted with 558 # [`login: 559 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) 560 # Task dispatches also do not follow redirects. 561 # 562 # The task attempt has succeeded if the app's request handler returns an HTTP 563 # response code in the range [`200` - `299`]. The task attempt has failed if 564 # the app's handler returns a non-2xx response code or Cloud Tasks does 565 # not receive response before the deadline. Failed 566 # tasks will be retried according to the 567 # retry configuration. `503` (Service Unavailable) is 568 # considered an App Engine system error instead of an application error and 569 # will cause Cloud Tasks' traffic congestion control to temporarily throttle 570 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many 571 # Requests) response from an app handler does not cause traffic congestion 572 # control to throttle the queue. 573 "body": "A String", # HTTP request body. 574 # 575 # A request body is allowed only if the HTTP method is POST or PUT. It is 576 # an error to set a body on a task with an incompatible HttpMethod. 577 "headers": { # HTTP request headers. 578 # 579 # This map contains the header field names and values. 580 # Headers can be set when the 581 # task is created. 582 # Repeated headers are not supported but a header value can contain commas. 583 # 584 # Cloud Tasks sets some headers to default values: 585 # 586 # * `User-Agent`: By default, this header is 587 # `"AppEngine-Google; (+http://code.google.com/appengine)"`. 588 # This header can be modified, but Cloud Tasks will append 589 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 590 # modified `User-Agent`. 591 # 592 # If the task has a body, Cloud 593 # Tasks sets the following headers: 594 # 595 # * `Content-Type`: By default, the `Content-Type` header is set to 596 # `"application/octet-stream"`. The default can be overridden by explicitly 597 # setting `Content-Type` to a particular media type when the 598 # task is created. 599 # For example, `Content-Type` can be set to `"application/json"`. 600 # * `Content-Length`: This is computed by Cloud Tasks. This value is 601 # output only. It cannot be changed. 602 # 603 # The headers below cannot be set or overridden: 604 # 605 # * `Host` 606 # * `X-Google-*` 607 # * `X-AppEngine-*` 608 # 609 # In addition, Cloud Tasks sets some headers when the task is dispatched, 610 # such as headers containing information about the task; see 611 # [request 612 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 613 # These headers are set only when the task is dispatched, so they are not 614 # visible when the task is returned in a Cloud Tasks response. 615 # 616 # Although there is no specific limit for the maximum number of headers or 617 # the size, there is a limit on the maximum size of the Task. For more 618 # information, see the CreateTask documentation. 619 "a_key": "A String", 620 }, 621 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. 622 # 623 # If set, 624 # app_engine_routing_override 625 # is used for all tasks in the queue, no matter what the setting is for the 626 # task-level app_engine_routing. 627 # 628 # Defines routing characteristics specific to App Engine - service, version, 629 # and instance. 630 # 631 # For more information about services, versions, and instances see 632 # [An Overview of App 633 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), 634 # [Microservices Architecture on Google App 635 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), 636 # [App Engine Standard request 637 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), 638 # and [App Engine Flex request 639 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 640 "instance": "A String", # App instance. 641 # 642 # By default, the task is sent to an instance which is available when 643 # the task is attempted. 644 # 645 # Requests can only be sent to a specific instance if 646 # [manual scaling is used in App Engine 647 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). 648 # App Engine Flex does not support instances. For more information, see 649 # [App Engine Standard request 650 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 651 # and [App Engine Flex request 652 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 653 "host": "A String", # Output only. The host that the task is sent to. 654 # 655 # The host is constructed from the domain name of the app associated with 656 # the queue's project ID (for example <app-id>.appspot.com), and the 657 # service, version, 658 # and instance. Tasks which were created using 659 # the App Engine SDK might have a custom domain name. 660 # 661 # For more information, see 662 # [How Requests are 663 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). 664 "version": "A String", # App version. 665 # 666 # By default, the task is sent to the version which is the default 667 # version when the task is attempted. 668 # 669 # For some queues or tasks which were created using the App Engine 670 # Task Queue API, host is not parsable 671 # into service, 672 # version, and 673 # instance. For example, some tasks 674 # which were created using the App Engine SDK use a custom domain 675 # name; custom domains are not parsed by Cloud Tasks. If 676 # host is not parsable, then 677 # service, 678 # version, and 679 # instance are the empty string. 680 "service": "A String", # App service. 681 # 682 # By default, the task is sent to the service which is the default 683 # service when the task is attempted. 684 # 685 # For some queues or tasks which were created using the App Engine 686 # Task Queue API, host is not parsable 687 # into service, 688 # version, and 689 # instance. For example, some tasks 690 # which were created using the App Engine SDK use a custom domain 691 # name; custom domains are not parsed by Cloud Tasks. If 692 # host is not parsable, then 693 # service, 694 # version, and 695 # instance are the empty string. 696 }, 697 "relativeUri": "A String", # The relative URI. 698 # 699 # The relative URI must begin with "/" and must be a valid HTTP relative URI. 700 # It can contain a path and query string arguments. 701 # If the relative URI is empty, then the root path "/" will be used. 702 # No spaces are allowed, and the maximum length allowed is 2083 characters. 703 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. 704 # 705 # The app's request handler for the task's target URL must be able to handle 706 # HTTP requests with this http_method, otherwise the task attempt will fail 707 # with error code 405 (Method Not Allowed). See 708 # [Writing a push task request 709 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 710 # and the documentation for the request handlers in the language your app is 711 # written in e.g. 712 # [Python Request 713 # Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). 714 }, 715 "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt. 716 # 717 # Only dispatch_time will be set. 718 # The other Attempt information is not retained by Cloud Tasks. 719 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. 720 # 721 # `schedule_time` will be truncated to the nearest microsecond. 722 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. 723 # 724 # If `response_time` is unset, then the task has not been attempted or is 725 # currently running and the `response_status` field is meaningless. 726 # different programming environments, including REST APIs and RPC APIs. It is 727 # used by [gRPC](https://github.com/grpc). Each `Status` message contains 728 # three pieces of data: error code, error message, and error details. 729 # 730 # You can find out more about this error model and how to work with it in the 731 # [API Design Guide](https://cloud.google.com/apis/design/errors). 732 "message": "A String", # A developer-facing error message, which should be in English. Any 733 # user-facing error message should be localized and sent in the 734 # google.rpc.Status.details field, or localized by the client. 735 "code": 42, # The status code, which should be an enum value of google.rpc.Code. 736 "details": [ # A list of messages that carry the error details. There is a common set of 737 # message types for APIs to use. 738 { 739 "a_key": "", # Properties of the object. Contains field @type with type URL. 740 }, 741 ], 742 }, 743 "responseTime": "A String", # Output only. The time that this attempt response was received. 744 # 745 # `response_time` will be truncated to the nearest microsecond. 746 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. 747 # 748 # `dispatch_time` will be truncated to the nearest microsecond. 749 }, 750 "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt. 751 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. 752 # 753 # `schedule_time` will be truncated to the nearest microsecond. 754 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. 755 # 756 # If `response_time` is unset, then the task has not been attempted or is 757 # currently running and the `response_status` field is meaningless. 758 # different programming environments, including REST APIs and RPC APIs. It is 759 # used by [gRPC](https://github.com/grpc). Each `Status` message contains 760 # three pieces of data: error code, error message, and error details. 761 # 762 # You can find out more about this error model and how to work with it in the 763 # [API Design Guide](https://cloud.google.com/apis/design/errors). 764 "message": "A String", # A developer-facing error message, which should be in English. Any 765 # user-facing error message should be localized and sent in the 766 # google.rpc.Status.details field, or localized by the client. 767 "code": 42, # The status code, which should be an enum value of google.rpc.Code. 768 "details": [ # A list of messages that carry the error details. There is a common set of 769 # message types for APIs to use. 770 { 771 "a_key": "", # Properties of the object. Contains field @type with type URL. 772 }, 773 ], 774 }, 775 "responseTime": "A String", # Output only. The time that this attempt response was received. 776 # 777 # `response_time` will be truncated to the nearest microsecond. 778 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. 779 # 780 # `dispatch_time` will be truncated to the nearest microsecond. 781 }, 782 "name": "A String", # Optionally caller-specified in CreateTask. 783 # 784 # The task name. 785 # 786 # The task name must have the following format: 787 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` 788 # 789 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), 790 # hyphens (-), colons (:), or periods (.). 791 # For more information, see 792 # [Identifying 793 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) 794 # * `LOCATION_ID` is the canonical ID for the task's location. 795 # The list of available locations can be obtained by calling 796 # ListLocations. 797 # For more information, see https://cloud.google.com/about/locations/. 798 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or 799 # hyphens (-). The maximum length is 100 characters. 800 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), 801 # hyphens (-), or underscores (_). The maximum length is 500 characters. 802 "scheduleTime": "A String", # The time when the task is scheduled to be attempted. 803 # 804 # For App Engine queues, this is when the task will be attempted or retried. 805 # 806 # `schedule_time` will be truncated to the nearest microsecond. 807 "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not 808 # respond by this deadline then the request is cancelled and the attempt 809 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the 810 # task according to the RetryConfig. 811 # 812 # Note that when the request is cancelled, Cloud Tasks will stop listing for 813 # the response, but whether the worker stops processing depends on the 814 # worker. For example, if the worker is stuck, it may not react to cancelled 815 # requests. 816 # 817 # The default and maximum values depend on the type of request: 818 # 819 # 820 # * For App Engine tasks, 0 indicates that the 821 # request has the default deadline. The default deadline depends on the 822 # [scaling 823 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) 824 # of the service: 10 minutes for standard apps with automatic scaling, 24 825 # hours for standard apps with manual and basic scaling, and 60 minutes for 826 # flex apps. If the request deadline is set, it must be in the interval [15 827 # seconds, 24 hours 15 seconds]. Regardless of the task's 828 # `dispatch_deadline`, the app handler will not run for longer than than 829 # the service's timeout. We recommend setting the `dispatch_deadline` to 830 # at most a few seconds more than the app handler's timeout. For more 831 # information see 832 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). 833 # 834 # `dispatch_deadline` will be truncated to the nearest millisecond. The 835 # deadline is an approximate deadline. 836 "view": "A String", # Output only. The view specifies which subset of the Task has 837 # been returned. 838 "createTime": "A String", # Output only. The time that the task was created. 839 # 840 # `create_time` will be truncated to the nearest second. 841 "dispatchCount": 42, # Output only. The number of attempts dispatched. 842 # 843 # This count includes attempts which have been dispatched but haven't 844 # received a response. 845 "responseCount": 42, # Output only. The number of attempts which have received a response. 846 }</pre> 847</div> 848 849<div class="method"> 850 <code class="details" id="delete">delete(name, x__xgafv=None)</code> 851 <pre>Deletes a task. 852 853A task can be deleted if it is scheduled or dispatched. A task 854cannot be deleted if it has executed successfully or permanently 855failed. 856 857Args: 858 name: string, Required. 859 860The task name. For example: 861`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required) 862 x__xgafv: string, V1 error format. 863 Allowed values 864 1 - v1 error format 865 2 - v2 error format 866 867Returns: 868 An object of the form: 869 870 { # A generic empty message that you can re-use to avoid defining duplicated 871 # empty messages in your APIs. A typical example is to use it as the request 872 # or the response type of an API method. For instance: 873 # 874 # service Foo { 875 # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 876 # } 877 # 878 # The JSON representation for `Empty` is empty JSON object `{}`. 879 }</pre> 880</div> 881 882<div class="method"> 883 <code class="details" id="get">get(name, responseView=None, x__xgafv=None)</code> 884 <pre>Gets a task. 885 886Args: 887 name: string, Required. 888 889The task name. For example: 890`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required) 891 responseView: string, The response_view specifies which subset of the Task will be 892returned. 893 894By default response_view is BASIC; not all 895information is retrieved by default because some data, such as 896payloads, might be desirable to return only when needed because 897of its large size or because of the sensitivity of data that it 898contains. 899 900Authorization for FULL requires 901`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) 902permission on the Task resource. 903 x__xgafv: string, V1 error format. 904 Allowed values 905 1 - v1 error format 906 2 - v2 error format 907 908Returns: 909 An object of the form: 910 911 { # A unit of scheduled work. 912 "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler. 913 # 914 # An App Engine task is a task that has AppEngineHttpRequest set. 915 # 916 # The message defines the HTTP request that is sent to an App Engine app when 917 # the task is dispatched. 918 # 919 # Using AppEngineHttpRequest requires 920 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) 921 # Google IAM permission for the project 922 # and the following scope: 923 # 924 # `https://www.googleapis.com/auth/cloud-platform` 925 # 926 # The task will be delivered to the App Engine app which belongs to the same 927 # project as the queue. For more information, see 928 # [How Requests are 929 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 930 # and how routing is affected by 931 # [dispatch 932 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). 933 # Traffic is encrypted during transport and never leaves Google datacenters. 934 # Because this traffic is carried over a communication mechanism internal to 935 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). 936 # The request to the handler, however, will appear to have used the HTTP 937 # protocol. 938 # 939 # The AppEngineRouting used to construct the URL that the task is 940 # delivered to can be set at the queue-level or task-level: 941 # 942 # * If set, 943 # app_engine_routing_override 944 # is used for all tasks in the queue, no matter what the setting 945 # is for the 946 # task-level app_engine_routing. 947 # 948 # 949 # The `url` that the task will be sent to is: 950 # 951 # * `url =` host `+` 952 # relative_uri 953 # 954 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and 955 # URIs restricted with 956 # [`login: 957 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). 958 # Because tasks are not run as any user, they cannot be dispatched to URIs 959 # restricted with 960 # [`login: 961 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) 962 # Task dispatches also do not follow redirects. 963 # 964 # The task attempt has succeeded if the app's request handler returns an HTTP 965 # response code in the range [`200` - `299`]. The task attempt has failed if 966 # the app's handler returns a non-2xx response code or Cloud Tasks does 967 # not receive response before the deadline. Failed 968 # tasks will be retried according to the 969 # retry configuration. `503` (Service Unavailable) is 970 # considered an App Engine system error instead of an application error and 971 # will cause Cloud Tasks' traffic congestion control to temporarily throttle 972 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many 973 # Requests) response from an app handler does not cause traffic congestion 974 # control to throttle the queue. 975 "body": "A String", # HTTP request body. 976 # 977 # A request body is allowed only if the HTTP method is POST or PUT. It is 978 # an error to set a body on a task with an incompatible HttpMethod. 979 "headers": { # HTTP request headers. 980 # 981 # This map contains the header field names and values. 982 # Headers can be set when the 983 # task is created. 984 # Repeated headers are not supported but a header value can contain commas. 985 # 986 # Cloud Tasks sets some headers to default values: 987 # 988 # * `User-Agent`: By default, this header is 989 # `"AppEngine-Google; (+http://code.google.com/appengine)"`. 990 # This header can be modified, but Cloud Tasks will append 991 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 992 # modified `User-Agent`. 993 # 994 # If the task has a body, Cloud 995 # Tasks sets the following headers: 996 # 997 # * `Content-Type`: By default, the `Content-Type` header is set to 998 # `"application/octet-stream"`. The default can be overridden by explicitly 999 # setting `Content-Type` to a particular media type when the 1000 # task is created. 1001 # For example, `Content-Type` can be set to `"application/json"`. 1002 # * `Content-Length`: This is computed by Cloud Tasks. This value is 1003 # output only. It cannot be changed. 1004 # 1005 # The headers below cannot be set or overridden: 1006 # 1007 # * `Host` 1008 # * `X-Google-*` 1009 # * `X-AppEngine-*` 1010 # 1011 # In addition, Cloud Tasks sets some headers when the task is dispatched, 1012 # such as headers containing information about the task; see 1013 # [request 1014 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 1015 # These headers are set only when the task is dispatched, so they are not 1016 # visible when the task is returned in a Cloud Tasks response. 1017 # 1018 # Although there is no specific limit for the maximum number of headers or 1019 # the size, there is a limit on the maximum size of the Task. For more 1020 # information, see the CreateTask documentation. 1021 "a_key": "A String", 1022 }, 1023 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. 1024 # 1025 # If set, 1026 # app_engine_routing_override 1027 # is used for all tasks in the queue, no matter what the setting is for the 1028 # task-level app_engine_routing. 1029 # 1030 # Defines routing characteristics specific to App Engine - service, version, 1031 # and instance. 1032 # 1033 # For more information about services, versions, and instances see 1034 # [An Overview of App 1035 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), 1036 # [Microservices Architecture on Google App 1037 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), 1038 # [App Engine Standard request 1039 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), 1040 # and [App Engine Flex request 1041 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 1042 "instance": "A String", # App instance. 1043 # 1044 # By default, the task is sent to an instance which is available when 1045 # the task is attempted. 1046 # 1047 # Requests can only be sent to a specific instance if 1048 # [manual scaling is used in App Engine 1049 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). 1050 # App Engine Flex does not support instances. For more information, see 1051 # [App Engine Standard request 1052 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 1053 # and [App Engine Flex request 1054 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 1055 "host": "A String", # Output only. The host that the task is sent to. 1056 # 1057 # The host is constructed from the domain name of the app associated with 1058 # the queue's project ID (for example <app-id>.appspot.com), and the 1059 # service, version, 1060 # and instance. Tasks which were created using 1061 # the App Engine SDK might have a custom domain name. 1062 # 1063 # For more information, see 1064 # [How Requests are 1065 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). 1066 "version": "A String", # App version. 1067 # 1068 # By default, the task is sent to the version which is the default 1069 # version when the task is attempted. 1070 # 1071 # For some queues or tasks which were created using the App Engine 1072 # Task Queue API, host is not parsable 1073 # into service, 1074 # version, and 1075 # instance. For example, some tasks 1076 # which were created using the App Engine SDK use a custom domain 1077 # name; custom domains are not parsed by Cloud Tasks. If 1078 # host is not parsable, then 1079 # service, 1080 # version, and 1081 # instance are the empty string. 1082 "service": "A String", # App service. 1083 # 1084 # By default, the task is sent to the service which is the default 1085 # service when the task is attempted. 1086 # 1087 # For some queues or tasks which were created using the App Engine 1088 # Task Queue API, host is not parsable 1089 # into service, 1090 # version, and 1091 # instance. For example, some tasks 1092 # which were created using the App Engine SDK use a custom domain 1093 # name; custom domains are not parsed by Cloud Tasks. If 1094 # host is not parsable, then 1095 # service, 1096 # version, and 1097 # instance are the empty string. 1098 }, 1099 "relativeUri": "A String", # The relative URI. 1100 # 1101 # The relative URI must begin with "/" and must be a valid HTTP relative URI. 1102 # It can contain a path and query string arguments. 1103 # If the relative URI is empty, then the root path "/" will be used. 1104 # No spaces are allowed, and the maximum length allowed is 2083 characters. 1105 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. 1106 # 1107 # The app's request handler for the task's target URL must be able to handle 1108 # HTTP requests with this http_method, otherwise the task attempt will fail 1109 # with error code 405 (Method Not Allowed). See 1110 # [Writing a push task request 1111 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 1112 # and the documentation for the request handlers in the language your app is 1113 # written in e.g. 1114 # [Python Request 1115 # Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). 1116 }, 1117 "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt. 1118 # 1119 # Only dispatch_time will be set. 1120 # The other Attempt information is not retained by Cloud Tasks. 1121 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. 1122 # 1123 # `schedule_time` will be truncated to the nearest microsecond. 1124 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. 1125 # 1126 # If `response_time` is unset, then the task has not been attempted or is 1127 # currently running and the `response_status` field is meaningless. 1128 # different programming environments, including REST APIs and RPC APIs. It is 1129 # used by [gRPC](https://github.com/grpc). Each `Status` message contains 1130 # three pieces of data: error code, error message, and error details. 1131 # 1132 # You can find out more about this error model and how to work with it in the 1133 # [API Design Guide](https://cloud.google.com/apis/design/errors). 1134 "message": "A String", # A developer-facing error message, which should be in English. Any 1135 # user-facing error message should be localized and sent in the 1136 # google.rpc.Status.details field, or localized by the client. 1137 "code": 42, # The status code, which should be an enum value of google.rpc.Code. 1138 "details": [ # A list of messages that carry the error details. There is a common set of 1139 # message types for APIs to use. 1140 { 1141 "a_key": "", # Properties of the object. Contains field @type with type URL. 1142 }, 1143 ], 1144 }, 1145 "responseTime": "A String", # Output only. The time that this attempt response was received. 1146 # 1147 # `response_time` will be truncated to the nearest microsecond. 1148 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. 1149 # 1150 # `dispatch_time` will be truncated to the nearest microsecond. 1151 }, 1152 "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt. 1153 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. 1154 # 1155 # `schedule_time` will be truncated to the nearest microsecond. 1156 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. 1157 # 1158 # If `response_time` is unset, then the task has not been attempted or is 1159 # currently running and the `response_status` field is meaningless. 1160 # different programming environments, including REST APIs and RPC APIs. It is 1161 # used by [gRPC](https://github.com/grpc). Each `Status` message contains 1162 # three pieces of data: error code, error message, and error details. 1163 # 1164 # You can find out more about this error model and how to work with it in the 1165 # [API Design Guide](https://cloud.google.com/apis/design/errors). 1166 "message": "A String", # A developer-facing error message, which should be in English. Any 1167 # user-facing error message should be localized and sent in the 1168 # google.rpc.Status.details field, or localized by the client. 1169 "code": 42, # The status code, which should be an enum value of google.rpc.Code. 1170 "details": [ # A list of messages that carry the error details. There is a common set of 1171 # message types for APIs to use. 1172 { 1173 "a_key": "", # Properties of the object. Contains field @type with type URL. 1174 }, 1175 ], 1176 }, 1177 "responseTime": "A String", # Output only. The time that this attempt response was received. 1178 # 1179 # `response_time` will be truncated to the nearest microsecond. 1180 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. 1181 # 1182 # `dispatch_time` will be truncated to the nearest microsecond. 1183 }, 1184 "name": "A String", # Optionally caller-specified in CreateTask. 1185 # 1186 # The task name. 1187 # 1188 # The task name must have the following format: 1189 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` 1190 # 1191 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), 1192 # hyphens (-), colons (:), or periods (.). 1193 # For more information, see 1194 # [Identifying 1195 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) 1196 # * `LOCATION_ID` is the canonical ID for the task's location. 1197 # The list of available locations can be obtained by calling 1198 # ListLocations. 1199 # For more information, see https://cloud.google.com/about/locations/. 1200 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or 1201 # hyphens (-). The maximum length is 100 characters. 1202 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), 1203 # hyphens (-), or underscores (_). The maximum length is 500 characters. 1204 "scheduleTime": "A String", # The time when the task is scheduled to be attempted. 1205 # 1206 # For App Engine queues, this is when the task will be attempted or retried. 1207 # 1208 # `schedule_time` will be truncated to the nearest microsecond. 1209 "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not 1210 # respond by this deadline then the request is cancelled and the attempt 1211 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the 1212 # task according to the RetryConfig. 1213 # 1214 # Note that when the request is cancelled, Cloud Tasks will stop listing for 1215 # the response, but whether the worker stops processing depends on the 1216 # worker. For example, if the worker is stuck, it may not react to cancelled 1217 # requests. 1218 # 1219 # The default and maximum values depend on the type of request: 1220 # 1221 # 1222 # * For App Engine tasks, 0 indicates that the 1223 # request has the default deadline. The default deadline depends on the 1224 # [scaling 1225 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) 1226 # of the service: 10 minutes for standard apps with automatic scaling, 24 1227 # hours for standard apps with manual and basic scaling, and 60 minutes for 1228 # flex apps. If the request deadline is set, it must be in the interval [15 1229 # seconds, 24 hours 15 seconds]. Regardless of the task's 1230 # `dispatch_deadline`, the app handler will not run for longer than than 1231 # the service's timeout. We recommend setting the `dispatch_deadline` to 1232 # at most a few seconds more than the app handler's timeout. For more 1233 # information see 1234 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). 1235 # 1236 # `dispatch_deadline` will be truncated to the nearest millisecond. The 1237 # deadline is an approximate deadline. 1238 "view": "A String", # Output only. The view specifies which subset of the Task has 1239 # been returned. 1240 "createTime": "A String", # Output only. The time that the task was created. 1241 # 1242 # `create_time` will be truncated to the nearest second. 1243 "dispatchCount": 42, # Output only. The number of attempts dispatched. 1244 # 1245 # This count includes attempts which have been dispatched but haven't 1246 # received a response. 1247 "responseCount": 42, # Output only. The number of attempts which have received a response. 1248 }</pre> 1249</div> 1250 1251<div class="method"> 1252 <code class="details" id="list">list(parent, responseView=None, pageSize=None, pageToken=None, x__xgafv=None)</code> 1253 <pre>Lists the tasks in a queue. 1254 1255By default, only the BASIC view is retrieved 1256due to performance considerations; 1257response_view controls the 1258subset of information which is returned. 1259 1260The tasks may be returned in any order. The ordering may change at any 1261time. 1262 1263Args: 1264 parent: string, Required. 1265 1266The queue name. For example: 1267`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` (required) 1268 responseView: string, The response_view specifies which subset of the Task will be 1269returned. 1270 1271By default response_view is BASIC; not all 1272information is retrieved by default because some data, such as 1273payloads, might be desirable to return only when needed because 1274of its large size or because of the sensitivity of data that it 1275contains. 1276 1277Authorization for FULL requires 1278`cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) 1279permission on the Task resource. 1280 pageSize: integer, Maximum page size. 1281 1282Fewer tasks than requested might be returned, even if more tasks exist; use 1283next_page_token in the response to 1284determine if more tasks exist. 1285 1286The maximum page size is 1000. If unspecified, the page size will be the 1287maximum. 1288 pageToken: string, A token identifying the page of results to return. 1289 1290To request the first page results, page_token must be empty. To 1291request the next page of results, page_token must be the value of 1292next_page_token returned 1293from the previous call to ListTasks 1294method. 1295 1296The page token is valid for only 2 hours. 1297 x__xgafv: string, V1 error format. 1298 Allowed values 1299 1 - v1 error format 1300 2 - v2 error format 1301 1302Returns: 1303 An object of the form: 1304 1305 { # Response message for listing tasks using ListTasks. 1306 "nextPageToken": "A String", # A token to retrieve next page of results. 1307 # 1308 # To return the next page of results, call 1309 # ListTasks with this value as the 1310 # page_token. 1311 # 1312 # If the next_page_token is empty, there are no more results. 1313 "tasks": [ # The list of tasks. 1314 { # A unit of scheduled work. 1315 "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler. 1316 # 1317 # An App Engine task is a task that has AppEngineHttpRequest set. 1318 # 1319 # The message defines the HTTP request that is sent to an App Engine app when 1320 # the task is dispatched. 1321 # 1322 # Using AppEngineHttpRequest requires 1323 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) 1324 # Google IAM permission for the project 1325 # and the following scope: 1326 # 1327 # `https://www.googleapis.com/auth/cloud-platform` 1328 # 1329 # The task will be delivered to the App Engine app which belongs to the same 1330 # project as the queue. For more information, see 1331 # [How Requests are 1332 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 1333 # and how routing is affected by 1334 # [dispatch 1335 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). 1336 # Traffic is encrypted during transport and never leaves Google datacenters. 1337 # Because this traffic is carried over a communication mechanism internal to 1338 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). 1339 # The request to the handler, however, will appear to have used the HTTP 1340 # protocol. 1341 # 1342 # The AppEngineRouting used to construct the URL that the task is 1343 # delivered to can be set at the queue-level or task-level: 1344 # 1345 # * If set, 1346 # app_engine_routing_override 1347 # is used for all tasks in the queue, no matter what the setting 1348 # is for the 1349 # task-level app_engine_routing. 1350 # 1351 # 1352 # The `url` that the task will be sent to is: 1353 # 1354 # * `url =` host `+` 1355 # relative_uri 1356 # 1357 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and 1358 # URIs restricted with 1359 # [`login: 1360 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). 1361 # Because tasks are not run as any user, they cannot be dispatched to URIs 1362 # restricted with 1363 # [`login: 1364 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) 1365 # Task dispatches also do not follow redirects. 1366 # 1367 # The task attempt has succeeded if the app's request handler returns an HTTP 1368 # response code in the range [`200` - `299`]. The task attempt has failed if 1369 # the app's handler returns a non-2xx response code or Cloud Tasks does 1370 # not receive response before the deadline. Failed 1371 # tasks will be retried according to the 1372 # retry configuration. `503` (Service Unavailable) is 1373 # considered an App Engine system error instead of an application error and 1374 # will cause Cloud Tasks' traffic congestion control to temporarily throttle 1375 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many 1376 # Requests) response from an app handler does not cause traffic congestion 1377 # control to throttle the queue. 1378 "body": "A String", # HTTP request body. 1379 # 1380 # A request body is allowed only if the HTTP method is POST or PUT. It is 1381 # an error to set a body on a task with an incompatible HttpMethod. 1382 "headers": { # HTTP request headers. 1383 # 1384 # This map contains the header field names and values. 1385 # Headers can be set when the 1386 # task is created. 1387 # Repeated headers are not supported but a header value can contain commas. 1388 # 1389 # Cloud Tasks sets some headers to default values: 1390 # 1391 # * `User-Agent`: By default, this header is 1392 # `"AppEngine-Google; (+http://code.google.com/appengine)"`. 1393 # This header can be modified, but Cloud Tasks will append 1394 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 1395 # modified `User-Agent`. 1396 # 1397 # If the task has a body, Cloud 1398 # Tasks sets the following headers: 1399 # 1400 # * `Content-Type`: By default, the `Content-Type` header is set to 1401 # `"application/octet-stream"`. The default can be overridden by explicitly 1402 # setting `Content-Type` to a particular media type when the 1403 # task is created. 1404 # For example, `Content-Type` can be set to `"application/json"`. 1405 # * `Content-Length`: This is computed by Cloud Tasks. This value is 1406 # output only. It cannot be changed. 1407 # 1408 # The headers below cannot be set or overridden: 1409 # 1410 # * `Host` 1411 # * `X-Google-*` 1412 # * `X-AppEngine-*` 1413 # 1414 # In addition, Cloud Tasks sets some headers when the task is dispatched, 1415 # such as headers containing information about the task; see 1416 # [request 1417 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 1418 # These headers are set only when the task is dispatched, so they are not 1419 # visible when the task is returned in a Cloud Tasks response. 1420 # 1421 # Although there is no specific limit for the maximum number of headers or 1422 # the size, there is a limit on the maximum size of the Task. For more 1423 # information, see the CreateTask documentation. 1424 "a_key": "A String", 1425 }, 1426 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. 1427 # 1428 # If set, 1429 # app_engine_routing_override 1430 # is used for all tasks in the queue, no matter what the setting is for the 1431 # task-level app_engine_routing. 1432 # 1433 # Defines routing characteristics specific to App Engine - service, version, 1434 # and instance. 1435 # 1436 # For more information about services, versions, and instances see 1437 # [An Overview of App 1438 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), 1439 # [Microservices Architecture on Google App 1440 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), 1441 # [App Engine Standard request 1442 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), 1443 # and [App Engine Flex request 1444 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 1445 "instance": "A String", # App instance. 1446 # 1447 # By default, the task is sent to an instance which is available when 1448 # the task is attempted. 1449 # 1450 # Requests can only be sent to a specific instance if 1451 # [manual scaling is used in App Engine 1452 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). 1453 # App Engine Flex does not support instances. For more information, see 1454 # [App Engine Standard request 1455 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 1456 # and [App Engine Flex request 1457 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 1458 "host": "A String", # Output only. The host that the task is sent to. 1459 # 1460 # The host is constructed from the domain name of the app associated with 1461 # the queue's project ID (for example <app-id>.appspot.com), and the 1462 # service, version, 1463 # and instance. Tasks which were created using 1464 # the App Engine SDK might have a custom domain name. 1465 # 1466 # For more information, see 1467 # [How Requests are 1468 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). 1469 "version": "A String", # App version. 1470 # 1471 # By default, the task is sent to the version which is the default 1472 # version when the task is attempted. 1473 # 1474 # For some queues or tasks which were created using the App Engine 1475 # Task Queue API, host is not parsable 1476 # into service, 1477 # version, and 1478 # instance. For example, some tasks 1479 # which were created using the App Engine SDK use a custom domain 1480 # name; custom domains are not parsed by Cloud Tasks. If 1481 # host is not parsable, then 1482 # service, 1483 # version, and 1484 # instance are the empty string. 1485 "service": "A String", # App service. 1486 # 1487 # By default, the task is sent to the service which is the default 1488 # service when the task is attempted. 1489 # 1490 # For some queues or tasks which were created using the App Engine 1491 # Task Queue API, host is not parsable 1492 # into service, 1493 # version, and 1494 # instance. For example, some tasks 1495 # which were created using the App Engine SDK use a custom domain 1496 # name; custom domains are not parsed by Cloud Tasks. If 1497 # host is not parsable, then 1498 # service, 1499 # version, and 1500 # instance are the empty string. 1501 }, 1502 "relativeUri": "A String", # The relative URI. 1503 # 1504 # The relative URI must begin with "/" and must be a valid HTTP relative URI. 1505 # It can contain a path and query string arguments. 1506 # If the relative URI is empty, then the root path "/" will be used. 1507 # No spaces are allowed, and the maximum length allowed is 2083 characters. 1508 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. 1509 # 1510 # The app's request handler for the task's target URL must be able to handle 1511 # HTTP requests with this http_method, otherwise the task attempt will fail 1512 # with error code 405 (Method Not Allowed). See 1513 # [Writing a push task request 1514 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 1515 # and the documentation for the request handlers in the language your app is 1516 # written in e.g. 1517 # [Python Request 1518 # Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). 1519 }, 1520 "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt. 1521 # 1522 # Only dispatch_time will be set. 1523 # The other Attempt information is not retained by Cloud Tasks. 1524 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. 1525 # 1526 # `schedule_time` will be truncated to the nearest microsecond. 1527 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. 1528 # 1529 # If `response_time` is unset, then the task has not been attempted or is 1530 # currently running and the `response_status` field is meaningless. 1531 # different programming environments, including REST APIs and RPC APIs. It is 1532 # used by [gRPC](https://github.com/grpc). Each `Status` message contains 1533 # three pieces of data: error code, error message, and error details. 1534 # 1535 # You can find out more about this error model and how to work with it in the 1536 # [API Design Guide](https://cloud.google.com/apis/design/errors). 1537 "message": "A String", # A developer-facing error message, which should be in English. Any 1538 # user-facing error message should be localized and sent in the 1539 # google.rpc.Status.details field, or localized by the client. 1540 "code": 42, # The status code, which should be an enum value of google.rpc.Code. 1541 "details": [ # A list of messages that carry the error details. There is a common set of 1542 # message types for APIs to use. 1543 { 1544 "a_key": "", # Properties of the object. Contains field @type with type URL. 1545 }, 1546 ], 1547 }, 1548 "responseTime": "A String", # Output only. The time that this attempt response was received. 1549 # 1550 # `response_time` will be truncated to the nearest microsecond. 1551 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. 1552 # 1553 # `dispatch_time` will be truncated to the nearest microsecond. 1554 }, 1555 "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt. 1556 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. 1557 # 1558 # `schedule_time` will be truncated to the nearest microsecond. 1559 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. 1560 # 1561 # If `response_time` is unset, then the task has not been attempted or is 1562 # currently running and the `response_status` field is meaningless. 1563 # different programming environments, including REST APIs and RPC APIs. It is 1564 # used by [gRPC](https://github.com/grpc). Each `Status` message contains 1565 # three pieces of data: error code, error message, and error details. 1566 # 1567 # You can find out more about this error model and how to work with it in the 1568 # [API Design Guide](https://cloud.google.com/apis/design/errors). 1569 "message": "A String", # A developer-facing error message, which should be in English. Any 1570 # user-facing error message should be localized and sent in the 1571 # google.rpc.Status.details field, or localized by the client. 1572 "code": 42, # The status code, which should be an enum value of google.rpc.Code. 1573 "details": [ # A list of messages that carry the error details. There is a common set of 1574 # message types for APIs to use. 1575 { 1576 "a_key": "", # Properties of the object. Contains field @type with type URL. 1577 }, 1578 ], 1579 }, 1580 "responseTime": "A String", # Output only. The time that this attempt response was received. 1581 # 1582 # `response_time` will be truncated to the nearest microsecond. 1583 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. 1584 # 1585 # `dispatch_time` will be truncated to the nearest microsecond. 1586 }, 1587 "name": "A String", # Optionally caller-specified in CreateTask. 1588 # 1589 # The task name. 1590 # 1591 # The task name must have the following format: 1592 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` 1593 # 1594 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), 1595 # hyphens (-), colons (:), or periods (.). 1596 # For more information, see 1597 # [Identifying 1598 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) 1599 # * `LOCATION_ID` is the canonical ID for the task's location. 1600 # The list of available locations can be obtained by calling 1601 # ListLocations. 1602 # For more information, see https://cloud.google.com/about/locations/. 1603 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or 1604 # hyphens (-). The maximum length is 100 characters. 1605 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), 1606 # hyphens (-), or underscores (_). The maximum length is 500 characters. 1607 "scheduleTime": "A String", # The time when the task is scheduled to be attempted. 1608 # 1609 # For App Engine queues, this is when the task will be attempted or retried. 1610 # 1611 # `schedule_time` will be truncated to the nearest microsecond. 1612 "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not 1613 # respond by this deadline then the request is cancelled and the attempt 1614 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the 1615 # task according to the RetryConfig. 1616 # 1617 # Note that when the request is cancelled, Cloud Tasks will stop listing for 1618 # the response, but whether the worker stops processing depends on the 1619 # worker. For example, if the worker is stuck, it may not react to cancelled 1620 # requests. 1621 # 1622 # The default and maximum values depend on the type of request: 1623 # 1624 # 1625 # * For App Engine tasks, 0 indicates that the 1626 # request has the default deadline. The default deadline depends on the 1627 # [scaling 1628 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) 1629 # of the service: 10 minutes for standard apps with automatic scaling, 24 1630 # hours for standard apps with manual and basic scaling, and 60 minutes for 1631 # flex apps. If the request deadline is set, it must be in the interval [15 1632 # seconds, 24 hours 15 seconds]. Regardless of the task's 1633 # `dispatch_deadline`, the app handler will not run for longer than than 1634 # the service's timeout. We recommend setting the `dispatch_deadline` to 1635 # at most a few seconds more than the app handler's timeout. For more 1636 # information see 1637 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). 1638 # 1639 # `dispatch_deadline` will be truncated to the nearest millisecond. The 1640 # deadline is an approximate deadline. 1641 "view": "A String", # Output only. The view specifies which subset of the Task has 1642 # been returned. 1643 "createTime": "A String", # Output only. The time that the task was created. 1644 # 1645 # `create_time` will be truncated to the nearest second. 1646 "dispatchCount": 42, # Output only. The number of attempts dispatched. 1647 # 1648 # This count includes attempts which have been dispatched but haven't 1649 # received a response. 1650 "responseCount": 42, # Output only. The number of attempts which have received a response. 1651 }, 1652 ], 1653 }</pre> 1654</div> 1655 1656<div class="method"> 1657 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 1658 <pre>Retrieves the next page of results. 1659 1660Args: 1661 previous_request: The request for the previous page. (required) 1662 previous_response: The response from the request for the previous page. (required) 1663 1664Returns: 1665 A request object that you can call 'execute()' on to request the next 1666 page. Returns None if there are no more items in the collection. 1667 </pre> 1668</div> 1669 1670<div class="method"> 1671 <code class="details" id="run">run(name, body, x__xgafv=None)</code> 1672 <pre>Forces a task to run now. 1673 1674When this method is called, Cloud Tasks will dispatch the task, even if 1675the task is already running, the queue has reached its RateLimits or 1676is PAUSED. 1677 1678This command is meant to be used for manual debugging. For 1679example, RunTask can be used to retry a failed 1680task after a fix has been made or to manually force a task to be 1681dispatched now. 1682 1683The dispatched task is returned. That is, the task that is returned 1684contains the status after the task is dispatched but 1685before the task is received by its target. 1686 1687If Cloud Tasks receives a successful response from the task's 1688target, then the task will be deleted; otherwise the task's 1689schedule_time will be reset to the time that 1690RunTask was called plus the retry delay specified 1691in the queue's RetryConfig. 1692 1693RunTask returns 1694NOT_FOUND when it is called on a 1695task that has already succeeded or permanently failed. 1696 1697Args: 1698 name: string, Required. 1699 1700The task name. For example: 1701`projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required) 1702 body: object, The request body. (required) 1703 The object takes the form of: 1704 1705{ # Request message for forcing a task to run now using 1706 # RunTask. 1707 "responseView": "A String", # The response_view specifies which subset of the Task will be 1708 # returned. 1709 # 1710 # By default response_view is BASIC; not all 1711 # information is retrieved by default because some data, such as 1712 # payloads, might be desirable to return only when needed because 1713 # of its large size or because of the sensitivity of data that it 1714 # contains. 1715 # 1716 # Authorization for FULL requires 1717 # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) 1718 # permission on the Task resource. 1719 } 1720 1721 x__xgafv: string, V1 error format. 1722 Allowed values 1723 1 - v1 error format 1724 2 - v2 error format 1725 1726Returns: 1727 An object of the form: 1728 1729 { # A unit of scheduled work. 1730 "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler. 1731 # 1732 # An App Engine task is a task that has AppEngineHttpRequest set. 1733 # 1734 # The message defines the HTTP request that is sent to an App Engine app when 1735 # the task is dispatched. 1736 # 1737 # Using AppEngineHttpRequest requires 1738 # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) 1739 # Google IAM permission for the project 1740 # and the following scope: 1741 # 1742 # `https://www.googleapis.com/auth/cloud-platform` 1743 # 1744 # The task will be delivered to the App Engine app which belongs to the same 1745 # project as the queue. For more information, see 1746 # [How Requests are 1747 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 1748 # and how routing is affected by 1749 # [dispatch 1750 # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). 1751 # Traffic is encrypted during transport and never leaves Google datacenters. 1752 # Because this traffic is carried over a communication mechanism internal to 1753 # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). 1754 # The request to the handler, however, will appear to have used the HTTP 1755 # protocol. 1756 # 1757 # The AppEngineRouting used to construct the URL that the task is 1758 # delivered to can be set at the queue-level or task-level: 1759 # 1760 # * If set, 1761 # app_engine_routing_override 1762 # is used for all tasks in the queue, no matter what the setting 1763 # is for the 1764 # task-level app_engine_routing. 1765 # 1766 # 1767 # The `url` that the task will be sent to is: 1768 # 1769 # * `url =` host `+` 1770 # relative_uri 1771 # 1772 # Tasks can be dispatched to secure app handlers, unsecure app handlers, and 1773 # URIs restricted with 1774 # [`login: 1775 # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). 1776 # Because tasks are not run as any user, they cannot be dispatched to URIs 1777 # restricted with 1778 # [`login: 1779 # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) 1780 # Task dispatches also do not follow redirects. 1781 # 1782 # The task attempt has succeeded if the app's request handler returns an HTTP 1783 # response code in the range [`200` - `299`]. The task attempt has failed if 1784 # the app's handler returns a non-2xx response code or Cloud Tasks does 1785 # not receive response before the deadline. Failed 1786 # tasks will be retried according to the 1787 # retry configuration. `503` (Service Unavailable) is 1788 # considered an App Engine system error instead of an application error and 1789 # will cause Cloud Tasks' traffic congestion control to temporarily throttle 1790 # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many 1791 # Requests) response from an app handler does not cause traffic congestion 1792 # control to throttle the queue. 1793 "body": "A String", # HTTP request body. 1794 # 1795 # A request body is allowed only if the HTTP method is POST or PUT. It is 1796 # an error to set a body on a task with an incompatible HttpMethod. 1797 "headers": { # HTTP request headers. 1798 # 1799 # This map contains the header field names and values. 1800 # Headers can be set when the 1801 # task is created. 1802 # Repeated headers are not supported but a header value can contain commas. 1803 # 1804 # Cloud Tasks sets some headers to default values: 1805 # 1806 # * `User-Agent`: By default, this header is 1807 # `"AppEngine-Google; (+http://code.google.com/appengine)"`. 1808 # This header can be modified, but Cloud Tasks will append 1809 # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the 1810 # modified `User-Agent`. 1811 # 1812 # If the task has a body, Cloud 1813 # Tasks sets the following headers: 1814 # 1815 # * `Content-Type`: By default, the `Content-Type` header is set to 1816 # `"application/octet-stream"`. The default can be overridden by explicitly 1817 # setting `Content-Type` to a particular media type when the 1818 # task is created. 1819 # For example, `Content-Type` can be set to `"application/json"`. 1820 # * `Content-Length`: This is computed by Cloud Tasks. This value is 1821 # output only. It cannot be changed. 1822 # 1823 # The headers below cannot be set or overridden: 1824 # 1825 # * `Host` 1826 # * `X-Google-*` 1827 # * `X-AppEngine-*` 1828 # 1829 # In addition, Cloud Tasks sets some headers when the task is dispatched, 1830 # such as headers containing information about the task; see 1831 # [request 1832 # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). 1833 # These headers are set only when the task is dispatched, so they are not 1834 # visible when the task is returned in a Cloud Tasks response. 1835 # 1836 # Although there is no specific limit for the maximum number of headers or 1837 # the size, there is a limit on the maximum size of the Task. For more 1838 # information, see the CreateTask documentation. 1839 "a_key": "A String", 1840 }, 1841 "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. 1842 # 1843 # If set, 1844 # app_engine_routing_override 1845 # is used for all tasks in the queue, no matter what the setting is for the 1846 # task-level app_engine_routing. 1847 # 1848 # Defines routing characteristics specific to App Engine - service, version, 1849 # and instance. 1850 # 1851 # For more information about services, versions, and instances see 1852 # [An Overview of App 1853 # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), 1854 # [Microservices Architecture on Google App 1855 # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), 1856 # [App Engine Standard request 1857 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), 1858 # and [App Engine Flex request 1859 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 1860 "instance": "A String", # App instance. 1861 # 1862 # By default, the task is sent to an instance which is available when 1863 # the task is attempted. 1864 # 1865 # Requests can only be sent to a specific instance if 1866 # [manual scaling is used in App Engine 1867 # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). 1868 # App Engine Flex does not support instances. For more information, see 1869 # [App Engine Standard request 1870 # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) 1871 # and [App Engine Flex request 1872 # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). 1873 "host": "A String", # Output only. The host that the task is sent to. 1874 # 1875 # The host is constructed from the domain name of the app associated with 1876 # the queue's project ID (for example <app-id>.appspot.com), and the 1877 # service, version, 1878 # and instance. Tasks which were created using 1879 # the App Engine SDK might have a custom domain name. 1880 # 1881 # For more information, see 1882 # [How Requests are 1883 # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). 1884 "version": "A String", # App version. 1885 # 1886 # By default, the task is sent to the version which is the default 1887 # version when the task is attempted. 1888 # 1889 # For some queues or tasks which were created using the App Engine 1890 # Task Queue API, host is not parsable 1891 # into service, 1892 # version, and 1893 # instance. For example, some tasks 1894 # which were created using the App Engine SDK use a custom domain 1895 # name; custom domains are not parsed by Cloud Tasks. If 1896 # host is not parsable, then 1897 # service, 1898 # version, and 1899 # instance are the empty string. 1900 "service": "A String", # App service. 1901 # 1902 # By default, the task is sent to the service which is the default 1903 # service when the task is attempted. 1904 # 1905 # For some queues or tasks which were created using the App Engine 1906 # Task Queue API, host is not parsable 1907 # into service, 1908 # version, and 1909 # instance. For example, some tasks 1910 # which were created using the App Engine SDK use a custom domain 1911 # name; custom domains are not parsed by Cloud Tasks. If 1912 # host is not parsable, then 1913 # service, 1914 # version, and 1915 # instance are the empty string. 1916 }, 1917 "relativeUri": "A String", # The relative URI. 1918 # 1919 # The relative URI must begin with "/" and must be a valid HTTP relative URI. 1920 # It can contain a path and query string arguments. 1921 # If the relative URI is empty, then the root path "/" will be used. 1922 # No spaces are allowed, and the maximum length allowed is 2083 characters. 1923 "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. 1924 # 1925 # The app's request handler for the task's target URL must be able to handle 1926 # HTTP requests with this http_method, otherwise the task attempt will fail 1927 # with error code 405 (Method Not Allowed). See 1928 # [Writing a push task request 1929 # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) 1930 # and the documentation for the request handlers in the language your app is 1931 # written in e.g. 1932 # [Python Request 1933 # Handler](https://cloud.google.com/appengine/docs/python/tools/webapp/requesthandlerclass). 1934 }, 1935 "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt. 1936 # 1937 # Only dispatch_time will be set. 1938 # The other Attempt information is not retained by Cloud Tasks. 1939 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. 1940 # 1941 # `schedule_time` will be truncated to the nearest microsecond. 1942 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. 1943 # 1944 # If `response_time` is unset, then the task has not been attempted or is 1945 # currently running and the `response_status` field is meaningless. 1946 # different programming environments, including REST APIs and RPC APIs. It is 1947 # used by [gRPC](https://github.com/grpc). Each `Status` message contains 1948 # three pieces of data: error code, error message, and error details. 1949 # 1950 # You can find out more about this error model and how to work with it in the 1951 # [API Design Guide](https://cloud.google.com/apis/design/errors). 1952 "message": "A String", # A developer-facing error message, which should be in English. Any 1953 # user-facing error message should be localized and sent in the 1954 # google.rpc.Status.details field, or localized by the client. 1955 "code": 42, # The status code, which should be an enum value of google.rpc.Code. 1956 "details": [ # A list of messages that carry the error details. There is a common set of 1957 # message types for APIs to use. 1958 { 1959 "a_key": "", # Properties of the object. Contains field @type with type URL. 1960 }, 1961 ], 1962 }, 1963 "responseTime": "A String", # Output only. The time that this attempt response was received. 1964 # 1965 # `response_time` will be truncated to the nearest microsecond. 1966 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. 1967 # 1968 # `dispatch_time` will be truncated to the nearest microsecond. 1969 }, 1970 "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt. 1971 "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. 1972 # 1973 # `schedule_time` will be truncated to the nearest microsecond. 1974 "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. 1975 # 1976 # If `response_time` is unset, then the task has not been attempted or is 1977 # currently running and the `response_status` field is meaningless. 1978 # different programming environments, including REST APIs and RPC APIs. It is 1979 # used by [gRPC](https://github.com/grpc). Each `Status` message contains 1980 # three pieces of data: error code, error message, and error details. 1981 # 1982 # You can find out more about this error model and how to work with it in the 1983 # [API Design Guide](https://cloud.google.com/apis/design/errors). 1984 "message": "A String", # A developer-facing error message, which should be in English. Any 1985 # user-facing error message should be localized and sent in the 1986 # google.rpc.Status.details field, or localized by the client. 1987 "code": 42, # The status code, which should be an enum value of google.rpc.Code. 1988 "details": [ # A list of messages that carry the error details. There is a common set of 1989 # message types for APIs to use. 1990 { 1991 "a_key": "", # Properties of the object. Contains field @type with type URL. 1992 }, 1993 ], 1994 }, 1995 "responseTime": "A String", # Output only. The time that this attempt response was received. 1996 # 1997 # `response_time` will be truncated to the nearest microsecond. 1998 "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. 1999 # 2000 # `dispatch_time` will be truncated to the nearest microsecond. 2001 }, 2002 "name": "A String", # Optionally caller-specified in CreateTask. 2003 # 2004 # The task name. 2005 # 2006 # The task name must have the following format: 2007 # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` 2008 # 2009 # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), 2010 # hyphens (-), colons (:), or periods (.). 2011 # For more information, see 2012 # [Identifying 2013 # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) 2014 # * `LOCATION_ID` is the canonical ID for the task's location. 2015 # The list of available locations can be obtained by calling 2016 # ListLocations. 2017 # For more information, see https://cloud.google.com/about/locations/. 2018 # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or 2019 # hyphens (-). The maximum length is 100 characters. 2020 # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), 2021 # hyphens (-), or underscores (_). The maximum length is 500 characters. 2022 "scheduleTime": "A String", # The time when the task is scheduled to be attempted. 2023 # 2024 # For App Engine queues, this is when the task will be attempted or retried. 2025 # 2026 # `schedule_time` will be truncated to the nearest microsecond. 2027 "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not 2028 # respond by this deadline then the request is cancelled and the attempt 2029 # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the 2030 # task according to the RetryConfig. 2031 # 2032 # Note that when the request is cancelled, Cloud Tasks will stop listing for 2033 # the response, but whether the worker stops processing depends on the 2034 # worker. For example, if the worker is stuck, it may not react to cancelled 2035 # requests. 2036 # 2037 # The default and maximum values depend on the type of request: 2038 # 2039 # 2040 # * For App Engine tasks, 0 indicates that the 2041 # request has the default deadline. The default deadline depends on the 2042 # [scaling 2043 # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) 2044 # of the service: 10 minutes for standard apps with automatic scaling, 24 2045 # hours for standard apps with manual and basic scaling, and 60 minutes for 2046 # flex apps. If the request deadline is set, it must be in the interval [15 2047 # seconds, 24 hours 15 seconds]. Regardless of the task's 2048 # `dispatch_deadline`, the app handler will not run for longer than than 2049 # the service's timeout. We recommend setting the `dispatch_deadline` to 2050 # at most a few seconds more than the app handler's timeout. For more 2051 # information see 2052 # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). 2053 # 2054 # `dispatch_deadline` will be truncated to the nearest millisecond. The 2055 # deadline is an approximate deadline. 2056 "view": "A String", # Output only. The view specifies which subset of the Task has 2057 # been returned. 2058 "createTime": "A String", # Output only. The time that the task was created. 2059 # 2060 # `create_time` will be truncated to the nearest second. 2061 "dispatchCount": 42, # Output only. The number of attempts dispatched. 2062 # 2063 # This count includes attempts which have been dispatched but haven't 2064 # received a response. 2065 "responseCount": 42, # Output only. The number of attempts which have received a response. 2066 }</pre> 2067</div> 2068 2069</body></html>