Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
| 75 | <h1><a href="cloudtasks_v2.html">Cloud Tasks API</a> . <a href="cloudtasks_v2.projects.html">projects</a> . <a href="cloudtasks_v2.projects.locations.html">locations</a> . <a href="cloudtasks_v2.projects.locations.queues.html">queues</a> . <a href="cloudtasks_v2.projects.locations.queues.tasks.html">tasks</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 78 | <code><a href="#create">create(parent, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 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"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 87 | <code><a href="#list">list(parent, responseView=None, pageToken=None, pageSize=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 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"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 93 | <code><a href="#run">run(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 94 | <p class="firstline">Forces a task to run now.</p> |
| 95 | <h3>Method Details</h3> |
| 96 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 97 | <code class="details" id="create">create(parent, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 98 | <pre>Creates a task and adds it to a queue. |
| 99 | |
| 100 | Tasks cannot be updated after creation; there is no UpdateTask command. |
| 101 | |
| 102 | * The maximum task size is 100KB. |
| 103 | |
| 104 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 105 | parent: string, Required. The queue name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 106 | `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` |
| 107 | |
| 108 | The queue must already exist. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 109 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 110 | The object takes the form of: |
| 111 | |
| 112 | { # Request message for CreateTask. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 113 | "responseView": "A String", # The response_view specifies which subset of the Task will be |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 114 | # returned. |
| 115 | # |
| 116 | # By default response_view is BASIC; not all |
| 117 | # information is retrieved by default because some data, such as |
| 118 | # payloads, might be desirable to return only when needed because |
| 119 | # of its large size or because of the sensitivity of data that it |
| 120 | # contains. |
| 121 | # |
| 122 | # Authorization for FULL requires |
| 123 | # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) |
| 124 | # permission on the Task resource. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 125 | "task": { # A unit of scheduled work. # Required. The task to add. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 126 | # |
| 127 | # Task names have the following format: |
| 128 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. |
| 129 | # The user can optionally specify a task name. If a |
| 130 | # name is not specified then the system will generate a random |
| 131 | # unique task id, which will be set in the task returned in the |
| 132 | # response. |
| 133 | # |
| 134 | # If schedule_time is not set or is in the |
| 135 | # past then Cloud Tasks will set it to the current time. |
| 136 | # |
| 137 | # Task De-duplication: |
| 138 | # |
| 139 | # Explicitly specifying a task ID enables task de-duplication. If |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 140 | # a task's ID is identical to that of an existing task or a task |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 141 | # that was deleted or executed recently then the call will fail |
| 142 | # with ALREADY_EXISTS. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 143 | # If the task's queue was created using Cloud Tasks, then another task with |
| 144 | # the same name can't be created for ~1hour after the original task was |
| 145 | # deleted or executed. If the task's queue was created using queue.yaml or |
| 146 | # queue.xml, then another task with the same name can't be created |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 147 | # for ~9days after the original task was deleted or executed. |
| 148 | # |
| 149 | # Because there is an extra lookup cost to identify duplicate task |
| 150 | # names, these CreateTask calls have significantly |
| 151 | # increased latency. Using hashed strings for the task id or for |
| 152 | # the prefix of the task id is recommended. Choosing task ids that |
| 153 | # are sequential or have sequential prefixes, for example using a |
| 154 | # timestamp, causes an increase in latency and error rates in all |
| 155 | # task commands. The infrastructure relies on an approximately |
| 156 | # uniform distribution of task ids to store and serve tasks |
| 157 | # efficiently. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 158 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted or retried. |
| 159 | # |
| 160 | # `schedule_time` will be truncated to the nearest microsecond. |
| 161 | "createTime": "A String", # Output only. The time that the task was created. |
| 162 | # |
| 163 | # `create_time` will be truncated to the nearest second. |
| 164 | "httpRequest": { # HTTP request. # HTTP request that is sent to the worker. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 165 | # |
| 166 | # An HTTP task is a task that has HttpRequest set. |
| 167 | # |
| 168 | # The task will be pushed to the worker as an HTTP request. If the worker |
| 169 | # or the redirected worker acknowledges the task by returning a successful HTTP |
| 170 | # response code ([`200` - `299`]), the task will be removed from the queue. If |
| 171 | # any other HTTP response code is returned or no response is received, the |
| 172 | # task will be retried according to the following: |
| 173 | # |
| 174 | # * User-specified throttling: retry configuration, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 175 | # rate limits, and the queue's state. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 176 | # |
| 177 | # * System throttling: To prevent the worker from overloading, Cloud Tasks may |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 178 | # temporarily reduce the queue's effective rate. User-specified settings |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 179 | # will not be changed. |
| 180 | # |
| 181 | # System throttling happens because: |
| 182 | # |
| 183 | # * Cloud Tasks backs off on all errors. Normally the backoff specified in |
| 184 | # rate limits will be used. But if the worker returns |
| 185 | # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of |
| 186 | # errors is high, Cloud Tasks will use a higher backoff rate. The retry |
| 187 | # specified in the `Retry-After` HTTP response header is considered. |
| 188 | # |
| 189 | # * To prevent traffic spikes and to smooth sudden increases in traffic, |
| 190 | # dispatches ramp up slowly when the queue is newly created or idle and |
| 191 | # if large numbers of tasks suddenly become available to dispatch (due to |
| 192 | # spikes in create task rates, the queue being unpaused, or many tasks |
| 193 | # that are scheduled at the same time). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 194 | "oidcToken": { # Contains information needed for generating an # If specified, an |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 195 | # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) |
| 196 | # token will be generated and attached as an `Authorization` header in the |
| 197 | # HTTP request. |
| 198 | # |
| 199 | # This type of authorization can be used for many scenarios, including |
| 200 | # calling Cloud Run, or endpoints where you intend to validate the token |
| 201 | # yourself. |
| 202 | # [OpenID Connect |
| 203 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 204 | # This type of authorization can be used for many scenarios, including |
| 205 | # calling Cloud Run, or endpoints where you intend to validate the token |
| 206 | # yourself. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 207 | "audience": "A String", # Audience to be used when generating OIDC token. If not specified, the URI |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 208 | # specified in target will be used. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 209 | "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 210 | # to be used for generating OIDC token. |
| 211 | # The service account must be within the same project as the queue. The |
| 212 | # caller must have iam.serviceAccounts.actAs permission for the service |
| 213 | # account. |
| 214 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 215 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 216 | "body": "A String", # HTTP request body. |
| 217 | # |
| 218 | # A request body is allowed only if the |
| 219 | # HTTP method is POST, PUT, or PATCH. It is an |
| 220 | # error to set body on a task with an incompatible HttpMethod. |
| 221 | "oauthToken": { # Contains information needed for generating an # If specified, an |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 222 | # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) |
| 223 | # will be generated and attached as an `Authorization` header in the HTTP |
| 224 | # request. |
| 225 | # |
| 226 | # This type of authorization should generally only be used when calling |
| 227 | # Google APIs hosted on *.googleapis.com. |
| 228 | # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). |
| 229 | # This type of authorization should generally only be used when calling Google |
| 230 | # APIs hosted on *.googleapis.com. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 231 | "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 232 | # to be used for generating OAuth token. |
| 233 | # The service account must be within the same project as the queue. The |
| 234 | # caller must have iam.serviceAccounts.actAs permission for the service |
| 235 | # account. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 236 | "scope": "A String", # OAuth scope to be used for generating OAuth access token. |
| 237 | # If not specified, "https://www.googleapis.com/auth/cloud-platform" |
| 238 | # will be used. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 239 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 240 | "headers": { # HTTP request headers. |
| 241 | # |
| 242 | # This map contains the header field names and values. |
| 243 | # Headers can be set when the |
| 244 | # task is created. |
| 245 | # |
| 246 | # These headers represent a subset of the headers that will accompany the |
| 247 | # task's HTTP request. Some HTTP request headers will be ignored or replaced. |
| 248 | # |
| 249 | # A partial list of headers that will be ignored or replaced is: |
| 250 | # |
| 251 | # * Host: This will be computed by Cloud Tasks and derived from |
| 252 | # HttpRequest.url. |
| 253 | # * Content-Length: This will be computed by Cloud Tasks. |
| 254 | # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. |
| 255 | # * X-Google-*: Google use only. |
| 256 | # * X-AppEngine-*: Google use only. |
| 257 | # |
| 258 | # `Content-Type` won't be set by Cloud Tasks. You can explicitly set |
| 259 | # `Content-Type` to a media type when the |
| 260 | # task is created. |
| 261 | # For example, `Content-Type` can be set to `"application/octet-stream"` or |
| 262 | # `"application/json"`. |
| 263 | # |
| 264 | # Headers which can have multiple values (according to RFC2616) can be |
| 265 | # specified using comma-separated values. |
| 266 | # |
| 267 | # The size of the headers must be less than 80KB. |
| 268 | "a_key": "A String", |
| 269 | }, |
| 270 | "url": "A String", # Required. The full url path that the request will be sent to. |
| 271 | # |
| 272 | # This string must begin with either "http://" or "https://". Some examples |
| 273 | # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will |
| 274 | # encode some characters for safety and compatibility. The maximum allowed |
| 275 | # URL length is 2083 characters after encoding. |
| 276 | # |
| 277 | # The `Location` header response from a redirect response [`300` - `399`] |
| 278 | # may be followed. The redirect is not counted as a separate attempt. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 279 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 280 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 281 | # |
| 282 | # The task name. |
| 283 | # |
| 284 | # The task name must have the following format: |
| 285 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 286 | # |
| 287 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 288 | # hyphens (-), colons (:), or periods (.). |
| 289 | # For more information, see |
| 290 | # [Identifying |
| 291 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 292 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 293 | # The list of available locations can be obtained by calling |
| 294 | # ListLocations. |
| 295 | # For more information, see https://cloud.google.com/about/locations/. |
| 296 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 297 | # hyphens (-). The maximum length is 100 characters. |
| 298 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 299 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
| 300 | "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not |
| 301 | # respond by this deadline then the request is cancelled and the attempt |
| 302 | # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the |
| 303 | # task according to the RetryConfig. |
| 304 | # |
| 305 | # Note that when the request is cancelled, Cloud Tasks will stop listing for |
| 306 | # the response, but whether the worker stops processing depends on the |
| 307 | # worker. For example, if the worker is stuck, it may not react to cancelled |
| 308 | # requests. |
| 309 | # |
| 310 | # The default and maximum values depend on the type of request: |
| 311 | # |
| 312 | # * For HTTP tasks, the default is 10 minutes. The deadline |
| 313 | # must be in the interval [15 seconds, 30 minutes]. |
| 314 | # |
| 315 | # * For App Engine tasks, 0 indicates that the |
| 316 | # request has the default deadline. The default deadline depends on the |
| 317 | # [scaling |
| 318 | # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) |
| 319 | # of the service: 10 minutes for standard apps with automatic scaling, 24 |
| 320 | # hours for standard apps with manual and basic scaling, and 60 minutes for |
| 321 | # flex apps. If the request deadline is set, it must be in the interval [15 |
| 322 | # seconds, 24 hours 15 seconds]. Regardless of the task's |
| 323 | # `dispatch_deadline`, the app handler will not run for longer than than |
| 324 | # the service's timeout. We recommend setting the `dispatch_deadline` to |
| 325 | # at most a few seconds more than the app handler's timeout. For more |
| 326 | # information see |
| 327 | # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). |
| 328 | # |
| 329 | # `dispatch_deadline` will be truncated to the nearest millisecond. The |
| 330 | # deadline is an approximate deadline. |
| 331 | "dispatchCount": 42, # Output only. The number of attempts dispatched. |
| 332 | # |
| 333 | # This count includes attempts which have been dispatched but haven't |
| 334 | # received a response. |
| 335 | "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 336 | # |
| 337 | # Only dispatch_time will be set. |
| 338 | # The other Attempt information is not retained by Cloud Tasks. |
| 339 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 340 | # |
| 341 | # `schedule_time` will be truncated to the nearest microsecond. |
| 342 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 343 | # |
| 344 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 345 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 346 | # |
| 347 | # `response_time` will be truncated to the nearest microsecond. |
| 348 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. |
| 349 | # |
| 350 | # If `response_time` is unset, then the task has not been attempted or is |
| 351 | # currently running and the `response_status` field is meaningless. |
| 352 | # different programming environments, including REST APIs and RPC APIs. It is |
| 353 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 354 | # three pieces of data: error code, error message, and error details. |
| 355 | # |
| 356 | # You can find out more about this error model and how to work with it in the |
| 357 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 358 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 359 | # message types for APIs to use. |
| 360 | { |
| 361 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 362 | }, |
| 363 | ], |
| 364 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 365 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 366 | # user-facing error message should be localized and sent in the |
| 367 | # google.rpc.Status.details field, or localized by the client. |
| 368 | }, |
| 369 | }, |
| 370 | "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 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 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 375 | # |
| 376 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 377 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 378 | # |
| 379 | # `response_time` will be truncated to the nearest microsecond. |
| 380 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. |
| 381 | # |
| 382 | # If `response_time` is unset, then the task has not been attempted or is |
| 383 | # currently running and the `response_status` field is meaningless. |
| 384 | # different programming environments, including REST APIs and RPC APIs. It is |
| 385 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 386 | # three pieces of data: error code, error message, and error details. |
| 387 | # |
| 388 | # You can find out more about this error model and how to work with it in the |
| 389 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 390 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 391 | # message types for APIs to use. |
| 392 | { |
| 393 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 394 | }, |
| 395 | ], |
| 396 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 397 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 398 | # user-facing error message should be localized and sent in the |
| 399 | # google.rpc.Status.details field, or localized by the client. |
| 400 | }, |
| 401 | }, |
| 402 | "responseCount": 42, # Output only. The number of attempts which have received a response. |
| 403 | "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 404 | # |
| 405 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 406 | # |
| 407 | # The message defines the HTTP request that is sent to an App Engine app when |
| 408 | # the task is dispatched. |
| 409 | # |
| 410 | # Using AppEngineHttpRequest requires |
| 411 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 412 | # Google IAM permission for the project |
| 413 | # and the following scope: |
| 414 | # |
| 415 | # `https://www.googleapis.com/auth/cloud-platform` |
| 416 | # |
| 417 | # The task will be delivered to the App Engine app which belongs to the same |
| 418 | # project as the queue. For more information, see |
| 419 | # [How Requests are |
| 420 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 421 | # and how routing is affected by |
| 422 | # [dispatch |
| 423 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 424 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 425 | # Because this traffic is carried over a communication mechanism internal to |
| 426 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 427 | # The request to the handler, however, will appear to have used the HTTP |
| 428 | # protocol. |
| 429 | # |
| 430 | # The AppEngineRouting used to construct the URL that the task is |
| 431 | # delivered to can be set at the queue-level or task-level: |
| 432 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 433 | # * If app_engine_routing_override is set on the |
| 434 | # queue, this value is used for all |
| 435 | # tasks in the queue, no matter what the setting is for the task-level |
| 436 | # app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 437 | # |
| 438 | # |
| 439 | # The `url` that the task will be sent to is: |
| 440 | # |
| 441 | # * `url =` host `+` |
| 442 | # relative_uri |
| 443 | # |
| 444 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 445 | # URIs restricted with |
| 446 | # [`login: |
| 447 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 448 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 449 | # restricted with |
| 450 | # [`login: |
| 451 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 452 | # Task dispatches also do not follow redirects. |
| 453 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 454 | # The task attempt has succeeded if the app's request handler returns an HTTP |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 455 | # response code in the range [`200` - `299`]. The task attempt has failed if |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 456 | # the app's handler returns a non-2xx response code or Cloud Tasks does |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 457 | # not receive response before the deadline. Failed |
| 458 | # tasks will be retried according to the |
| 459 | # retry configuration. `503` (Service Unavailable) is |
| 460 | # considered an App Engine system error instead of an application error and |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 461 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 462 | # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 463 | # Requests) response from an app handler does not cause traffic congestion |
| 464 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 465 | "relativeUri": "A String", # The relative URI. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 466 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 467 | # The relative URI must begin with "/" and must be a valid HTTP relative URI. |
| 468 | # It can contain a path and query string arguments. |
| 469 | # If the relative URI is empty, then the root path "/" will be used. |
| 470 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 471 | "headers": { # HTTP request headers. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 472 | # |
| 473 | # This map contains the header field names and values. |
| 474 | # Headers can be set when the |
| 475 | # task is created. |
| 476 | # Repeated headers are not supported but a header value can contain commas. |
| 477 | # |
| 478 | # Cloud Tasks sets some headers to default values: |
| 479 | # |
| 480 | # * `User-Agent`: By default, this header is |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 481 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 482 | # This header can be modified, but Cloud Tasks will append |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 483 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 484 | # modified `User-Agent`. |
| 485 | # |
| 486 | # If the task has a body, Cloud |
| 487 | # Tasks sets the following headers: |
| 488 | # |
| 489 | # * `Content-Type`: By default, the `Content-Type` header is set to |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 490 | # `"application/octet-stream"`. The default can be overridden by explicitly |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 491 | # setting `Content-Type` to a particular media type when the |
| 492 | # task is created. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 493 | # For example, `Content-Type` can be set to `"application/json"`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 494 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 495 | # output only. It cannot be changed. |
| 496 | # |
| 497 | # The headers below cannot be set or overridden: |
| 498 | # |
| 499 | # * `Host` |
| 500 | # * `X-Google-*` |
| 501 | # * `X-AppEngine-*` |
| 502 | # |
| 503 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 504 | # such as headers containing information about the task; see |
| 505 | # [request |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 506 | # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 507 | # These headers are set only when the task is dispatched, so they are not |
| 508 | # visible when the task is returned in a Cloud Tasks response. |
| 509 | # |
| 510 | # Although there is no specific limit for the maximum number of headers or |
| 511 | # the size, there is a limit on the maximum size of the Task. For more |
| 512 | # information, see the CreateTask documentation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 513 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 514 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 515 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 516 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 517 | # * If app_engine_routing_override is set on the |
| 518 | # queue, this value is used for all |
| 519 | # tasks in the queue, no matter what the setting is for the task-level |
| 520 | # app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 521 | # |
| 522 | # Defines routing characteristics specific to App Engine - service, version, |
| 523 | # and instance. |
| 524 | # |
| 525 | # For more information about services, versions, and instances see |
| 526 | # [An Overview of App |
| 527 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 528 | # [Microservices Architecture on Google App |
| 529 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 530 | # [App Engine Standard request |
| 531 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 532 | # and [App Engine Flex request |
| 533 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 534 | # |
| 535 | # Using AppEngineRouting requires |
| 536 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 537 | # Google IAM permission for the project |
| 538 | # and the following scope: |
| 539 | # |
| 540 | # `https://www.googleapis.com/auth/cloud-platform` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 541 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 542 | # |
| 543 | # By default, the task is sent to the service which is the default |
| 544 | # service when the task is attempted. |
| 545 | # |
| 546 | # For some queues or tasks which were created using the App Engine |
| 547 | # Task Queue API, host is not parsable |
| 548 | # into service, |
| 549 | # version, and |
| 550 | # instance. For example, some tasks |
| 551 | # which were created using the App Engine SDK use a custom domain |
| 552 | # name; custom domains are not parsed by Cloud Tasks. If |
| 553 | # host is not parsable, then |
| 554 | # service, |
| 555 | # version, and |
| 556 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 557 | "instance": "A String", # App instance. |
| 558 | # |
| 559 | # By default, the task is sent to an instance which is available when |
| 560 | # the task is attempted. |
| 561 | # |
| 562 | # Requests can only be sent to a specific instance if |
| 563 | # [manual scaling is used in App Engine |
| 564 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 565 | # App Engine Flex does not support instances. For more information, see |
| 566 | # [App Engine Standard request |
| 567 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 568 | # and [App Engine Flex request |
| 569 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
| 570 | "version": "A String", # App version. |
| 571 | # |
| 572 | # By default, the task is sent to the version which is the default |
| 573 | # version when the task is attempted. |
| 574 | # |
| 575 | # For some queues or tasks which were created using the App Engine |
| 576 | # Task Queue API, host is not parsable |
| 577 | # into service, |
| 578 | # version, and |
| 579 | # instance. For example, some tasks |
| 580 | # which were created using the App Engine SDK use a custom domain |
| 581 | # name; custom domains are not parsed by Cloud Tasks. If |
| 582 | # host is not parsable, then |
| 583 | # service, |
| 584 | # version, and |
| 585 | # instance are the empty string. |
| 586 | "host": "A String", # Output only. The host that the task is sent to. |
| 587 | # |
| 588 | # The host is constructed from the domain name of the app associated with |
| 589 | # the queue's project ID (for example <app-id>.appspot.com), and the |
| 590 | # service, version, |
| 591 | # and instance. Tasks which were created using |
| 592 | # the App Engine SDK might have a custom domain name. |
| 593 | # |
| 594 | # For more information, see |
| 595 | # [How Requests are |
| 596 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 597 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 598 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 599 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 600 | # The app's request handler for the task's target URL must be able to handle |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 601 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 602 | # error code 405 (Method Not Allowed). See [Writing a push task request |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 603 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 604 | # and the App Engine documentation for your runtime on [How Requests are |
| 605 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 606 | "body": "A String", # HTTP request body. |
| 607 | # |
| 608 | # A request body is allowed only if the HTTP method is POST or PUT. It is |
| 609 | # an error to set a body on a task with an incompatible HttpMethod. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 610 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 611 | "view": "A String", # Output only. The view specifies which subset of the Task has |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 612 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 613 | }, |
| 614 | } |
| 615 | |
| 616 | x__xgafv: string, V1 error format. |
| 617 | Allowed values |
| 618 | 1 - v1 error format |
| 619 | 2 - v2 error format |
| 620 | |
| 621 | Returns: |
| 622 | An object of the form: |
| 623 | |
| 624 | { # A unit of scheduled work. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 625 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted or retried. |
| 626 | # |
| 627 | # `schedule_time` will be truncated to the nearest microsecond. |
| 628 | "createTime": "A String", # Output only. The time that the task was created. |
| 629 | # |
| 630 | # `create_time` will be truncated to the nearest second. |
| 631 | "httpRequest": { # HTTP request. # HTTP request that is sent to the worker. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 632 | # |
| 633 | # An HTTP task is a task that has HttpRequest set. |
| 634 | # |
| 635 | # The task will be pushed to the worker as an HTTP request. If the worker |
| 636 | # or the redirected worker acknowledges the task by returning a successful HTTP |
| 637 | # response code ([`200` - `299`]), the task will be removed from the queue. If |
| 638 | # any other HTTP response code is returned or no response is received, the |
| 639 | # task will be retried according to the following: |
| 640 | # |
| 641 | # * User-specified throttling: retry configuration, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 642 | # rate limits, and the queue's state. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 643 | # |
| 644 | # * System throttling: To prevent the worker from overloading, Cloud Tasks may |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 645 | # temporarily reduce the queue's effective rate. User-specified settings |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 646 | # will not be changed. |
| 647 | # |
| 648 | # System throttling happens because: |
| 649 | # |
| 650 | # * Cloud Tasks backs off on all errors. Normally the backoff specified in |
| 651 | # rate limits will be used. But if the worker returns |
| 652 | # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of |
| 653 | # errors is high, Cloud Tasks will use a higher backoff rate. The retry |
| 654 | # specified in the `Retry-After` HTTP response header is considered. |
| 655 | # |
| 656 | # * To prevent traffic spikes and to smooth sudden increases in traffic, |
| 657 | # dispatches ramp up slowly when the queue is newly created or idle and |
| 658 | # if large numbers of tasks suddenly become available to dispatch (due to |
| 659 | # spikes in create task rates, the queue being unpaused, or many tasks |
| 660 | # that are scheduled at the same time). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 661 | "oidcToken": { # Contains information needed for generating an # If specified, an |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 662 | # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) |
| 663 | # token will be generated and attached as an `Authorization` header in the |
| 664 | # HTTP request. |
| 665 | # |
| 666 | # This type of authorization can be used for many scenarios, including |
| 667 | # calling Cloud Run, or endpoints where you intend to validate the token |
| 668 | # yourself. |
| 669 | # [OpenID Connect |
| 670 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 671 | # This type of authorization can be used for many scenarios, including |
| 672 | # calling Cloud Run, or endpoints where you intend to validate the token |
| 673 | # yourself. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 674 | "audience": "A String", # Audience to be used when generating OIDC token. If not specified, the URI |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 675 | # specified in target will be used. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 676 | "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 677 | # to be used for generating OIDC token. |
| 678 | # The service account must be within the same project as the queue. The |
| 679 | # caller must have iam.serviceAccounts.actAs permission for the service |
| 680 | # account. |
| 681 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 682 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 683 | "body": "A String", # HTTP request body. |
| 684 | # |
| 685 | # A request body is allowed only if the |
| 686 | # HTTP method is POST, PUT, or PATCH. It is an |
| 687 | # error to set body on a task with an incompatible HttpMethod. |
| 688 | "oauthToken": { # Contains information needed for generating an # If specified, an |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 689 | # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) |
| 690 | # will be generated and attached as an `Authorization` header in the HTTP |
| 691 | # request. |
| 692 | # |
| 693 | # This type of authorization should generally only be used when calling |
| 694 | # Google APIs hosted on *.googleapis.com. |
| 695 | # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). |
| 696 | # This type of authorization should generally only be used when calling Google |
| 697 | # APIs hosted on *.googleapis.com. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 698 | "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 699 | # to be used for generating OAuth token. |
| 700 | # The service account must be within the same project as the queue. The |
| 701 | # caller must have iam.serviceAccounts.actAs permission for the service |
| 702 | # account. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 703 | "scope": "A String", # OAuth scope to be used for generating OAuth access token. |
| 704 | # If not specified, "https://www.googleapis.com/auth/cloud-platform" |
| 705 | # will be used. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 706 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 707 | "headers": { # HTTP request headers. |
| 708 | # |
| 709 | # This map contains the header field names and values. |
| 710 | # Headers can be set when the |
| 711 | # task is created. |
| 712 | # |
| 713 | # These headers represent a subset of the headers that will accompany the |
| 714 | # task's HTTP request. Some HTTP request headers will be ignored or replaced. |
| 715 | # |
| 716 | # A partial list of headers that will be ignored or replaced is: |
| 717 | # |
| 718 | # * Host: This will be computed by Cloud Tasks and derived from |
| 719 | # HttpRequest.url. |
| 720 | # * Content-Length: This will be computed by Cloud Tasks. |
| 721 | # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. |
| 722 | # * X-Google-*: Google use only. |
| 723 | # * X-AppEngine-*: Google use only. |
| 724 | # |
| 725 | # `Content-Type` won't be set by Cloud Tasks. You can explicitly set |
| 726 | # `Content-Type` to a media type when the |
| 727 | # task is created. |
| 728 | # For example, `Content-Type` can be set to `"application/octet-stream"` or |
| 729 | # `"application/json"`. |
| 730 | # |
| 731 | # Headers which can have multiple values (according to RFC2616) can be |
| 732 | # specified using comma-separated values. |
| 733 | # |
| 734 | # The size of the headers must be less than 80KB. |
| 735 | "a_key": "A String", |
| 736 | }, |
| 737 | "url": "A String", # Required. The full url path that the request will be sent to. |
| 738 | # |
| 739 | # This string must begin with either "http://" or "https://". Some examples |
| 740 | # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will |
| 741 | # encode some characters for safety and compatibility. The maximum allowed |
| 742 | # URL length is 2083 characters after encoding. |
| 743 | # |
| 744 | # The `Location` header response from a redirect response [`300` - `399`] |
| 745 | # may be followed. The redirect is not counted as a separate attempt. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 746 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 747 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 748 | # |
| 749 | # The task name. |
| 750 | # |
| 751 | # The task name must have the following format: |
| 752 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 753 | # |
| 754 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 755 | # hyphens (-), colons (:), or periods (.). |
| 756 | # For more information, see |
| 757 | # [Identifying |
| 758 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 759 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 760 | # The list of available locations can be obtained by calling |
| 761 | # ListLocations. |
| 762 | # For more information, see https://cloud.google.com/about/locations/. |
| 763 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 764 | # hyphens (-). The maximum length is 100 characters. |
| 765 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 766 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
| 767 | "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not |
| 768 | # respond by this deadline then the request is cancelled and the attempt |
| 769 | # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the |
| 770 | # task according to the RetryConfig. |
| 771 | # |
| 772 | # Note that when the request is cancelled, Cloud Tasks will stop listing for |
| 773 | # the response, but whether the worker stops processing depends on the |
| 774 | # worker. For example, if the worker is stuck, it may not react to cancelled |
| 775 | # requests. |
| 776 | # |
| 777 | # The default and maximum values depend on the type of request: |
| 778 | # |
| 779 | # * For HTTP tasks, the default is 10 minutes. The deadline |
| 780 | # must be in the interval [15 seconds, 30 minutes]. |
| 781 | # |
| 782 | # * For App Engine tasks, 0 indicates that the |
| 783 | # request has the default deadline. The default deadline depends on the |
| 784 | # [scaling |
| 785 | # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) |
| 786 | # of the service: 10 minutes for standard apps with automatic scaling, 24 |
| 787 | # hours for standard apps with manual and basic scaling, and 60 minutes for |
| 788 | # flex apps. If the request deadline is set, it must be in the interval [15 |
| 789 | # seconds, 24 hours 15 seconds]. Regardless of the task's |
| 790 | # `dispatch_deadline`, the app handler will not run for longer than than |
| 791 | # the service's timeout. We recommend setting the `dispatch_deadline` to |
| 792 | # at most a few seconds more than the app handler's timeout. For more |
| 793 | # information see |
| 794 | # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). |
| 795 | # |
| 796 | # `dispatch_deadline` will be truncated to the nearest millisecond. The |
| 797 | # deadline is an approximate deadline. |
| 798 | "dispatchCount": 42, # Output only. The number of attempts dispatched. |
| 799 | # |
| 800 | # This count includes attempts which have been dispatched but haven't |
| 801 | # received a response. |
| 802 | "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 803 | # |
| 804 | # Only dispatch_time will be set. |
| 805 | # The other Attempt information is not retained by Cloud Tasks. |
| 806 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 807 | # |
| 808 | # `schedule_time` will be truncated to the nearest microsecond. |
| 809 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 810 | # |
| 811 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 812 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 813 | # |
| 814 | # `response_time` will be truncated to the nearest microsecond. |
| 815 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. |
| 816 | # |
| 817 | # If `response_time` is unset, then the task has not been attempted or is |
| 818 | # currently running and the `response_status` field is meaningless. |
| 819 | # different programming environments, including REST APIs and RPC APIs. It is |
| 820 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 821 | # three pieces of data: error code, error message, and error details. |
| 822 | # |
| 823 | # You can find out more about this error model and how to work with it in the |
| 824 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 825 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 826 | # message types for APIs to use. |
| 827 | { |
| 828 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 829 | }, |
| 830 | ], |
| 831 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 832 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 833 | # user-facing error message should be localized and sent in the |
| 834 | # google.rpc.Status.details field, or localized by the client. |
| 835 | }, |
| 836 | }, |
| 837 | "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 838 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 839 | # |
| 840 | # `schedule_time` will be truncated to the nearest microsecond. |
| 841 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 842 | # |
| 843 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 844 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 845 | # |
| 846 | # `response_time` will be truncated to the nearest microsecond. |
| 847 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. |
| 848 | # |
| 849 | # If `response_time` is unset, then the task has not been attempted or is |
| 850 | # currently running and the `response_status` field is meaningless. |
| 851 | # different programming environments, including REST APIs and RPC APIs. It is |
| 852 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 853 | # three pieces of data: error code, error message, and error details. |
| 854 | # |
| 855 | # You can find out more about this error model and how to work with it in the |
| 856 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 857 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 858 | # message types for APIs to use. |
| 859 | { |
| 860 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 861 | }, |
| 862 | ], |
| 863 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 864 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 865 | # user-facing error message should be localized and sent in the |
| 866 | # google.rpc.Status.details field, or localized by the client. |
| 867 | }, |
| 868 | }, |
| 869 | "responseCount": 42, # Output only. The number of attempts which have received a response. |
| 870 | "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 871 | # |
| 872 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 873 | # |
| 874 | # The message defines the HTTP request that is sent to an App Engine app when |
| 875 | # the task is dispatched. |
| 876 | # |
| 877 | # Using AppEngineHttpRequest requires |
| 878 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 879 | # Google IAM permission for the project |
| 880 | # and the following scope: |
| 881 | # |
| 882 | # `https://www.googleapis.com/auth/cloud-platform` |
| 883 | # |
| 884 | # The task will be delivered to the App Engine app which belongs to the same |
| 885 | # project as the queue. For more information, see |
| 886 | # [How Requests are |
| 887 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 888 | # and how routing is affected by |
| 889 | # [dispatch |
| 890 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 891 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 892 | # Because this traffic is carried over a communication mechanism internal to |
| 893 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 894 | # The request to the handler, however, will appear to have used the HTTP |
| 895 | # protocol. |
| 896 | # |
| 897 | # The AppEngineRouting used to construct the URL that the task is |
| 898 | # delivered to can be set at the queue-level or task-level: |
| 899 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 900 | # * If app_engine_routing_override is set on the |
| 901 | # queue, this value is used for all |
| 902 | # tasks in the queue, no matter what the setting is for the task-level |
| 903 | # app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 904 | # |
| 905 | # |
| 906 | # The `url` that the task will be sent to is: |
| 907 | # |
| 908 | # * `url =` host `+` |
| 909 | # relative_uri |
| 910 | # |
| 911 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 912 | # URIs restricted with |
| 913 | # [`login: |
| 914 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 915 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 916 | # restricted with |
| 917 | # [`login: |
| 918 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 919 | # Task dispatches also do not follow redirects. |
| 920 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 921 | # The task attempt has succeeded if the app's request handler returns an HTTP |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 922 | # response code in the range [`200` - `299`]. The task attempt has failed if |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 923 | # the app's handler returns a non-2xx response code or Cloud Tasks does |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 924 | # not receive response before the deadline. Failed |
| 925 | # tasks will be retried according to the |
| 926 | # retry configuration. `503` (Service Unavailable) is |
| 927 | # considered an App Engine system error instead of an application error and |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 928 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 929 | # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 930 | # Requests) response from an app handler does not cause traffic congestion |
| 931 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 932 | "relativeUri": "A String", # The relative URI. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 933 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 934 | # The relative URI must begin with "/" and must be a valid HTTP relative URI. |
| 935 | # It can contain a path and query string arguments. |
| 936 | # If the relative URI is empty, then the root path "/" will be used. |
| 937 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 938 | "headers": { # HTTP request headers. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 939 | # |
| 940 | # This map contains the header field names and values. |
| 941 | # Headers can be set when the |
| 942 | # task is created. |
| 943 | # Repeated headers are not supported but a header value can contain commas. |
| 944 | # |
| 945 | # Cloud Tasks sets some headers to default values: |
| 946 | # |
| 947 | # * `User-Agent`: By default, this header is |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 948 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 949 | # This header can be modified, but Cloud Tasks will append |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 950 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 951 | # modified `User-Agent`. |
| 952 | # |
| 953 | # If the task has a body, Cloud |
| 954 | # Tasks sets the following headers: |
| 955 | # |
| 956 | # * `Content-Type`: By default, the `Content-Type` header is set to |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 957 | # `"application/octet-stream"`. The default can be overridden by explicitly |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 958 | # setting `Content-Type` to a particular media type when the |
| 959 | # task is created. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 960 | # For example, `Content-Type` can be set to `"application/json"`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 961 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 962 | # output only. It cannot be changed. |
| 963 | # |
| 964 | # The headers below cannot be set or overridden: |
| 965 | # |
| 966 | # * `Host` |
| 967 | # * `X-Google-*` |
| 968 | # * `X-AppEngine-*` |
| 969 | # |
| 970 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 971 | # such as headers containing information about the task; see |
| 972 | # [request |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 973 | # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 974 | # These headers are set only when the task is dispatched, so they are not |
| 975 | # visible when the task is returned in a Cloud Tasks response. |
| 976 | # |
| 977 | # Although there is no specific limit for the maximum number of headers or |
| 978 | # the size, there is a limit on the maximum size of the Task. For more |
| 979 | # information, see the CreateTask documentation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 980 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 981 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 982 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 983 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 984 | # * If app_engine_routing_override is set on the |
| 985 | # queue, this value is used for all |
| 986 | # tasks in the queue, no matter what the setting is for the task-level |
| 987 | # app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 988 | # |
| 989 | # Defines routing characteristics specific to App Engine - service, version, |
| 990 | # and instance. |
| 991 | # |
| 992 | # For more information about services, versions, and instances see |
| 993 | # [An Overview of App |
| 994 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 995 | # [Microservices Architecture on Google App |
| 996 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 997 | # [App Engine Standard request |
| 998 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 999 | # and [App Engine Flex request |
| 1000 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1001 | # |
| 1002 | # Using AppEngineRouting requires |
| 1003 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 1004 | # Google IAM permission for the project |
| 1005 | # and the following scope: |
| 1006 | # |
| 1007 | # `https://www.googleapis.com/auth/cloud-platform` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1008 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1009 | # |
| 1010 | # By default, the task is sent to the service which is the default |
| 1011 | # service when the task is attempted. |
| 1012 | # |
| 1013 | # For some queues or tasks which were created using the App Engine |
| 1014 | # Task Queue API, host is not parsable |
| 1015 | # into service, |
| 1016 | # version, and |
| 1017 | # instance. For example, some tasks |
| 1018 | # which were created using the App Engine SDK use a custom domain |
| 1019 | # name; custom domains are not parsed by Cloud Tasks. If |
| 1020 | # host is not parsable, then |
| 1021 | # service, |
| 1022 | # version, and |
| 1023 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1024 | "instance": "A String", # App instance. |
| 1025 | # |
| 1026 | # By default, the task is sent to an instance which is available when |
| 1027 | # the task is attempted. |
| 1028 | # |
| 1029 | # Requests can only be sent to a specific instance if |
| 1030 | # [manual scaling is used in App Engine |
| 1031 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 1032 | # App Engine Flex does not support instances. For more information, see |
| 1033 | # [App Engine Standard request |
| 1034 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 1035 | # and [App Engine Flex request |
| 1036 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
| 1037 | "version": "A String", # App version. |
| 1038 | # |
| 1039 | # By default, the task is sent to the version which is the default |
| 1040 | # version when the task is attempted. |
| 1041 | # |
| 1042 | # For some queues or tasks which were created using the App Engine |
| 1043 | # Task Queue API, host is not parsable |
| 1044 | # into service, |
| 1045 | # version, and |
| 1046 | # instance. For example, some tasks |
| 1047 | # which were created using the App Engine SDK use a custom domain |
| 1048 | # name; custom domains are not parsed by Cloud Tasks. If |
| 1049 | # host is not parsable, then |
| 1050 | # service, |
| 1051 | # version, and |
| 1052 | # instance are the empty string. |
| 1053 | "host": "A String", # Output only. The host that the task is sent to. |
| 1054 | # |
| 1055 | # The host is constructed from the domain name of the app associated with |
| 1056 | # the queue's project ID (for example <app-id>.appspot.com), and the |
| 1057 | # service, version, |
| 1058 | # and instance. Tasks which were created using |
| 1059 | # the App Engine SDK might have a custom domain name. |
| 1060 | # |
| 1061 | # For more information, see |
| 1062 | # [How Requests are |
| 1063 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1064 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1065 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1066 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1067 | # The app's request handler for the task's target URL must be able to handle |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1068 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 1069 | # error code 405 (Method Not Allowed). See [Writing a push task request |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1070 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1071 | # and the App Engine documentation for your runtime on [How Requests are |
| 1072 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1073 | "body": "A String", # HTTP request body. |
| 1074 | # |
| 1075 | # A request body is allowed only if the HTTP method is POST or PUT. It is |
| 1076 | # an error to set a body on a task with an incompatible HttpMethod. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1077 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1078 | "view": "A String", # Output only. The view specifies which subset of the Task has |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1079 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1080 | }</pre> |
| 1081 | </div> |
| 1082 | |
| 1083 | <div class="method"> |
| 1084 | <code class="details" id="delete">delete(name, x__xgafv=None)</code> |
| 1085 | <pre>Deletes a task. |
| 1086 | |
| 1087 | A task can be deleted if it is scheduled or dispatched. A task |
| 1088 | cannot be deleted if it has executed successfully or permanently |
| 1089 | failed. |
| 1090 | |
| 1091 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1092 | name: string, Required. The task name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1093 | `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required) |
| 1094 | x__xgafv: string, V1 error format. |
| 1095 | Allowed values |
| 1096 | 1 - v1 error format |
| 1097 | 2 - v2 error format |
| 1098 | |
| 1099 | Returns: |
| 1100 | An object of the form: |
| 1101 | |
| 1102 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 1103 | # empty messages in your APIs. A typical example is to use it as the request |
| 1104 | # or the response type of an API method. For instance: |
| 1105 | # |
| 1106 | # service Foo { |
| 1107 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 1108 | # } |
| 1109 | # |
| 1110 | # The JSON representation for `Empty` is empty JSON object `{}`. |
| 1111 | }</pre> |
| 1112 | </div> |
| 1113 | |
| 1114 | <div class="method"> |
| 1115 | <code class="details" id="get">get(name, responseView=None, x__xgafv=None)</code> |
| 1116 | <pre>Gets a task. |
| 1117 | |
| 1118 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1119 | name: string, Required. The task name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1120 | `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required) |
| 1121 | responseView: string, The response_view specifies which subset of the Task will be |
| 1122 | returned. |
| 1123 | |
| 1124 | By default response_view is BASIC; not all |
| 1125 | information is retrieved by default because some data, such as |
| 1126 | payloads, might be desirable to return only when needed because |
| 1127 | of its large size or because of the sensitivity of data that it |
| 1128 | contains. |
| 1129 | |
| 1130 | Authorization for FULL requires |
| 1131 | `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) |
| 1132 | permission on the Task resource. |
| 1133 | x__xgafv: string, V1 error format. |
| 1134 | Allowed values |
| 1135 | 1 - v1 error format |
| 1136 | 2 - v2 error format |
| 1137 | |
| 1138 | Returns: |
| 1139 | An object of the form: |
| 1140 | |
| 1141 | { # A unit of scheduled work. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1142 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted or retried. |
| 1143 | # |
| 1144 | # `schedule_time` will be truncated to the nearest microsecond. |
| 1145 | "createTime": "A String", # Output only. The time that the task was created. |
| 1146 | # |
| 1147 | # `create_time` will be truncated to the nearest second. |
| 1148 | "httpRequest": { # HTTP request. # HTTP request that is sent to the worker. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1149 | # |
| 1150 | # An HTTP task is a task that has HttpRequest set. |
| 1151 | # |
| 1152 | # The task will be pushed to the worker as an HTTP request. If the worker |
| 1153 | # or the redirected worker acknowledges the task by returning a successful HTTP |
| 1154 | # response code ([`200` - `299`]), the task will be removed from the queue. If |
| 1155 | # any other HTTP response code is returned or no response is received, the |
| 1156 | # task will be retried according to the following: |
| 1157 | # |
| 1158 | # * User-specified throttling: retry configuration, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1159 | # rate limits, and the queue's state. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1160 | # |
| 1161 | # * System throttling: To prevent the worker from overloading, Cloud Tasks may |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1162 | # temporarily reduce the queue's effective rate. User-specified settings |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1163 | # will not be changed. |
| 1164 | # |
| 1165 | # System throttling happens because: |
| 1166 | # |
| 1167 | # * Cloud Tasks backs off on all errors. Normally the backoff specified in |
| 1168 | # rate limits will be used. But if the worker returns |
| 1169 | # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of |
| 1170 | # errors is high, Cloud Tasks will use a higher backoff rate. The retry |
| 1171 | # specified in the `Retry-After` HTTP response header is considered. |
| 1172 | # |
| 1173 | # * To prevent traffic spikes and to smooth sudden increases in traffic, |
| 1174 | # dispatches ramp up slowly when the queue is newly created or idle and |
| 1175 | # if large numbers of tasks suddenly become available to dispatch (due to |
| 1176 | # spikes in create task rates, the queue being unpaused, or many tasks |
| 1177 | # that are scheduled at the same time). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1178 | "oidcToken": { # Contains information needed for generating an # If specified, an |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1179 | # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) |
| 1180 | # token will be generated and attached as an `Authorization` header in the |
| 1181 | # HTTP request. |
| 1182 | # |
| 1183 | # This type of authorization can be used for many scenarios, including |
| 1184 | # calling Cloud Run, or endpoints where you intend to validate the token |
| 1185 | # yourself. |
| 1186 | # [OpenID Connect |
| 1187 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 1188 | # This type of authorization can be used for many scenarios, including |
| 1189 | # calling Cloud Run, or endpoints where you intend to validate the token |
| 1190 | # yourself. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1191 | "audience": "A String", # Audience to be used when generating OIDC token. If not specified, the URI |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1192 | # specified in target will be used. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1193 | "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1194 | # to be used for generating OIDC token. |
| 1195 | # The service account must be within the same project as the queue. The |
| 1196 | # caller must have iam.serviceAccounts.actAs permission for the service |
| 1197 | # account. |
| 1198 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1199 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 1200 | "body": "A String", # HTTP request body. |
| 1201 | # |
| 1202 | # A request body is allowed only if the |
| 1203 | # HTTP method is POST, PUT, or PATCH. It is an |
| 1204 | # error to set body on a task with an incompatible HttpMethod. |
| 1205 | "oauthToken": { # Contains information needed for generating an # If specified, an |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1206 | # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) |
| 1207 | # will be generated and attached as an `Authorization` header in the HTTP |
| 1208 | # request. |
| 1209 | # |
| 1210 | # This type of authorization should generally only be used when calling |
| 1211 | # Google APIs hosted on *.googleapis.com. |
| 1212 | # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). |
| 1213 | # This type of authorization should generally only be used when calling Google |
| 1214 | # APIs hosted on *.googleapis.com. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1215 | "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1216 | # to be used for generating OAuth token. |
| 1217 | # The service account must be within the same project as the queue. The |
| 1218 | # caller must have iam.serviceAccounts.actAs permission for the service |
| 1219 | # account. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1220 | "scope": "A String", # OAuth scope to be used for generating OAuth access token. |
| 1221 | # If not specified, "https://www.googleapis.com/auth/cloud-platform" |
| 1222 | # will be used. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1223 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1224 | "headers": { # HTTP request headers. |
| 1225 | # |
| 1226 | # This map contains the header field names and values. |
| 1227 | # Headers can be set when the |
| 1228 | # task is created. |
| 1229 | # |
| 1230 | # These headers represent a subset of the headers that will accompany the |
| 1231 | # task's HTTP request. Some HTTP request headers will be ignored or replaced. |
| 1232 | # |
| 1233 | # A partial list of headers that will be ignored or replaced is: |
| 1234 | # |
| 1235 | # * Host: This will be computed by Cloud Tasks and derived from |
| 1236 | # HttpRequest.url. |
| 1237 | # * Content-Length: This will be computed by Cloud Tasks. |
| 1238 | # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. |
| 1239 | # * X-Google-*: Google use only. |
| 1240 | # * X-AppEngine-*: Google use only. |
| 1241 | # |
| 1242 | # `Content-Type` won't be set by Cloud Tasks. You can explicitly set |
| 1243 | # `Content-Type` to a media type when the |
| 1244 | # task is created. |
| 1245 | # For example, `Content-Type` can be set to `"application/octet-stream"` or |
| 1246 | # `"application/json"`. |
| 1247 | # |
| 1248 | # Headers which can have multiple values (according to RFC2616) can be |
| 1249 | # specified using comma-separated values. |
| 1250 | # |
| 1251 | # The size of the headers must be less than 80KB. |
| 1252 | "a_key": "A String", |
| 1253 | }, |
| 1254 | "url": "A String", # Required. The full url path that the request will be sent to. |
| 1255 | # |
| 1256 | # This string must begin with either "http://" or "https://". Some examples |
| 1257 | # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will |
| 1258 | # encode some characters for safety and compatibility. The maximum allowed |
| 1259 | # URL length is 2083 characters after encoding. |
| 1260 | # |
| 1261 | # The `Location` header response from a redirect response [`300` - `399`] |
| 1262 | # may be followed. The redirect is not counted as a separate attempt. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1263 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1264 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 1265 | # |
| 1266 | # The task name. |
| 1267 | # |
| 1268 | # The task name must have the following format: |
| 1269 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 1270 | # |
| 1271 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 1272 | # hyphens (-), colons (:), or periods (.). |
| 1273 | # For more information, see |
| 1274 | # [Identifying |
| 1275 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 1276 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 1277 | # The list of available locations can be obtained by calling |
| 1278 | # ListLocations. |
| 1279 | # For more information, see https://cloud.google.com/about/locations/. |
| 1280 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 1281 | # hyphens (-). The maximum length is 100 characters. |
| 1282 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 1283 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
| 1284 | "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not |
| 1285 | # respond by this deadline then the request is cancelled and the attempt |
| 1286 | # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the |
| 1287 | # task according to the RetryConfig. |
| 1288 | # |
| 1289 | # Note that when the request is cancelled, Cloud Tasks will stop listing for |
| 1290 | # the response, but whether the worker stops processing depends on the |
| 1291 | # worker. For example, if the worker is stuck, it may not react to cancelled |
| 1292 | # requests. |
| 1293 | # |
| 1294 | # The default and maximum values depend on the type of request: |
| 1295 | # |
| 1296 | # * For HTTP tasks, the default is 10 minutes. The deadline |
| 1297 | # must be in the interval [15 seconds, 30 minutes]. |
| 1298 | # |
| 1299 | # * For App Engine tasks, 0 indicates that the |
| 1300 | # request has the default deadline. The default deadline depends on the |
| 1301 | # [scaling |
| 1302 | # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) |
| 1303 | # of the service: 10 minutes for standard apps with automatic scaling, 24 |
| 1304 | # hours for standard apps with manual and basic scaling, and 60 minutes for |
| 1305 | # flex apps. If the request deadline is set, it must be in the interval [15 |
| 1306 | # seconds, 24 hours 15 seconds]. Regardless of the task's |
| 1307 | # `dispatch_deadline`, the app handler will not run for longer than than |
| 1308 | # the service's timeout. We recommend setting the `dispatch_deadline` to |
| 1309 | # at most a few seconds more than the app handler's timeout. For more |
| 1310 | # information see |
| 1311 | # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). |
| 1312 | # |
| 1313 | # `dispatch_deadline` will be truncated to the nearest millisecond. The |
| 1314 | # deadline is an approximate deadline. |
| 1315 | "dispatchCount": 42, # Output only. The number of attempts dispatched. |
| 1316 | # |
| 1317 | # This count includes attempts which have been dispatched but haven't |
| 1318 | # received a response. |
| 1319 | "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 1320 | # |
| 1321 | # Only dispatch_time will be set. |
| 1322 | # The other Attempt information is not retained by Cloud Tasks. |
| 1323 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 1324 | # |
| 1325 | # `schedule_time` will be truncated to the nearest microsecond. |
| 1326 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 1327 | # |
| 1328 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 1329 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 1330 | # |
| 1331 | # `response_time` will be truncated to the nearest microsecond. |
| 1332 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. |
| 1333 | # |
| 1334 | # If `response_time` is unset, then the task has not been attempted or is |
| 1335 | # currently running and the `response_status` field is meaningless. |
| 1336 | # different programming environments, including REST APIs and RPC APIs. It is |
| 1337 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 1338 | # three pieces of data: error code, error message, and error details. |
| 1339 | # |
| 1340 | # You can find out more about this error model and how to work with it in the |
| 1341 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 1342 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 1343 | # message types for APIs to use. |
| 1344 | { |
| 1345 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 1346 | }, |
| 1347 | ], |
| 1348 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 1349 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 1350 | # user-facing error message should be localized and sent in the |
| 1351 | # google.rpc.Status.details field, or localized by the client. |
| 1352 | }, |
| 1353 | }, |
| 1354 | "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 1355 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 1356 | # |
| 1357 | # `schedule_time` will be truncated to the nearest microsecond. |
| 1358 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 1359 | # |
| 1360 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 1361 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 1362 | # |
| 1363 | # `response_time` will be truncated to the nearest microsecond. |
| 1364 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. |
| 1365 | # |
| 1366 | # If `response_time` is unset, then the task has not been attempted or is |
| 1367 | # currently running and the `response_status` field is meaningless. |
| 1368 | # different programming environments, including REST APIs and RPC APIs. It is |
| 1369 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 1370 | # three pieces of data: error code, error message, and error details. |
| 1371 | # |
| 1372 | # You can find out more about this error model and how to work with it in the |
| 1373 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 1374 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 1375 | # message types for APIs to use. |
| 1376 | { |
| 1377 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 1378 | }, |
| 1379 | ], |
| 1380 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 1381 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 1382 | # user-facing error message should be localized and sent in the |
| 1383 | # google.rpc.Status.details field, or localized by the client. |
| 1384 | }, |
| 1385 | }, |
| 1386 | "responseCount": 42, # Output only. The number of attempts which have received a response. |
| 1387 | "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1388 | # |
| 1389 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 1390 | # |
| 1391 | # The message defines the HTTP request that is sent to an App Engine app when |
| 1392 | # the task is dispatched. |
| 1393 | # |
| 1394 | # Using AppEngineHttpRequest requires |
| 1395 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 1396 | # Google IAM permission for the project |
| 1397 | # and the following scope: |
| 1398 | # |
| 1399 | # `https://www.googleapis.com/auth/cloud-platform` |
| 1400 | # |
| 1401 | # The task will be delivered to the App Engine app which belongs to the same |
| 1402 | # project as the queue. For more information, see |
| 1403 | # [How Requests are |
| 1404 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 1405 | # and how routing is affected by |
| 1406 | # [dispatch |
| 1407 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 1408 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 1409 | # Because this traffic is carried over a communication mechanism internal to |
| 1410 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 1411 | # The request to the handler, however, will appear to have used the HTTP |
| 1412 | # protocol. |
| 1413 | # |
| 1414 | # The AppEngineRouting used to construct the URL that the task is |
| 1415 | # delivered to can be set at the queue-level or task-level: |
| 1416 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1417 | # * If app_engine_routing_override is set on the |
| 1418 | # queue, this value is used for all |
| 1419 | # tasks in the queue, no matter what the setting is for the task-level |
| 1420 | # app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1421 | # |
| 1422 | # |
| 1423 | # The `url` that the task will be sent to is: |
| 1424 | # |
| 1425 | # * `url =` host `+` |
| 1426 | # relative_uri |
| 1427 | # |
| 1428 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 1429 | # URIs restricted with |
| 1430 | # [`login: |
| 1431 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 1432 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 1433 | # restricted with |
| 1434 | # [`login: |
| 1435 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 1436 | # Task dispatches also do not follow redirects. |
| 1437 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1438 | # The task attempt has succeeded if the app's request handler returns an HTTP |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1439 | # response code in the range [`200` - `299`]. The task attempt has failed if |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1440 | # the app's handler returns a non-2xx response code or Cloud Tasks does |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1441 | # not receive response before the deadline. Failed |
| 1442 | # tasks will be retried according to the |
| 1443 | # retry configuration. `503` (Service Unavailable) is |
| 1444 | # considered an App Engine system error instead of an application error and |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1445 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 1446 | # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1447 | # Requests) response from an app handler does not cause traffic congestion |
| 1448 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1449 | "relativeUri": "A String", # The relative URI. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1450 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1451 | # The relative URI must begin with "/" and must be a valid HTTP relative URI. |
| 1452 | # It can contain a path and query string arguments. |
| 1453 | # If the relative URI is empty, then the root path "/" will be used. |
| 1454 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 1455 | "headers": { # HTTP request headers. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1456 | # |
| 1457 | # This map contains the header field names and values. |
| 1458 | # Headers can be set when the |
| 1459 | # task is created. |
| 1460 | # Repeated headers are not supported but a header value can contain commas. |
| 1461 | # |
| 1462 | # Cloud Tasks sets some headers to default values: |
| 1463 | # |
| 1464 | # * `User-Agent`: By default, this header is |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1465 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1466 | # This header can be modified, but Cloud Tasks will append |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1467 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1468 | # modified `User-Agent`. |
| 1469 | # |
| 1470 | # If the task has a body, Cloud |
| 1471 | # Tasks sets the following headers: |
| 1472 | # |
| 1473 | # * `Content-Type`: By default, the `Content-Type` header is set to |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1474 | # `"application/octet-stream"`. The default can be overridden by explicitly |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1475 | # setting `Content-Type` to a particular media type when the |
| 1476 | # task is created. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1477 | # For example, `Content-Type` can be set to `"application/json"`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1478 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 1479 | # output only. It cannot be changed. |
| 1480 | # |
| 1481 | # The headers below cannot be set or overridden: |
| 1482 | # |
| 1483 | # * `Host` |
| 1484 | # * `X-Google-*` |
| 1485 | # * `X-AppEngine-*` |
| 1486 | # |
| 1487 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 1488 | # such as headers containing information about the task; see |
| 1489 | # [request |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1490 | # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1491 | # These headers are set only when the task is dispatched, so they are not |
| 1492 | # visible when the task is returned in a Cloud Tasks response. |
| 1493 | # |
| 1494 | # Although there is no specific limit for the maximum number of headers or |
| 1495 | # the size, there is a limit on the maximum size of the Task. For more |
| 1496 | # information, see the CreateTask documentation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1497 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1498 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1499 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1500 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1501 | # * If app_engine_routing_override is set on the |
| 1502 | # queue, this value is used for all |
| 1503 | # tasks in the queue, no matter what the setting is for the task-level |
| 1504 | # app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1505 | # |
| 1506 | # Defines routing characteristics specific to App Engine - service, version, |
| 1507 | # and instance. |
| 1508 | # |
| 1509 | # For more information about services, versions, and instances see |
| 1510 | # [An Overview of App |
| 1511 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 1512 | # [Microservices Architecture on Google App |
| 1513 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 1514 | # [App Engine Standard request |
| 1515 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 1516 | # and [App Engine Flex request |
| 1517 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1518 | # |
| 1519 | # Using AppEngineRouting requires |
| 1520 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 1521 | # Google IAM permission for the project |
| 1522 | # and the following scope: |
| 1523 | # |
| 1524 | # `https://www.googleapis.com/auth/cloud-platform` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1525 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1526 | # |
| 1527 | # By default, the task is sent to the service which is the default |
| 1528 | # service when the task is attempted. |
| 1529 | # |
| 1530 | # For some queues or tasks which were created using the App Engine |
| 1531 | # Task Queue API, host is not parsable |
| 1532 | # into service, |
| 1533 | # version, and |
| 1534 | # instance. For example, some tasks |
| 1535 | # which were created using the App Engine SDK use a custom domain |
| 1536 | # name; custom domains are not parsed by Cloud Tasks. If |
| 1537 | # host is not parsable, then |
| 1538 | # service, |
| 1539 | # version, and |
| 1540 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1541 | "instance": "A String", # App instance. |
| 1542 | # |
| 1543 | # By default, the task is sent to an instance which is available when |
| 1544 | # the task is attempted. |
| 1545 | # |
| 1546 | # Requests can only be sent to a specific instance if |
| 1547 | # [manual scaling is used in App Engine |
| 1548 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 1549 | # App Engine Flex does not support instances. For more information, see |
| 1550 | # [App Engine Standard request |
| 1551 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 1552 | # and [App Engine Flex request |
| 1553 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
| 1554 | "version": "A String", # App version. |
| 1555 | # |
| 1556 | # By default, the task is sent to the version which is the default |
| 1557 | # version when the task is attempted. |
| 1558 | # |
| 1559 | # For some queues or tasks which were created using the App Engine |
| 1560 | # Task Queue API, host is not parsable |
| 1561 | # into service, |
| 1562 | # version, and |
| 1563 | # instance. For example, some tasks |
| 1564 | # which were created using the App Engine SDK use a custom domain |
| 1565 | # name; custom domains are not parsed by Cloud Tasks. If |
| 1566 | # host is not parsable, then |
| 1567 | # service, |
| 1568 | # version, and |
| 1569 | # instance are the empty string. |
| 1570 | "host": "A String", # Output only. The host that the task is sent to. |
| 1571 | # |
| 1572 | # The host is constructed from the domain name of the app associated with |
| 1573 | # the queue's project ID (for example <app-id>.appspot.com), and the |
| 1574 | # service, version, |
| 1575 | # and instance. Tasks which were created using |
| 1576 | # the App Engine SDK might have a custom domain name. |
| 1577 | # |
| 1578 | # For more information, see |
| 1579 | # [How Requests are |
| 1580 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1581 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1582 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1583 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1584 | # The app's request handler for the task's target URL must be able to handle |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1585 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 1586 | # error code 405 (Method Not Allowed). See [Writing a push task request |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1587 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1588 | # and the App Engine documentation for your runtime on [How Requests are |
| 1589 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1590 | "body": "A String", # HTTP request body. |
| 1591 | # |
| 1592 | # A request body is allowed only if the HTTP method is POST or PUT. It is |
| 1593 | # an error to set a body on a task with an incompatible HttpMethod. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1594 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1595 | "view": "A String", # Output only. The view specifies which subset of the Task has |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1596 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1597 | }</pre> |
| 1598 | </div> |
| 1599 | |
| 1600 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1601 | <code class="details" id="list">list(parent, responseView=None, pageToken=None, pageSize=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1602 | <pre>Lists the tasks in a queue. |
| 1603 | |
| 1604 | By default, only the BASIC view is retrieved |
| 1605 | due to performance considerations; |
| 1606 | response_view controls the |
| 1607 | subset of information which is returned. |
| 1608 | |
| 1609 | The tasks may be returned in any order. The ordering may change at any |
| 1610 | time. |
| 1611 | |
| 1612 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1613 | parent: string, Required. The queue name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1614 | `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` (required) |
| 1615 | responseView: string, The response_view specifies which subset of the Task will be |
| 1616 | returned. |
| 1617 | |
| 1618 | By default response_view is BASIC; not all |
| 1619 | information is retrieved by default because some data, such as |
| 1620 | payloads, might be desirable to return only when needed because |
| 1621 | of its large size or because of the sensitivity of data that it |
| 1622 | contains. |
| 1623 | |
| 1624 | Authorization for FULL requires |
| 1625 | `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) |
| 1626 | permission on the Task resource. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1627 | pageToken: string, A token identifying the page of results to return. |
| 1628 | |
| 1629 | To request the first page results, page_token must be empty. To |
| 1630 | request the next page of results, page_token must be the value of |
| 1631 | next_page_token returned |
| 1632 | from the previous call to ListTasks |
| 1633 | method. |
| 1634 | |
| 1635 | The page token is valid for only 2 hours. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1636 | pageSize: integer, Maximum page size. |
| 1637 | |
| 1638 | Fewer tasks than requested might be returned, even if more tasks exist; use |
| 1639 | next_page_token in the response to |
| 1640 | determine if more tasks exist. |
| 1641 | |
| 1642 | The maximum page size is 1000. If unspecified, the page size will be the |
| 1643 | maximum. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1644 | x__xgafv: string, V1 error format. |
| 1645 | Allowed values |
| 1646 | 1 - v1 error format |
| 1647 | 2 - v2 error format |
| 1648 | |
| 1649 | Returns: |
| 1650 | An object of the form: |
| 1651 | |
| 1652 | { # Response message for listing tasks using ListTasks. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1653 | "tasks": [ # The list of tasks. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1654 | { # A unit of scheduled work. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1655 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted or retried. |
| 1656 | # |
| 1657 | # `schedule_time` will be truncated to the nearest microsecond. |
| 1658 | "createTime": "A String", # Output only. The time that the task was created. |
| 1659 | # |
| 1660 | # `create_time` will be truncated to the nearest second. |
| 1661 | "httpRequest": { # HTTP request. # HTTP request that is sent to the worker. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1662 | # |
| 1663 | # An HTTP task is a task that has HttpRequest set. |
| 1664 | # |
| 1665 | # The task will be pushed to the worker as an HTTP request. If the worker |
| 1666 | # or the redirected worker acknowledges the task by returning a successful HTTP |
| 1667 | # response code ([`200` - `299`]), the task will be removed from the queue. If |
| 1668 | # any other HTTP response code is returned or no response is received, the |
| 1669 | # task will be retried according to the following: |
| 1670 | # |
| 1671 | # * User-specified throttling: retry configuration, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1672 | # rate limits, and the queue's state. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1673 | # |
| 1674 | # * System throttling: To prevent the worker from overloading, Cloud Tasks may |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1675 | # temporarily reduce the queue's effective rate. User-specified settings |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1676 | # will not be changed. |
| 1677 | # |
| 1678 | # System throttling happens because: |
| 1679 | # |
| 1680 | # * Cloud Tasks backs off on all errors. Normally the backoff specified in |
| 1681 | # rate limits will be used. But if the worker returns |
| 1682 | # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of |
| 1683 | # errors is high, Cloud Tasks will use a higher backoff rate. The retry |
| 1684 | # specified in the `Retry-After` HTTP response header is considered. |
| 1685 | # |
| 1686 | # * To prevent traffic spikes and to smooth sudden increases in traffic, |
| 1687 | # dispatches ramp up slowly when the queue is newly created or idle and |
| 1688 | # if large numbers of tasks suddenly become available to dispatch (due to |
| 1689 | # spikes in create task rates, the queue being unpaused, or many tasks |
| 1690 | # that are scheduled at the same time). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1691 | "oidcToken": { # Contains information needed for generating an # If specified, an |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1692 | # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) |
| 1693 | # token will be generated and attached as an `Authorization` header in the |
| 1694 | # HTTP request. |
| 1695 | # |
| 1696 | # This type of authorization can be used for many scenarios, including |
| 1697 | # calling Cloud Run, or endpoints where you intend to validate the token |
| 1698 | # yourself. |
| 1699 | # [OpenID Connect |
| 1700 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 1701 | # This type of authorization can be used for many scenarios, including |
| 1702 | # calling Cloud Run, or endpoints where you intend to validate the token |
| 1703 | # yourself. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1704 | "audience": "A String", # Audience to be used when generating OIDC token. If not specified, the URI |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1705 | # specified in target will be used. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1706 | "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1707 | # to be used for generating OIDC token. |
| 1708 | # The service account must be within the same project as the queue. The |
| 1709 | # caller must have iam.serviceAccounts.actAs permission for the service |
| 1710 | # account. |
| 1711 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1712 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 1713 | "body": "A String", # HTTP request body. |
| 1714 | # |
| 1715 | # A request body is allowed only if the |
| 1716 | # HTTP method is POST, PUT, or PATCH. It is an |
| 1717 | # error to set body on a task with an incompatible HttpMethod. |
| 1718 | "oauthToken": { # Contains information needed for generating an # If specified, an |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1719 | # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) |
| 1720 | # will be generated and attached as an `Authorization` header in the HTTP |
| 1721 | # request. |
| 1722 | # |
| 1723 | # This type of authorization should generally only be used when calling |
| 1724 | # Google APIs hosted on *.googleapis.com. |
| 1725 | # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). |
| 1726 | # This type of authorization should generally only be used when calling Google |
| 1727 | # APIs hosted on *.googleapis.com. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1728 | "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1729 | # to be used for generating OAuth token. |
| 1730 | # The service account must be within the same project as the queue. The |
| 1731 | # caller must have iam.serviceAccounts.actAs permission for the service |
| 1732 | # account. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1733 | "scope": "A String", # OAuth scope to be used for generating OAuth access token. |
| 1734 | # If not specified, "https://www.googleapis.com/auth/cloud-platform" |
| 1735 | # will be used. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1736 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1737 | "headers": { # HTTP request headers. |
| 1738 | # |
| 1739 | # This map contains the header field names and values. |
| 1740 | # Headers can be set when the |
| 1741 | # task is created. |
| 1742 | # |
| 1743 | # These headers represent a subset of the headers that will accompany the |
| 1744 | # task's HTTP request. Some HTTP request headers will be ignored or replaced. |
| 1745 | # |
| 1746 | # A partial list of headers that will be ignored or replaced is: |
| 1747 | # |
| 1748 | # * Host: This will be computed by Cloud Tasks and derived from |
| 1749 | # HttpRequest.url. |
| 1750 | # * Content-Length: This will be computed by Cloud Tasks. |
| 1751 | # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. |
| 1752 | # * X-Google-*: Google use only. |
| 1753 | # * X-AppEngine-*: Google use only. |
| 1754 | # |
| 1755 | # `Content-Type` won't be set by Cloud Tasks. You can explicitly set |
| 1756 | # `Content-Type` to a media type when the |
| 1757 | # task is created. |
| 1758 | # For example, `Content-Type` can be set to `"application/octet-stream"` or |
| 1759 | # `"application/json"`. |
| 1760 | # |
| 1761 | # Headers which can have multiple values (according to RFC2616) can be |
| 1762 | # specified using comma-separated values. |
| 1763 | # |
| 1764 | # The size of the headers must be less than 80KB. |
| 1765 | "a_key": "A String", |
| 1766 | }, |
| 1767 | "url": "A String", # Required. The full url path that the request will be sent to. |
| 1768 | # |
| 1769 | # This string must begin with either "http://" or "https://". Some examples |
| 1770 | # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will |
| 1771 | # encode some characters for safety and compatibility. The maximum allowed |
| 1772 | # URL length is 2083 characters after encoding. |
| 1773 | # |
| 1774 | # The `Location` header response from a redirect response [`300` - `399`] |
| 1775 | # may be followed. The redirect is not counted as a separate attempt. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1776 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1777 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 1778 | # |
| 1779 | # The task name. |
| 1780 | # |
| 1781 | # The task name must have the following format: |
| 1782 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 1783 | # |
| 1784 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 1785 | # hyphens (-), colons (:), or periods (.). |
| 1786 | # For more information, see |
| 1787 | # [Identifying |
| 1788 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 1789 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 1790 | # The list of available locations can be obtained by calling |
| 1791 | # ListLocations. |
| 1792 | # For more information, see https://cloud.google.com/about/locations/. |
| 1793 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 1794 | # hyphens (-). The maximum length is 100 characters. |
| 1795 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 1796 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
| 1797 | "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not |
| 1798 | # respond by this deadline then the request is cancelled and the attempt |
| 1799 | # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the |
| 1800 | # task according to the RetryConfig. |
| 1801 | # |
| 1802 | # Note that when the request is cancelled, Cloud Tasks will stop listing for |
| 1803 | # the response, but whether the worker stops processing depends on the |
| 1804 | # worker. For example, if the worker is stuck, it may not react to cancelled |
| 1805 | # requests. |
| 1806 | # |
| 1807 | # The default and maximum values depend on the type of request: |
| 1808 | # |
| 1809 | # * For HTTP tasks, the default is 10 minutes. The deadline |
| 1810 | # must be in the interval [15 seconds, 30 minutes]. |
| 1811 | # |
| 1812 | # * For App Engine tasks, 0 indicates that the |
| 1813 | # request has the default deadline. The default deadline depends on the |
| 1814 | # [scaling |
| 1815 | # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) |
| 1816 | # of the service: 10 minutes for standard apps with automatic scaling, 24 |
| 1817 | # hours for standard apps with manual and basic scaling, and 60 minutes for |
| 1818 | # flex apps. If the request deadline is set, it must be in the interval [15 |
| 1819 | # seconds, 24 hours 15 seconds]. Regardless of the task's |
| 1820 | # `dispatch_deadline`, the app handler will not run for longer than than |
| 1821 | # the service's timeout. We recommend setting the `dispatch_deadline` to |
| 1822 | # at most a few seconds more than the app handler's timeout. For more |
| 1823 | # information see |
| 1824 | # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). |
| 1825 | # |
| 1826 | # `dispatch_deadline` will be truncated to the nearest millisecond. The |
| 1827 | # deadline is an approximate deadline. |
| 1828 | "dispatchCount": 42, # Output only. The number of attempts dispatched. |
| 1829 | # |
| 1830 | # This count includes attempts which have been dispatched but haven't |
| 1831 | # received a response. |
| 1832 | "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 1833 | # |
| 1834 | # Only dispatch_time will be set. |
| 1835 | # The other Attempt information is not retained by Cloud Tasks. |
| 1836 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 1837 | # |
| 1838 | # `schedule_time` will be truncated to the nearest microsecond. |
| 1839 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 1840 | # |
| 1841 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 1842 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 1843 | # |
| 1844 | # `response_time` will be truncated to the nearest microsecond. |
| 1845 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. |
| 1846 | # |
| 1847 | # If `response_time` is unset, then the task has not been attempted or is |
| 1848 | # currently running and the `response_status` field is meaningless. |
| 1849 | # different programming environments, including REST APIs and RPC APIs. It is |
| 1850 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 1851 | # three pieces of data: error code, error message, and error details. |
| 1852 | # |
| 1853 | # You can find out more about this error model and how to work with it in the |
| 1854 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 1855 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 1856 | # message types for APIs to use. |
| 1857 | { |
| 1858 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 1859 | }, |
| 1860 | ], |
| 1861 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 1862 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 1863 | # user-facing error message should be localized and sent in the |
| 1864 | # google.rpc.Status.details field, or localized by the client. |
| 1865 | }, |
| 1866 | }, |
| 1867 | "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 1868 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 1869 | # |
| 1870 | # `schedule_time` will be truncated to the nearest microsecond. |
| 1871 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 1872 | # |
| 1873 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 1874 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 1875 | # |
| 1876 | # `response_time` will be truncated to the nearest microsecond. |
| 1877 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. |
| 1878 | # |
| 1879 | # If `response_time` is unset, then the task has not been attempted or is |
| 1880 | # currently running and the `response_status` field is meaningless. |
| 1881 | # different programming environments, including REST APIs and RPC APIs. It is |
| 1882 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 1883 | # three pieces of data: error code, error message, and error details. |
| 1884 | # |
| 1885 | # You can find out more about this error model and how to work with it in the |
| 1886 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 1887 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 1888 | # message types for APIs to use. |
| 1889 | { |
| 1890 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 1891 | }, |
| 1892 | ], |
| 1893 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 1894 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 1895 | # user-facing error message should be localized and sent in the |
| 1896 | # google.rpc.Status.details field, or localized by the client. |
| 1897 | }, |
| 1898 | }, |
| 1899 | "responseCount": 42, # Output only. The number of attempts which have received a response. |
| 1900 | "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1901 | # |
| 1902 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 1903 | # |
| 1904 | # The message defines the HTTP request that is sent to an App Engine app when |
| 1905 | # the task is dispatched. |
| 1906 | # |
| 1907 | # Using AppEngineHttpRequest requires |
| 1908 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 1909 | # Google IAM permission for the project |
| 1910 | # and the following scope: |
| 1911 | # |
| 1912 | # `https://www.googleapis.com/auth/cloud-platform` |
| 1913 | # |
| 1914 | # The task will be delivered to the App Engine app which belongs to the same |
| 1915 | # project as the queue. For more information, see |
| 1916 | # [How Requests are |
| 1917 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 1918 | # and how routing is affected by |
| 1919 | # [dispatch |
| 1920 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 1921 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 1922 | # Because this traffic is carried over a communication mechanism internal to |
| 1923 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 1924 | # The request to the handler, however, will appear to have used the HTTP |
| 1925 | # protocol. |
| 1926 | # |
| 1927 | # The AppEngineRouting used to construct the URL that the task is |
| 1928 | # delivered to can be set at the queue-level or task-level: |
| 1929 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1930 | # * If app_engine_routing_override is set on the |
| 1931 | # queue, this value is used for all |
| 1932 | # tasks in the queue, no matter what the setting is for the task-level |
| 1933 | # app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1934 | # |
| 1935 | # |
| 1936 | # The `url` that the task will be sent to is: |
| 1937 | # |
| 1938 | # * `url =` host `+` |
| 1939 | # relative_uri |
| 1940 | # |
| 1941 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 1942 | # URIs restricted with |
| 1943 | # [`login: |
| 1944 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 1945 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 1946 | # restricted with |
| 1947 | # [`login: |
| 1948 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 1949 | # Task dispatches also do not follow redirects. |
| 1950 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1951 | # The task attempt has succeeded if the app's request handler returns an HTTP |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1952 | # response code in the range [`200` - `299`]. The task attempt has failed if |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1953 | # the app's handler returns a non-2xx response code or Cloud Tasks does |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1954 | # not receive response before the deadline. Failed |
| 1955 | # tasks will be retried according to the |
| 1956 | # retry configuration. `503` (Service Unavailable) is |
| 1957 | # considered an App Engine system error instead of an application error and |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1958 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 1959 | # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1960 | # Requests) response from an app handler does not cause traffic congestion |
| 1961 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1962 | "relativeUri": "A String", # The relative URI. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1963 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1964 | # The relative URI must begin with "/" and must be a valid HTTP relative URI. |
| 1965 | # It can contain a path and query string arguments. |
| 1966 | # If the relative URI is empty, then the root path "/" will be used. |
| 1967 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 1968 | "headers": { # HTTP request headers. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1969 | # |
| 1970 | # This map contains the header field names and values. |
| 1971 | # Headers can be set when the |
| 1972 | # task is created. |
| 1973 | # Repeated headers are not supported but a header value can contain commas. |
| 1974 | # |
| 1975 | # Cloud Tasks sets some headers to default values: |
| 1976 | # |
| 1977 | # * `User-Agent`: By default, this header is |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1978 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1979 | # This header can be modified, but Cloud Tasks will append |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1980 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1981 | # modified `User-Agent`. |
| 1982 | # |
| 1983 | # If the task has a body, Cloud |
| 1984 | # Tasks sets the following headers: |
| 1985 | # |
| 1986 | # * `Content-Type`: By default, the `Content-Type` header is set to |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1987 | # `"application/octet-stream"`. The default can be overridden by explicitly |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1988 | # setting `Content-Type` to a particular media type when the |
| 1989 | # task is created. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 1990 | # For example, `Content-Type` can be set to `"application/json"`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1991 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 1992 | # output only. It cannot be changed. |
| 1993 | # |
| 1994 | # The headers below cannot be set or overridden: |
| 1995 | # |
| 1996 | # * `Host` |
| 1997 | # * `X-Google-*` |
| 1998 | # * `X-AppEngine-*` |
| 1999 | # |
| 2000 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 2001 | # such as headers containing information about the task; see |
| 2002 | # [request |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2003 | # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2004 | # These headers are set only when the task is dispatched, so they are not |
| 2005 | # visible when the task is returned in a Cloud Tasks response. |
| 2006 | # |
| 2007 | # Although there is no specific limit for the maximum number of headers or |
| 2008 | # the size, there is a limit on the maximum size of the Task. For more |
| 2009 | # information, see the CreateTask documentation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2010 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2011 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2012 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2013 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2014 | # * If app_engine_routing_override is set on the |
| 2015 | # queue, this value is used for all |
| 2016 | # tasks in the queue, no matter what the setting is for the task-level |
| 2017 | # app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2018 | # |
| 2019 | # Defines routing characteristics specific to App Engine - service, version, |
| 2020 | # and instance. |
| 2021 | # |
| 2022 | # For more information about services, versions, and instances see |
| 2023 | # [An Overview of App |
| 2024 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 2025 | # [Microservices Architecture on Google App |
| 2026 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 2027 | # [App Engine Standard request |
| 2028 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 2029 | # and [App Engine Flex request |
| 2030 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2031 | # |
| 2032 | # Using AppEngineRouting requires |
| 2033 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 2034 | # Google IAM permission for the project |
| 2035 | # and the following scope: |
| 2036 | # |
| 2037 | # `https://www.googleapis.com/auth/cloud-platform` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2038 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2039 | # |
| 2040 | # By default, the task is sent to the service which is the default |
| 2041 | # service when the task is attempted. |
| 2042 | # |
| 2043 | # For some queues or tasks which were created using the App Engine |
| 2044 | # Task Queue API, host is not parsable |
| 2045 | # into service, |
| 2046 | # version, and |
| 2047 | # instance. For example, some tasks |
| 2048 | # which were created using the App Engine SDK use a custom domain |
| 2049 | # name; custom domains are not parsed by Cloud Tasks. If |
| 2050 | # host is not parsable, then |
| 2051 | # service, |
| 2052 | # version, and |
| 2053 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2054 | "instance": "A String", # App instance. |
| 2055 | # |
| 2056 | # By default, the task is sent to an instance which is available when |
| 2057 | # the task is attempted. |
| 2058 | # |
| 2059 | # Requests can only be sent to a specific instance if |
| 2060 | # [manual scaling is used in App Engine |
| 2061 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 2062 | # App Engine Flex does not support instances. For more information, see |
| 2063 | # [App Engine Standard request |
| 2064 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 2065 | # and [App Engine Flex request |
| 2066 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
| 2067 | "version": "A String", # App version. |
| 2068 | # |
| 2069 | # By default, the task is sent to the version which is the default |
| 2070 | # version when the task is attempted. |
| 2071 | # |
| 2072 | # For some queues or tasks which were created using the App Engine |
| 2073 | # Task Queue API, host is not parsable |
| 2074 | # into service, |
| 2075 | # version, and |
| 2076 | # instance. For example, some tasks |
| 2077 | # which were created using the App Engine SDK use a custom domain |
| 2078 | # name; custom domains are not parsed by Cloud Tasks. If |
| 2079 | # host is not parsable, then |
| 2080 | # service, |
| 2081 | # version, and |
| 2082 | # instance are the empty string. |
| 2083 | "host": "A String", # Output only. The host that the task is sent to. |
| 2084 | # |
| 2085 | # The host is constructed from the domain name of the app associated with |
| 2086 | # the queue's project ID (for example <app-id>.appspot.com), and the |
| 2087 | # service, version, |
| 2088 | # and instance. Tasks which were created using |
| 2089 | # the App Engine SDK might have a custom domain name. |
| 2090 | # |
| 2091 | # For more information, see |
| 2092 | # [How Requests are |
| 2093 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2094 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2095 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2096 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2097 | # The app's request handler for the task's target URL must be able to handle |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2098 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 2099 | # error code 405 (Method Not Allowed). See [Writing a push task request |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2100 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2101 | # and the App Engine documentation for your runtime on [How Requests are |
| 2102 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2103 | "body": "A String", # HTTP request body. |
| 2104 | # |
| 2105 | # A request body is allowed only if the HTTP method is POST or PUT. It is |
| 2106 | # an error to set a body on a task with an incompatible HttpMethod. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2107 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2108 | "view": "A String", # Output only. The view specifies which subset of the Task has |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2109 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2110 | }, |
| 2111 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2112 | "nextPageToken": "A String", # A token to retrieve next page of results. |
| 2113 | # |
| 2114 | # To return the next page of results, call |
| 2115 | # ListTasks with this value as the |
| 2116 | # page_token. |
| 2117 | # |
| 2118 | # If the next_page_token is empty, there are no more results. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2119 | }</pre> |
| 2120 | </div> |
| 2121 | |
| 2122 | <div class="method"> |
| 2123 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 2124 | <pre>Retrieves the next page of results. |
| 2125 | |
| 2126 | Args: |
| 2127 | previous_request: The request for the previous page. (required) |
| 2128 | previous_response: The response from the request for the previous page. (required) |
| 2129 | |
| 2130 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2131 | A request object that you can call 'execute()' on to request the next |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2132 | page. Returns None if there are no more items in the collection. |
| 2133 | </pre> |
| 2134 | </div> |
| 2135 | |
| 2136 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2137 | <code class="details" id="run">run(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2138 | <pre>Forces a task to run now. |
| 2139 | |
| 2140 | When this method is called, Cloud Tasks will dispatch the task, even if |
| 2141 | the task is already running, the queue has reached its RateLimits or |
| 2142 | is PAUSED. |
| 2143 | |
| 2144 | This command is meant to be used for manual debugging. For |
| 2145 | example, RunTask can be used to retry a failed |
| 2146 | task after a fix has been made or to manually force a task to be |
| 2147 | dispatched now. |
| 2148 | |
| 2149 | The dispatched task is returned. That is, the task that is returned |
| 2150 | contains the status after the task is dispatched but |
| 2151 | before the task is received by its target. |
| 2152 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2153 | If Cloud Tasks receives a successful response from the task's |
| 2154 | target, then the task will be deleted; otherwise the task's |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2155 | schedule_time will be reset to the time that |
| 2156 | RunTask was called plus the retry delay specified |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2157 | in the queue's RetryConfig. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2158 | |
| 2159 | RunTask returns |
| 2160 | NOT_FOUND when it is called on a |
| 2161 | task that has already succeeded or permanently failed. |
| 2162 | |
| 2163 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2164 | name: string, Required. The task name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2165 | `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2166 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2167 | The object takes the form of: |
| 2168 | |
| 2169 | { # Request message for forcing a task to run now using |
| 2170 | # RunTask. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2171 | "responseView": "A String", # The response_view specifies which subset of the Task will be |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2172 | # returned. |
| 2173 | # |
| 2174 | # By default response_view is BASIC; not all |
| 2175 | # information is retrieved by default because some data, such as |
| 2176 | # payloads, might be desirable to return only when needed because |
| 2177 | # of its large size or because of the sensitivity of data that it |
| 2178 | # contains. |
| 2179 | # |
| 2180 | # Authorization for FULL requires |
| 2181 | # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) |
| 2182 | # permission on the Task resource. |
| 2183 | } |
| 2184 | |
| 2185 | x__xgafv: string, V1 error format. |
| 2186 | Allowed values |
| 2187 | 1 - v1 error format |
| 2188 | 2 - v2 error format |
| 2189 | |
| 2190 | Returns: |
| 2191 | An object of the form: |
| 2192 | |
| 2193 | { # A unit of scheduled work. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2194 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted or retried. |
| 2195 | # |
| 2196 | # `schedule_time` will be truncated to the nearest microsecond. |
| 2197 | "createTime": "A String", # Output only. The time that the task was created. |
| 2198 | # |
| 2199 | # `create_time` will be truncated to the nearest second. |
| 2200 | "httpRequest": { # HTTP request. # HTTP request that is sent to the worker. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2201 | # |
| 2202 | # An HTTP task is a task that has HttpRequest set. |
| 2203 | # |
| 2204 | # The task will be pushed to the worker as an HTTP request. If the worker |
| 2205 | # or the redirected worker acknowledges the task by returning a successful HTTP |
| 2206 | # response code ([`200` - `299`]), the task will be removed from the queue. If |
| 2207 | # any other HTTP response code is returned or no response is received, the |
| 2208 | # task will be retried according to the following: |
| 2209 | # |
| 2210 | # * User-specified throttling: retry configuration, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2211 | # rate limits, and the queue's state. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2212 | # |
| 2213 | # * System throttling: To prevent the worker from overloading, Cloud Tasks may |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2214 | # temporarily reduce the queue's effective rate. User-specified settings |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2215 | # will not be changed. |
| 2216 | # |
| 2217 | # System throttling happens because: |
| 2218 | # |
| 2219 | # * Cloud Tasks backs off on all errors. Normally the backoff specified in |
| 2220 | # rate limits will be used. But if the worker returns |
| 2221 | # `429` (Too Many Requests), `503` (Service Unavailable), or the rate of |
| 2222 | # errors is high, Cloud Tasks will use a higher backoff rate. The retry |
| 2223 | # specified in the `Retry-After` HTTP response header is considered. |
| 2224 | # |
| 2225 | # * To prevent traffic spikes and to smooth sudden increases in traffic, |
| 2226 | # dispatches ramp up slowly when the queue is newly created or idle and |
| 2227 | # if large numbers of tasks suddenly become available to dispatch (due to |
| 2228 | # spikes in create task rates, the queue being unpaused, or many tasks |
| 2229 | # that are scheduled at the same time). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2230 | "oidcToken": { # Contains information needed for generating an # If specified, an |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2231 | # [OIDC](https://developers.google.com/identity/protocols/OpenIDConnect) |
| 2232 | # token will be generated and attached as an `Authorization` header in the |
| 2233 | # HTTP request. |
| 2234 | # |
| 2235 | # This type of authorization can be used for many scenarios, including |
| 2236 | # calling Cloud Run, or endpoints where you intend to validate the token |
| 2237 | # yourself. |
| 2238 | # [OpenID Connect |
| 2239 | # token](https://developers.google.com/identity/protocols/OpenIDConnect). |
| 2240 | # This type of authorization can be used for many scenarios, including |
| 2241 | # calling Cloud Run, or endpoints where you intend to validate the token |
| 2242 | # yourself. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2243 | "audience": "A String", # Audience to be used when generating OIDC token. If not specified, the URI |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2244 | # specified in target will be used. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2245 | "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2246 | # to be used for generating OIDC token. |
| 2247 | # The service account must be within the same project as the queue. The |
| 2248 | # caller must have iam.serviceAccounts.actAs permission for the service |
| 2249 | # account. |
| 2250 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2251 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 2252 | "body": "A String", # HTTP request body. |
| 2253 | # |
| 2254 | # A request body is allowed only if the |
| 2255 | # HTTP method is POST, PUT, or PATCH. It is an |
| 2256 | # error to set body on a task with an incompatible HttpMethod. |
| 2257 | "oauthToken": { # Contains information needed for generating an # If specified, an |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2258 | # [OAuth token](https://developers.google.com/identity/protocols/OAuth2) |
| 2259 | # will be generated and attached as an `Authorization` header in the HTTP |
| 2260 | # request. |
| 2261 | # |
| 2262 | # This type of authorization should generally only be used when calling |
| 2263 | # Google APIs hosted on *.googleapis.com. |
| 2264 | # [OAuth token](https://developers.google.com/identity/protocols/OAuth2). |
| 2265 | # This type of authorization should generally only be used when calling Google |
| 2266 | # APIs hosted on *.googleapis.com. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2267 | "serviceAccountEmail": "A String", # [Service account email](https://cloud.google.com/iam/docs/service-accounts) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2268 | # to be used for generating OAuth token. |
| 2269 | # The service account must be within the same project as the queue. The |
| 2270 | # caller must have iam.serviceAccounts.actAs permission for the service |
| 2271 | # account. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2272 | "scope": "A String", # OAuth scope to be used for generating OAuth access token. |
| 2273 | # If not specified, "https://www.googleapis.com/auth/cloud-platform" |
| 2274 | # will be used. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2275 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2276 | "headers": { # HTTP request headers. |
| 2277 | # |
| 2278 | # This map contains the header field names and values. |
| 2279 | # Headers can be set when the |
| 2280 | # task is created. |
| 2281 | # |
| 2282 | # These headers represent a subset of the headers that will accompany the |
| 2283 | # task's HTTP request. Some HTTP request headers will be ignored or replaced. |
| 2284 | # |
| 2285 | # A partial list of headers that will be ignored or replaced is: |
| 2286 | # |
| 2287 | # * Host: This will be computed by Cloud Tasks and derived from |
| 2288 | # HttpRequest.url. |
| 2289 | # * Content-Length: This will be computed by Cloud Tasks. |
| 2290 | # * User-Agent: This will be set to `"Google-Cloud-Tasks"`. |
| 2291 | # * X-Google-*: Google use only. |
| 2292 | # * X-AppEngine-*: Google use only. |
| 2293 | # |
| 2294 | # `Content-Type` won't be set by Cloud Tasks. You can explicitly set |
| 2295 | # `Content-Type` to a media type when the |
| 2296 | # task is created. |
| 2297 | # For example, `Content-Type` can be set to `"application/octet-stream"` or |
| 2298 | # `"application/json"`. |
| 2299 | # |
| 2300 | # Headers which can have multiple values (according to RFC2616) can be |
| 2301 | # specified using comma-separated values. |
| 2302 | # |
| 2303 | # The size of the headers must be less than 80KB. |
| 2304 | "a_key": "A String", |
| 2305 | }, |
| 2306 | "url": "A String", # Required. The full url path that the request will be sent to. |
| 2307 | # |
| 2308 | # This string must begin with either "http://" or "https://". Some examples |
| 2309 | # are: `http://acme.com` and `https://acme.com/sales:8080`. Cloud Tasks will |
| 2310 | # encode some characters for safety and compatibility. The maximum allowed |
| 2311 | # URL length is 2083 characters after encoding. |
| 2312 | # |
| 2313 | # The `Location` header response from a redirect response [`300` - `399`] |
| 2314 | # may be followed. The redirect is not counted as a separate attempt. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2315 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2316 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 2317 | # |
| 2318 | # The task name. |
| 2319 | # |
| 2320 | # The task name must have the following format: |
| 2321 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 2322 | # |
| 2323 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 2324 | # hyphens (-), colons (:), or periods (.). |
| 2325 | # For more information, see |
| 2326 | # [Identifying |
| 2327 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 2328 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 2329 | # The list of available locations can be obtained by calling |
| 2330 | # ListLocations. |
| 2331 | # For more information, see https://cloud.google.com/about/locations/. |
| 2332 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 2333 | # hyphens (-). The maximum length is 100 characters. |
| 2334 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 2335 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
| 2336 | "dispatchDeadline": "A String", # The deadline for requests sent to the worker. If the worker does not |
| 2337 | # respond by this deadline then the request is cancelled and the attempt |
| 2338 | # is marked as a `DEADLINE_EXCEEDED` failure. Cloud Tasks will retry the |
| 2339 | # task according to the RetryConfig. |
| 2340 | # |
| 2341 | # Note that when the request is cancelled, Cloud Tasks will stop listing for |
| 2342 | # the response, but whether the worker stops processing depends on the |
| 2343 | # worker. For example, if the worker is stuck, it may not react to cancelled |
| 2344 | # requests. |
| 2345 | # |
| 2346 | # The default and maximum values depend on the type of request: |
| 2347 | # |
| 2348 | # * For HTTP tasks, the default is 10 minutes. The deadline |
| 2349 | # must be in the interval [15 seconds, 30 minutes]. |
| 2350 | # |
| 2351 | # * For App Engine tasks, 0 indicates that the |
| 2352 | # request has the default deadline. The default deadline depends on the |
| 2353 | # [scaling |
| 2354 | # type](https://cloud.google.com/appengine/docs/standard/go/how-instances-are-managed#instance_scaling) |
| 2355 | # of the service: 10 minutes for standard apps with automatic scaling, 24 |
| 2356 | # hours for standard apps with manual and basic scaling, and 60 minutes for |
| 2357 | # flex apps. If the request deadline is set, it must be in the interval [15 |
| 2358 | # seconds, 24 hours 15 seconds]. Regardless of the task's |
| 2359 | # `dispatch_deadline`, the app handler will not run for longer than than |
| 2360 | # the service's timeout. We recommend setting the `dispatch_deadline` to |
| 2361 | # at most a few seconds more than the app handler's timeout. For more |
| 2362 | # information see |
| 2363 | # [Timeouts](https://cloud.google.com/tasks/docs/creating-appengine-handlers#timeouts). |
| 2364 | # |
| 2365 | # `dispatch_deadline` will be truncated to the nearest millisecond. The |
| 2366 | # deadline is an approximate deadline. |
| 2367 | "dispatchCount": 42, # Output only. The number of attempts dispatched. |
| 2368 | # |
| 2369 | # This count includes attempts which have been dispatched but haven't |
| 2370 | # received a response. |
| 2371 | "firstAttempt": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 2372 | # |
| 2373 | # Only dispatch_time will be set. |
| 2374 | # The other Attempt information is not retained by Cloud Tasks. |
| 2375 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 2376 | # |
| 2377 | # `schedule_time` will be truncated to the nearest microsecond. |
| 2378 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 2379 | # |
| 2380 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 2381 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 2382 | # |
| 2383 | # `response_time` will be truncated to the nearest microsecond. |
| 2384 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. |
| 2385 | # |
| 2386 | # If `response_time` is unset, then the task has not been attempted or is |
| 2387 | # currently running and the `response_status` field is meaningless. |
| 2388 | # different programming environments, including REST APIs and RPC APIs. It is |
| 2389 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 2390 | # three pieces of data: error code, error message, and error details. |
| 2391 | # |
| 2392 | # You can find out more about this error model and how to work with it in the |
| 2393 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 2394 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 2395 | # message types for APIs to use. |
| 2396 | { |
| 2397 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 2398 | }, |
| 2399 | ], |
| 2400 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 2401 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 2402 | # user-facing error message should be localized and sent in the |
| 2403 | # google.rpc.Status.details field, or localized by the client. |
| 2404 | }, |
| 2405 | }, |
| 2406 | "lastAttempt": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 2407 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 2408 | # |
| 2409 | # `schedule_time` will be truncated to the nearest microsecond. |
| 2410 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 2411 | # |
| 2412 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 2413 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 2414 | # |
| 2415 | # `response_time` will be truncated to the nearest microsecond. |
| 2416 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the worker for this attempt. |
| 2417 | # |
| 2418 | # If `response_time` is unset, then the task has not been attempted or is |
| 2419 | # currently running and the `response_status` field is meaningless. |
| 2420 | # different programming environments, including REST APIs and RPC APIs. It is |
| 2421 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 2422 | # three pieces of data: error code, error message, and error details. |
| 2423 | # |
| 2424 | # You can find out more about this error model and how to work with it in the |
| 2425 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 2426 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 2427 | # message types for APIs to use. |
| 2428 | { |
| 2429 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 2430 | }, |
| 2431 | ], |
| 2432 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 2433 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 2434 | # user-facing error message should be localized and sent in the |
| 2435 | # google.rpc.Status.details field, or localized by the client. |
| 2436 | }, |
| 2437 | }, |
| 2438 | "responseCount": 42, # Output only. The number of attempts which have received a response. |
| 2439 | "appEngineHttpRequest": { # App Engine HTTP request. # HTTP request that is sent to the App Engine app handler. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2440 | # |
| 2441 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 2442 | # |
| 2443 | # The message defines the HTTP request that is sent to an App Engine app when |
| 2444 | # the task is dispatched. |
| 2445 | # |
| 2446 | # Using AppEngineHttpRequest requires |
| 2447 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 2448 | # Google IAM permission for the project |
| 2449 | # and the following scope: |
| 2450 | # |
| 2451 | # `https://www.googleapis.com/auth/cloud-platform` |
| 2452 | # |
| 2453 | # The task will be delivered to the App Engine app which belongs to the same |
| 2454 | # project as the queue. For more information, see |
| 2455 | # [How Requests are |
| 2456 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 2457 | # and how routing is affected by |
| 2458 | # [dispatch |
| 2459 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 2460 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 2461 | # Because this traffic is carried over a communication mechanism internal to |
| 2462 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 2463 | # The request to the handler, however, will appear to have used the HTTP |
| 2464 | # protocol. |
| 2465 | # |
| 2466 | # The AppEngineRouting used to construct the URL that the task is |
| 2467 | # delivered to can be set at the queue-level or task-level: |
| 2468 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2469 | # * If app_engine_routing_override is set on the |
| 2470 | # queue, this value is used for all |
| 2471 | # tasks in the queue, no matter what the setting is for the task-level |
| 2472 | # app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2473 | # |
| 2474 | # |
| 2475 | # The `url` that the task will be sent to is: |
| 2476 | # |
| 2477 | # * `url =` host `+` |
| 2478 | # relative_uri |
| 2479 | # |
| 2480 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 2481 | # URIs restricted with |
| 2482 | # [`login: |
| 2483 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 2484 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 2485 | # restricted with |
| 2486 | # [`login: |
| 2487 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 2488 | # Task dispatches also do not follow redirects. |
| 2489 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2490 | # The task attempt has succeeded if the app's request handler returns an HTTP |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2491 | # response code in the range [`200` - `299`]. The task attempt has failed if |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2492 | # the app's handler returns a non-2xx response code or Cloud Tasks does |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2493 | # not receive response before the deadline. Failed |
| 2494 | # tasks will be retried according to the |
| 2495 | # retry configuration. `503` (Service Unavailable) is |
| 2496 | # considered an App Engine system error instead of an application error and |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2497 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 2498 | # the queue's dispatches. Unlike other types of task targets, a `429` (Too Many |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2499 | # Requests) response from an app handler does not cause traffic congestion |
| 2500 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2501 | "relativeUri": "A String", # The relative URI. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2502 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2503 | # The relative URI must begin with "/" and must be a valid HTTP relative URI. |
| 2504 | # It can contain a path and query string arguments. |
| 2505 | # If the relative URI is empty, then the root path "/" will be used. |
| 2506 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 2507 | "headers": { # HTTP request headers. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2508 | # |
| 2509 | # This map contains the header field names and values. |
| 2510 | # Headers can be set when the |
| 2511 | # task is created. |
| 2512 | # Repeated headers are not supported but a header value can contain commas. |
| 2513 | # |
| 2514 | # Cloud Tasks sets some headers to default values: |
| 2515 | # |
| 2516 | # * `User-Agent`: By default, this header is |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2517 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2518 | # This header can be modified, but Cloud Tasks will append |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2519 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2520 | # modified `User-Agent`. |
| 2521 | # |
| 2522 | # If the task has a body, Cloud |
| 2523 | # Tasks sets the following headers: |
| 2524 | # |
| 2525 | # * `Content-Type`: By default, the `Content-Type` header is set to |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2526 | # `"application/octet-stream"`. The default can be overridden by explicitly |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2527 | # setting `Content-Type` to a particular media type when the |
| 2528 | # task is created. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2529 | # For example, `Content-Type` can be set to `"application/json"`. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2530 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 2531 | # output only. It cannot be changed. |
| 2532 | # |
| 2533 | # The headers below cannot be set or overridden: |
| 2534 | # |
| 2535 | # * `Host` |
| 2536 | # * `X-Google-*` |
| 2537 | # * `X-AppEngine-*` |
| 2538 | # |
| 2539 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 2540 | # such as headers containing information about the task; see |
| 2541 | # [request |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2542 | # headers](https://cloud.google.com/tasks/docs/creating-appengine-handlers#reading_request_headers). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2543 | # These headers are set only when the task is dispatched, so they are not |
| 2544 | # visible when the task is returned in a Cloud Tasks response. |
| 2545 | # |
| 2546 | # Although there is no specific limit for the maximum number of headers or |
| 2547 | # the size, there is a limit on the maximum size of the Task. For more |
| 2548 | # information, see the CreateTask documentation. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2549 | "a_key": "A String", |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2550 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2551 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2552 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2553 | # * If app_engine_routing_override is set on the |
| 2554 | # queue, this value is used for all |
| 2555 | # tasks in the queue, no matter what the setting is for the task-level |
| 2556 | # app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2557 | # |
| 2558 | # Defines routing characteristics specific to App Engine - service, version, |
| 2559 | # and instance. |
| 2560 | # |
| 2561 | # For more information about services, versions, and instances see |
| 2562 | # [An Overview of App |
| 2563 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 2564 | # [Microservices Architecture on Google App |
| 2565 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 2566 | # [App Engine Standard request |
| 2567 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 2568 | # and [App Engine Flex request |
| 2569 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2570 | # |
| 2571 | # Using AppEngineRouting requires |
| 2572 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 2573 | # Google IAM permission for the project |
| 2574 | # and the following scope: |
| 2575 | # |
| 2576 | # `https://www.googleapis.com/auth/cloud-platform` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2577 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2578 | # |
| 2579 | # By default, the task is sent to the service which is the default |
| 2580 | # service when the task is attempted. |
| 2581 | # |
| 2582 | # For some queues or tasks which were created using the App Engine |
| 2583 | # Task Queue API, host is not parsable |
| 2584 | # into service, |
| 2585 | # version, and |
| 2586 | # instance. For example, some tasks |
| 2587 | # which were created using the App Engine SDK use a custom domain |
| 2588 | # name; custom domains are not parsed by Cloud Tasks. If |
| 2589 | # host is not parsable, then |
| 2590 | # service, |
| 2591 | # version, and |
| 2592 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2593 | "instance": "A String", # App instance. |
| 2594 | # |
| 2595 | # By default, the task is sent to an instance which is available when |
| 2596 | # the task is attempted. |
| 2597 | # |
| 2598 | # Requests can only be sent to a specific instance if |
| 2599 | # [manual scaling is used in App Engine |
| 2600 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 2601 | # App Engine Flex does not support instances. For more information, see |
| 2602 | # [App Engine Standard request |
| 2603 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 2604 | # and [App Engine Flex request |
| 2605 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
| 2606 | "version": "A String", # App version. |
| 2607 | # |
| 2608 | # By default, the task is sent to the version which is the default |
| 2609 | # version when the task is attempted. |
| 2610 | # |
| 2611 | # For some queues or tasks which were created using the App Engine |
| 2612 | # Task Queue API, host is not parsable |
| 2613 | # into service, |
| 2614 | # version, and |
| 2615 | # instance. For example, some tasks |
| 2616 | # which were created using the App Engine SDK use a custom domain |
| 2617 | # name; custom domains are not parsed by Cloud Tasks. If |
| 2618 | # host is not parsable, then |
| 2619 | # service, |
| 2620 | # version, and |
| 2621 | # instance are the empty string. |
| 2622 | "host": "A String", # Output only. The host that the task is sent to. |
| 2623 | # |
| 2624 | # The host is constructed from the domain name of the app associated with |
| 2625 | # the queue's project ID (for example <app-id>.appspot.com), and the |
| 2626 | # service, version, |
| 2627 | # and instance. Tasks which were created using |
| 2628 | # the App Engine SDK might have a custom domain name. |
| 2629 | # |
| 2630 | # For more information, see |
| 2631 | # [How Requests are |
| 2632 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2633 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2634 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2635 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2636 | # The app's request handler for the task's target URL must be able to handle |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2637 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 2638 | # error code 405 (Method Not Allowed). See [Writing a push task request |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2639 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2640 | # and the App Engine documentation for your runtime on [How Requests are |
| 2641 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2642 | "body": "A String", # HTTP request body. |
| 2643 | # |
| 2644 | # A request body is allowed only if the HTTP method is POST or PUT. It is |
| 2645 | # an error to set a body on a task with an incompatible HttpMethod. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2646 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame^] | 2647 | "view": "A String", # Output only. The view specifies which subset of the Task has |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2648 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2649 | }</pre> |
| 2650 | </div> |
| 2651 | |
| 2652 | </body></html> |