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_v2beta2.html">Cloud Tasks API</a> . <a href="cloudtasks_v2beta2.projects.html">projects</a> . <a href="cloudtasks_v2beta2.projects.locations.html">locations</a> . <a href="cloudtasks_v2beta2.projects.locations.queues.html">queues</a> . <a href="cloudtasks_v2beta2.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="#acknowledge">acknowledge(name, 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">Acknowledges a pull task.</p> |
| 80 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 81 | <code><a href="#cancelLease">cancelLease(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 82 | <p class="firstline">Cancel a pull task's lease.</p> |
| 83 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 84 | <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] | 85 | <p class="firstline">Creates a task and adds it to a queue.</p> |
| 86 | <p class="toc_element"> |
| 87 | <code><a href="#delete">delete(name, x__xgafv=None)</a></code></p> |
| 88 | <p class="firstline">Deletes a task.</p> |
| 89 | <p class="toc_element"> |
| 90 | <code><a href="#get">get(name, responseView=None, x__xgafv=None)</a></code></p> |
| 91 | <p class="firstline">Gets a task.</p> |
| 92 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 93 | <code><a href="#lease">lease(parent, 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">Leases tasks from a pull queue for</p> |
| 95 | <p class="toc_element"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 96 | <code><a href="#list">list(parent, pageSize=None, pageToken=None, responseView=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 97 | <p class="firstline">Lists the tasks in a queue.</p> |
| 98 | <p class="toc_element"> |
| 99 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 100 | <p class="firstline">Retrieves the next page of results.</p> |
| 101 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 102 | <code><a href="#renewLease">renewLease(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 103 | <p class="firstline">Renew the current lease of a pull task.</p> |
| 104 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 105 | <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] | 106 | <p class="firstline">Forces a task to run now.</p> |
| 107 | <h3>Method Details</h3> |
| 108 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 109 | <code class="details" id="acknowledge">acknowledge(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 110 | <pre>Acknowledges a pull task. |
| 111 | |
| 112 | The worker, that is, the entity that |
| 113 | leased this task must call this method |
| 114 | to indicate that the work associated with the task has finished. |
| 115 | |
| 116 | The worker must acknowledge a task within the |
| 117 | lease_duration or the lease |
| 118 | will expire and the task will become available to be leased |
| 119 | again. After the task is acknowledged, it will not be returned |
| 120 | by a later LeaseTasks, |
| 121 | GetTask, or |
| 122 | ListTasks. |
| 123 | |
| 124 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 125 | name: string, Required. The task name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 126 | `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] | 127 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 128 | The object takes the form of: |
| 129 | |
| 130 | { # Request message for acknowledging a task using |
| 131 | # AcknowledgeTask. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 132 | "scheduleTime": "A String", # Required. The task's current schedule time, available in the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 133 | # schedule_time returned by |
| 134 | # LeaseTasks response or |
| 135 | # RenewLease response. This restriction is |
| 136 | # to ensure that your worker currently holds the lease. |
| 137 | } |
| 138 | |
| 139 | x__xgafv: string, V1 error format. |
| 140 | Allowed values |
| 141 | 1 - v1 error format |
| 142 | 2 - v2 error format |
| 143 | |
| 144 | Returns: |
| 145 | An object of the form: |
| 146 | |
| 147 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 148 | # empty messages in your APIs. A typical example is to use it as the request |
| 149 | # or the response type of an API method. For instance: |
| 150 | # |
| 151 | # service Foo { |
| 152 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 153 | # } |
| 154 | # |
| 155 | # The JSON representation for `Empty` is empty JSON object `{}`. |
| 156 | }</pre> |
| 157 | </div> |
| 158 | |
| 159 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 160 | <code class="details" id="cancelLease">cancelLease(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 161 | <pre>Cancel a pull task's lease. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 162 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 163 | The worker can use this method to cancel a task's lease by |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 164 | setting its schedule_time to now. This will |
| 165 | make the task available to be leased to the next caller of |
| 166 | LeaseTasks. |
| 167 | |
| 168 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 169 | name: string, Required. The task name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 170 | `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] | 171 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 172 | The object takes the form of: |
| 173 | |
| 174 | { # Request message for canceling a lease using |
| 175 | # CancelLease. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 176 | "scheduleTime": "A String", # Required. The task's current schedule time, available in the |
| 177 | # schedule_time returned by |
| 178 | # LeaseTasks response or |
| 179 | # RenewLease response. This restriction is |
| 180 | # to ensure that your worker currently holds the lease. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 181 | "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] | 182 | # returned. |
| 183 | # |
| 184 | # By default response_view is BASIC; not all |
| 185 | # information is retrieved by default because some data, such as |
| 186 | # payloads, might be desirable to return only when needed because |
| 187 | # of its large size or because of the sensitivity of data that it |
| 188 | # contains. |
| 189 | # |
| 190 | # Authorization for FULL requires |
| 191 | # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) |
| 192 | # permission on the Task resource. |
| 193 | } |
| 194 | |
| 195 | x__xgafv: string, V1 error format. |
| 196 | Allowed values |
| 197 | 1 - v1 error format |
| 198 | 2 - v2 error format |
| 199 | |
| 200 | Returns: |
| 201 | An object of the form: |
| 202 | |
| 203 | { # A unit of scheduled work. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 204 | "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 205 | # be set only if |
| 206 | # app_engine_http_target is set |
| 207 | # on the queue. |
| 208 | # |
| 209 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 210 | # |
| 211 | # The message defines the HTTP request that is sent to an App Engine app when |
| 212 | # the task is dispatched. |
| 213 | # |
| 214 | # This proto can only be used for tasks in a queue which has |
| 215 | # app_engine_http_target set. |
| 216 | # |
| 217 | # Using AppEngineHttpRequest requires |
| 218 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 219 | # Google IAM permission for the project |
| 220 | # and the following scope: |
| 221 | # |
| 222 | # `https://www.googleapis.com/auth/cloud-platform` |
| 223 | # |
| 224 | # The task will be delivered to the App Engine app which belongs to the same |
| 225 | # project as the queue. For more information, see |
| 226 | # [How Requests are |
| 227 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 228 | # and how routing is affected by |
| 229 | # [dispatch |
| 230 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 231 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 232 | # Because this traffic is carried over a communication mechanism internal to |
| 233 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 234 | # The request to the handler, however, will appear to have used the HTTP |
| 235 | # protocol. |
| 236 | # |
| 237 | # The AppEngineRouting used to construct the URL that the task is |
| 238 | # delivered to can be set at the queue-level or task-level: |
| 239 | # |
| 240 | # * If set, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 241 | # app_engine_routing_override |
| 242 | # is used for all tasks in the queue, no matter what the setting |
| 243 | # is for the |
| 244 | # task-level app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 245 | # |
| 246 | # |
| 247 | # The `url` that the task will be sent to is: |
| 248 | # |
| 249 | # * `url =` host `+` |
| 250 | # relative_url |
| 251 | # |
| 252 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 253 | # URIs restricted with |
| 254 | # [`login: |
| 255 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 256 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 257 | # restricted with |
| 258 | # [`login: |
| 259 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 260 | # Task dispatches also do not follow redirects. |
| 261 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 262 | # 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] | 263 | # 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] | 264 | # 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] | 265 | # not receive response before the deadline. Failed |
| 266 | # tasks will be retried according to the |
| 267 | # retry configuration. `503` (Service Unavailable) is |
| 268 | # 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] | 269 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 270 | # 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] | 271 | # Requests) response from an app handler does not cause traffic congestion |
| 272 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 273 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 274 | # |
| 275 | # If set, |
| 276 | # app_engine_routing_override |
| 277 | # is used for all tasks in the queue, no matter what the setting is for the |
| 278 | # task-level app_engine_routing. |
| 279 | # |
| 280 | # Defines routing characteristics specific to App Engine - service, version, |
| 281 | # and instance. |
| 282 | # |
| 283 | # For more information about services, versions, and instances see |
| 284 | # [An Overview of App |
| 285 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 286 | # [Microservices Architecture on Google App |
| 287 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 288 | # [App Engine Standard request |
| 289 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 290 | # and [App Engine Flex request |
| 291 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 292 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 293 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 294 | # By default, the task is sent to the service which is the default |
| 295 | # service when the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 296 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 297 | # For some queues or tasks which were created using the App Engine |
| 298 | # Task Queue API, host is not parsable |
| 299 | # into service, |
| 300 | # version, and |
| 301 | # instance. For example, some tasks |
| 302 | # which were created using the App Engine SDK use a custom domain |
| 303 | # name; custom domains are not parsed by Cloud Tasks. If |
| 304 | # host is not parsable, then |
| 305 | # service, |
| 306 | # version, and |
| 307 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 308 | "version": "A String", # App version. |
| 309 | # |
| 310 | # By default, the task is sent to the version which is the default |
| 311 | # version when the task is attempted. |
| 312 | # |
| 313 | # For some queues or tasks which were created using the App Engine |
| 314 | # Task Queue API, host is not parsable |
| 315 | # into service, |
| 316 | # version, and |
| 317 | # instance. For example, some tasks |
| 318 | # which were created using the App Engine SDK use a custom domain |
| 319 | # name; custom domains are not parsed by Cloud Tasks. If |
| 320 | # host is not parsable, then |
| 321 | # service, |
| 322 | # version, and |
| 323 | # instance are the empty string. |
| 324 | "host": "A String", # Output only. The host that the task is sent to. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 325 | # |
| 326 | # For more information, see |
| 327 | # [How Requests are |
| 328 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
| 329 | # |
| 330 | # The host is constructed as: |
| 331 | # |
| 332 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 333 | # * `host = [application_domain_name]`</br> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 334 | # `| [service] + '.' + [application_domain_name]`</br> |
| 335 | # `| [version] + '.' + [application_domain_name]`</br> |
| 336 | # `| [version_dot_service]+ '.' + [application_domain_name]`</br> |
| 337 | # `| [instance] + '.' + [application_domain_name]`</br> |
| 338 | # `| [instance_dot_service] + '.' + [application_domain_name]`</br> |
| 339 | # `| [instance_dot_version] + '.' + [application_domain_name]`</br> |
| 340 | # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 341 | # |
| 342 | # * `application_domain_name` = The domain name of the app, for |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 343 | # example <app-id>.appspot.com, which is associated with the |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 344 | # queue's project ID. Some tasks which were created using the App Engine |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 345 | # SDK use a custom domain name. |
| 346 | # |
| 347 | # * `service =` service |
| 348 | # |
| 349 | # * `version =` version |
| 350 | # |
| 351 | # * `version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 352 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 353 | # service |
| 354 | # |
| 355 | # * `instance =` instance |
| 356 | # |
| 357 | # * `instance_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 358 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 359 | # service |
| 360 | # |
| 361 | # * `instance_dot_version =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 362 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 363 | # version |
| 364 | # |
| 365 | # * `instance_dot_version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 366 | # instance `+ '.' +` |
| 367 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 368 | # service |
| 369 | # |
| 370 | # If service is empty, then the task will be sent |
| 371 | # to the service which is the default service when the task is attempted. |
| 372 | # |
| 373 | # If version is empty, then the task will be sent |
| 374 | # to the version which is the default version when the task is attempted. |
| 375 | # |
| 376 | # If instance is empty, then the task |
| 377 | # will be sent to an instance which is available when the task is |
| 378 | # attempted. |
| 379 | # |
| 380 | # If service, |
| 381 | # version, or |
| 382 | # instance is invalid, then the task |
| 383 | # will be sent to the default version of the default service when |
| 384 | # the task is attempted. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 385 | "instance": "A String", # App instance. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 386 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 387 | # By default, the task is sent to an instance which is available when |
| 388 | # the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 389 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 390 | # Requests can only be sent to a specific instance if |
| 391 | # [manual scaling is used in App Engine |
| 392 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 393 | # App Engine Flex does not support instances. For more information, see |
| 394 | # [App Engine Standard request |
| 395 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 396 | # and [App Engine Flex request |
| 397 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 398 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 399 | "headers": { # HTTP request headers. |
| 400 | # |
| 401 | # This map contains the header field names and values. |
| 402 | # Headers can be set when the |
| 403 | # task is created. |
| 404 | # Repeated headers are not supported but a header value can contain commas. |
| 405 | # |
| 406 | # Cloud Tasks sets some headers to default values: |
| 407 | # |
| 408 | # * `User-Agent`: By default, this header is |
| 409 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
| 410 | # This header can be modified, but Cloud Tasks will append |
| 411 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
| 412 | # modified `User-Agent`. |
| 413 | # |
| 414 | # If the task has a payload, Cloud |
| 415 | # Tasks sets the following headers: |
| 416 | # |
| 417 | # * `Content-Type`: By default, the `Content-Type` header is set to |
| 418 | # `"application/octet-stream"`. The default can be overridden by explicitly |
| 419 | # setting `Content-Type` to a particular media type when the |
| 420 | # task is created. |
| 421 | # For example, `Content-Type` can be set to `"application/json"`. |
| 422 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 423 | # output only. It cannot be changed. |
| 424 | # |
| 425 | # The headers below cannot be set or overridden: |
| 426 | # |
| 427 | # * `Host` |
| 428 | # * `X-Google-*` |
| 429 | # * `X-AppEngine-*` |
| 430 | # |
| 431 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 432 | # such as headers containing information about the task; see |
| 433 | # [request |
| 434 | # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). |
| 435 | # These headers are set only when the task is dispatched, so they are not |
| 436 | # visible when the task is returned in a Cloud Tasks response. |
| 437 | # |
| 438 | # Although there is no specific limit for the maximum number of headers or |
| 439 | # the size, there is a limit on the maximum size of the Task. For more |
| 440 | # information, see the CreateTask documentation. |
| 441 | "a_key": "A String", |
| 442 | }, |
| 443 | "relativeUrl": "A String", # The relative URL. |
| 444 | # |
| 445 | # The relative URL must begin with "/" and must be a valid HTTP relative URL. |
| 446 | # It can contain a path and query string arguments. |
| 447 | # If the relative URL is empty, then the root path "/" will be used. |
| 448 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 449 | "payload": "A String", # Payload. |
| 450 | # |
| 451 | # The payload will be sent as the HTTP message body. A message |
| 452 | # body, and thus a payload, is allowed only if the HTTP method is |
| 453 | # POST or PUT. It is an error to set a data payload on a task with |
| 454 | # an incompatible HttpMethod. |
| 455 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 456 | # |
| 457 | # The app's request handler for the task's target URL must be able to handle |
| 458 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 459 | # error code 405 (Method Not Allowed). See [Writing a push task request |
| 460 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
| 461 | # and the App Engine documentation for your runtime on [How Requests are |
| 462 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 463 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 464 | "status": { # Status of the task. # Output only. The task status. |
| 465 | "attemptDispatchCount": 42, # Output only. The number of attempts dispatched. |
| 466 | # |
| 467 | # This count includes attempts which have been dispatched but haven't |
| 468 | # received a response. |
| 469 | "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 470 | # |
| 471 | # Only dispatch_time will be set. |
| 472 | # The other AttemptStatus information is not retained by Cloud Tasks. |
| 473 | # |
| 474 | # This field is not calculated for pull tasks. |
| 475 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 476 | # |
| 477 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 478 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 479 | # |
| 480 | # If the task has not been attempted or the task is currently running |
| 481 | # then the response status is unset. |
| 482 | # different programming environments, including REST APIs and RPC APIs. It is |
| 483 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 484 | # three pieces of data: error code, error message, and error details. |
| 485 | # |
| 486 | # You can find out more about this error model and how to work with it in the |
| 487 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 488 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 489 | # user-facing error message should be localized and sent in the |
| 490 | # google.rpc.Status.details field, or localized by the client. |
| 491 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 492 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 493 | # message types for APIs to use. |
| 494 | { |
| 495 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 496 | }, |
| 497 | ], |
| 498 | }, |
| 499 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 500 | # |
| 501 | # `response_time` will be truncated to the nearest microsecond. |
| 502 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 503 | # |
| 504 | # `schedule_time` will be truncated to the nearest microsecond. |
| 505 | }, |
| 506 | "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 507 | # |
| 508 | # This field is not calculated for pull tasks. |
| 509 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 510 | # |
| 511 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 512 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 513 | # |
| 514 | # If the task has not been attempted or the task is currently running |
| 515 | # then the response status is unset. |
| 516 | # different programming environments, including REST APIs and RPC APIs. It is |
| 517 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 518 | # three pieces of data: error code, error message, and error details. |
| 519 | # |
| 520 | # You can find out more about this error model and how to work with it in the |
| 521 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 522 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 523 | # user-facing error message should be localized and sent in the |
| 524 | # google.rpc.Status.details field, or localized by the client. |
| 525 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 526 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 527 | # message types for APIs to use. |
| 528 | { |
| 529 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 530 | }, |
| 531 | ], |
| 532 | }, |
| 533 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 534 | # |
| 535 | # `response_time` will be truncated to the nearest microsecond. |
| 536 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 537 | # |
| 538 | # `schedule_time` will be truncated to the nearest microsecond. |
| 539 | }, |
| 540 | "attemptResponseCount": 42, # Output only. The number of attempts which have received a response. |
| 541 | # |
| 542 | # This field is not calculated for pull tasks. |
| 543 | }, |
| 544 | "createTime": "A String", # Output only. The time that the task was created. |
| 545 | # |
| 546 | # `create_time` will be truncated to the nearest second. |
| 547 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 548 | # |
| 549 | # The task name. |
| 550 | # |
| 551 | # The task name must have the following format: |
| 552 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 553 | # |
| 554 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 555 | # hyphens (-), colons (:), or periods (.). |
| 556 | # For more information, see |
| 557 | # [Identifying |
| 558 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 559 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 560 | # The list of available locations can be obtained by calling |
| 561 | # ListLocations. |
| 562 | # For more information, see https://cloud.google.com/about/locations/. |
| 563 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 564 | # hyphens (-). The maximum length is 100 characters. |
| 565 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 566 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 567 | "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be |
| 568 | # set only if pull_target is set on the queue. |
| 569 | # |
| 570 | # A pull task is a task that has PullMessage set. |
| 571 | # LeaseTasks to process the task. |
| 572 | # |
| 573 | # This proto can only be used for tasks in a queue which has |
| 574 | # pull_target set. |
| 575 | "payload": "A String", # A data payload consumed by the worker to execute the task. |
| 576 | "tag": "A String", # The task's tag. |
| 577 | # |
| 578 | # Tags allow similar tasks to be processed in a batch. If you label |
| 579 | # tasks with a tag, your worker can |
| 580 | # lease tasks with the same tag using |
| 581 | # filter. For example, if you want to |
| 582 | # aggregate the events associated with a specific user once a day, |
| 583 | # you could tag tasks with the user ID. |
| 584 | # |
| 585 | # The task's tag can only be set when the |
| 586 | # task is created. |
| 587 | # |
| 588 | # The tag must be less than 500 characters. |
| 589 | # |
| 590 | # SDK compatibility: Although the SDK allows tags to be either |
| 591 | # string or |
| 592 | # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), |
| 593 | # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 |
| 594 | # encoded, the tag will be empty when the task is returned by Cloud Tasks. |
| 595 | }, |
| 596 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted. |
| 597 | # |
| 598 | # For App Engine queues, this is when the task will be attempted or retried. |
| 599 | # |
| 600 | # For pull queues, this is the time when the task is available to |
| 601 | # be leased; if a task is currently leased, this is the time when |
| 602 | # the current lease expires, that is, the time that the task was |
| 603 | # leased plus the lease_duration. |
| 604 | # |
| 605 | # `schedule_time` will be truncated to the nearest microsecond. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 606 | "view": "A String", # Output only. The view specifies which subset of the Task has |
| 607 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 608 | }</pre> |
| 609 | </div> |
| 610 | |
| 611 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 612 | <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] | 613 | <pre>Creates a task and adds it to a queue. |
| 614 | |
| 615 | Tasks cannot be updated after creation; there is no UpdateTask command. |
| 616 | |
| 617 | * For App Engine queues, the maximum task size is |
| 618 | 100KB. |
| 619 | * For pull queues, the maximum task size is 1MB. |
| 620 | |
| 621 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 622 | parent: string, Required. The queue name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 623 | `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` |
| 624 | |
| 625 | The queue must already exist. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 626 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 627 | The object takes the form of: |
| 628 | |
| 629 | { # Request message for CreateTask. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 630 | "responseView": "A String", # The response_view specifies which subset of the Task will be |
| 631 | # returned. |
| 632 | # |
| 633 | # By default response_view is BASIC; not all |
| 634 | # information is retrieved by default because some data, such as |
| 635 | # payloads, might be desirable to return only when needed because |
| 636 | # of its large size or because of the sensitivity of data that it |
| 637 | # contains. |
| 638 | # |
| 639 | # Authorization for FULL requires |
| 640 | # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) |
| 641 | # permission on the Task resource. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 642 | "task": { # A unit of scheduled work. # Required. The task to add. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 643 | # |
| 644 | # Task names have the following format: |
| 645 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`. |
| 646 | # The user can optionally specify a task name. If a |
| 647 | # name is not specified then the system will generate a random |
| 648 | # unique task id, which will be set in the task returned in the |
| 649 | # response. |
| 650 | # |
| 651 | # If schedule_time is not set or is in the |
| 652 | # past then Cloud Tasks will set it to the current time. |
| 653 | # |
| 654 | # Task De-duplication: |
| 655 | # |
| 656 | # Explicitly specifying a task ID enables task de-duplication. If |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 657 | # 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] | 658 | # that was deleted or completed recently then the call will fail |
| 659 | # with ALREADY_EXISTS. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 660 | # If the task's queue was created using Cloud Tasks, then another task with |
| 661 | # the same name can't be created for ~1hour after the original task was |
| 662 | # deleted or completed. If the task's queue was created using queue.yaml or |
| 663 | # 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] | 664 | # for ~9days after the original task was deleted or completed. |
| 665 | # |
| 666 | # Because there is an extra lookup cost to identify duplicate task |
| 667 | # names, these CreateTask calls have significantly |
| 668 | # increased latency. Using hashed strings for the task id or for |
| 669 | # the prefix of the task id is recommended. Choosing task ids that |
| 670 | # are sequential or have sequential prefixes, for example using a |
| 671 | # timestamp, causes an increase in latency and error rates in all |
| 672 | # task commands. The infrastructure relies on an approximately |
| 673 | # uniform distribution of task ids to store and serve tasks |
| 674 | # efficiently. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 675 | "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 676 | # be set only if |
| 677 | # app_engine_http_target is set |
| 678 | # on the queue. |
| 679 | # |
| 680 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 681 | # |
| 682 | # The message defines the HTTP request that is sent to an App Engine app when |
| 683 | # the task is dispatched. |
| 684 | # |
| 685 | # This proto can only be used for tasks in a queue which has |
| 686 | # app_engine_http_target set. |
| 687 | # |
| 688 | # Using AppEngineHttpRequest requires |
| 689 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 690 | # Google IAM permission for the project |
| 691 | # and the following scope: |
| 692 | # |
| 693 | # `https://www.googleapis.com/auth/cloud-platform` |
| 694 | # |
| 695 | # The task will be delivered to the App Engine app which belongs to the same |
| 696 | # project as the queue. For more information, see |
| 697 | # [How Requests are |
| 698 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 699 | # and how routing is affected by |
| 700 | # [dispatch |
| 701 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 702 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 703 | # Because this traffic is carried over a communication mechanism internal to |
| 704 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 705 | # The request to the handler, however, will appear to have used the HTTP |
| 706 | # protocol. |
| 707 | # |
| 708 | # The AppEngineRouting used to construct the URL that the task is |
| 709 | # delivered to can be set at the queue-level or task-level: |
| 710 | # |
| 711 | # * If set, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 712 | # app_engine_routing_override |
| 713 | # is used for all tasks in the queue, no matter what the setting |
| 714 | # is for the |
| 715 | # task-level app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 716 | # |
| 717 | # |
| 718 | # The `url` that the task will be sent to is: |
| 719 | # |
| 720 | # * `url =` host `+` |
| 721 | # relative_url |
| 722 | # |
| 723 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 724 | # URIs restricted with |
| 725 | # [`login: |
| 726 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 727 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 728 | # restricted with |
| 729 | # [`login: |
| 730 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 731 | # Task dispatches also do not follow redirects. |
| 732 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 733 | # 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] | 734 | # 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] | 735 | # 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] | 736 | # not receive response before the deadline. Failed |
| 737 | # tasks will be retried according to the |
| 738 | # retry configuration. `503` (Service Unavailable) is |
| 739 | # 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] | 740 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 741 | # 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] | 742 | # Requests) response from an app handler does not cause traffic congestion |
| 743 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 744 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 745 | # |
| 746 | # If set, |
| 747 | # app_engine_routing_override |
| 748 | # is used for all tasks in the queue, no matter what the setting is for the |
| 749 | # task-level app_engine_routing. |
| 750 | # |
| 751 | # Defines routing characteristics specific to App Engine - service, version, |
| 752 | # and instance. |
| 753 | # |
| 754 | # For more information about services, versions, and instances see |
| 755 | # [An Overview of App |
| 756 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 757 | # [Microservices Architecture on Google App |
| 758 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 759 | # [App Engine Standard request |
| 760 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 761 | # and [App Engine Flex request |
| 762 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 763 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 764 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 765 | # By default, the task is sent to the service which is the default |
| 766 | # service when the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 767 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 768 | # For some queues or tasks which were created using the App Engine |
| 769 | # Task Queue API, host is not parsable |
| 770 | # into service, |
| 771 | # version, and |
| 772 | # instance. For example, some tasks |
| 773 | # which were created using the App Engine SDK use a custom domain |
| 774 | # name; custom domains are not parsed by Cloud Tasks. If |
| 775 | # host is not parsable, then |
| 776 | # service, |
| 777 | # version, and |
| 778 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 779 | "version": "A String", # App version. |
| 780 | # |
| 781 | # By default, the task is sent to the version which is the default |
| 782 | # version when the task is attempted. |
| 783 | # |
| 784 | # For some queues or tasks which were created using the App Engine |
| 785 | # Task Queue API, host is not parsable |
| 786 | # into service, |
| 787 | # version, and |
| 788 | # instance. For example, some tasks |
| 789 | # which were created using the App Engine SDK use a custom domain |
| 790 | # name; custom domains are not parsed by Cloud Tasks. If |
| 791 | # host is not parsable, then |
| 792 | # service, |
| 793 | # version, and |
| 794 | # instance are the empty string. |
| 795 | "host": "A String", # Output only. The host that the task is sent to. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 796 | # |
| 797 | # For more information, see |
| 798 | # [How Requests are |
| 799 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
| 800 | # |
| 801 | # The host is constructed as: |
| 802 | # |
| 803 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 804 | # * `host = [application_domain_name]`</br> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 805 | # `| [service] + '.' + [application_domain_name]`</br> |
| 806 | # `| [version] + '.' + [application_domain_name]`</br> |
| 807 | # `| [version_dot_service]+ '.' + [application_domain_name]`</br> |
| 808 | # `| [instance] + '.' + [application_domain_name]`</br> |
| 809 | # `| [instance_dot_service] + '.' + [application_domain_name]`</br> |
| 810 | # `| [instance_dot_version] + '.' + [application_domain_name]`</br> |
| 811 | # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 812 | # |
| 813 | # * `application_domain_name` = The domain name of the app, for |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 814 | # example <app-id>.appspot.com, which is associated with the |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 815 | # queue's project ID. Some tasks which were created using the App Engine |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 816 | # SDK use a custom domain name. |
| 817 | # |
| 818 | # * `service =` service |
| 819 | # |
| 820 | # * `version =` version |
| 821 | # |
| 822 | # * `version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 823 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 824 | # service |
| 825 | # |
| 826 | # * `instance =` instance |
| 827 | # |
| 828 | # * `instance_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 829 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 830 | # service |
| 831 | # |
| 832 | # * `instance_dot_version =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 833 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 834 | # version |
| 835 | # |
| 836 | # * `instance_dot_version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 837 | # instance `+ '.' +` |
| 838 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 839 | # service |
| 840 | # |
| 841 | # If service is empty, then the task will be sent |
| 842 | # to the service which is the default service when the task is attempted. |
| 843 | # |
| 844 | # If version is empty, then the task will be sent |
| 845 | # to the version which is the default version when the task is attempted. |
| 846 | # |
| 847 | # If instance is empty, then the task |
| 848 | # will be sent to an instance which is available when the task is |
| 849 | # attempted. |
| 850 | # |
| 851 | # If service, |
| 852 | # version, or |
| 853 | # instance is invalid, then the task |
| 854 | # will be sent to the default version of the default service when |
| 855 | # the task is attempted. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 856 | "instance": "A String", # App instance. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 857 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 858 | # By default, the task is sent to an instance which is available when |
| 859 | # the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 860 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 861 | # Requests can only be sent to a specific instance if |
| 862 | # [manual scaling is used in App Engine |
| 863 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 864 | # App Engine Flex does not support instances. For more information, see |
| 865 | # [App Engine Standard request |
| 866 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 867 | # and [App Engine Flex request |
| 868 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 869 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 870 | "headers": { # HTTP request headers. |
| 871 | # |
| 872 | # This map contains the header field names and values. |
| 873 | # Headers can be set when the |
| 874 | # task is created. |
| 875 | # Repeated headers are not supported but a header value can contain commas. |
| 876 | # |
| 877 | # Cloud Tasks sets some headers to default values: |
| 878 | # |
| 879 | # * `User-Agent`: By default, this header is |
| 880 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
| 881 | # This header can be modified, but Cloud Tasks will append |
| 882 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
| 883 | # modified `User-Agent`. |
| 884 | # |
| 885 | # If the task has a payload, Cloud |
| 886 | # Tasks sets the following headers: |
| 887 | # |
| 888 | # * `Content-Type`: By default, the `Content-Type` header is set to |
| 889 | # `"application/octet-stream"`. The default can be overridden by explicitly |
| 890 | # setting `Content-Type` to a particular media type when the |
| 891 | # task is created. |
| 892 | # For example, `Content-Type` can be set to `"application/json"`. |
| 893 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 894 | # output only. It cannot be changed. |
| 895 | # |
| 896 | # The headers below cannot be set or overridden: |
| 897 | # |
| 898 | # * `Host` |
| 899 | # * `X-Google-*` |
| 900 | # * `X-AppEngine-*` |
| 901 | # |
| 902 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 903 | # such as headers containing information about the task; see |
| 904 | # [request |
| 905 | # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). |
| 906 | # These headers are set only when the task is dispatched, so they are not |
| 907 | # visible when the task is returned in a Cloud Tasks response. |
| 908 | # |
| 909 | # Although there is no specific limit for the maximum number of headers or |
| 910 | # the size, there is a limit on the maximum size of the Task. For more |
| 911 | # information, see the CreateTask documentation. |
| 912 | "a_key": "A String", |
| 913 | }, |
| 914 | "relativeUrl": "A String", # The relative URL. |
| 915 | # |
| 916 | # The relative URL must begin with "/" and must be a valid HTTP relative URL. |
| 917 | # It can contain a path and query string arguments. |
| 918 | # If the relative URL is empty, then the root path "/" will be used. |
| 919 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 920 | "payload": "A String", # Payload. |
| 921 | # |
| 922 | # The payload will be sent as the HTTP message body. A message |
| 923 | # body, and thus a payload, is allowed only if the HTTP method is |
| 924 | # POST or PUT. It is an error to set a data payload on a task with |
| 925 | # an incompatible HttpMethod. |
| 926 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 927 | # |
| 928 | # The app's request handler for the task's target URL must be able to handle |
| 929 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 930 | # error code 405 (Method Not Allowed). See [Writing a push task request |
| 931 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
| 932 | # and the App Engine documentation for your runtime on [How Requests are |
| 933 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 934 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 935 | "status": { # Status of the task. # Output only. The task status. |
| 936 | "attemptDispatchCount": 42, # Output only. The number of attempts dispatched. |
| 937 | # |
| 938 | # This count includes attempts which have been dispatched but haven't |
| 939 | # received a response. |
| 940 | "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 941 | # |
| 942 | # Only dispatch_time will be set. |
| 943 | # The other AttemptStatus information is not retained by Cloud Tasks. |
| 944 | # |
| 945 | # This field is not calculated for pull tasks. |
| 946 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 947 | # |
| 948 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 949 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 950 | # |
| 951 | # If the task has not been attempted or the task is currently running |
| 952 | # then the response status is unset. |
| 953 | # different programming environments, including REST APIs and RPC APIs. It is |
| 954 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 955 | # three pieces of data: error code, error message, and error details. |
| 956 | # |
| 957 | # You can find out more about this error model and how to work with it in the |
| 958 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 959 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 960 | # user-facing error message should be localized and sent in the |
| 961 | # google.rpc.Status.details field, or localized by the client. |
| 962 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 963 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 964 | # message types for APIs to use. |
| 965 | { |
| 966 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 967 | }, |
| 968 | ], |
| 969 | }, |
| 970 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 971 | # |
| 972 | # `response_time` will be truncated to the nearest microsecond. |
| 973 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 974 | # |
| 975 | # `schedule_time` will be truncated to the nearest microsecond. |
| 976 | }, |
| 977 | "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 978 | # |
| 979 | # This field is not calculated for pull tasks. |
| 980 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 981 | # |
| 982 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 983 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 984 | # |
| 985 | # If the task has not been attempted or the task is currently running |
| 986 | # then the response status is unset. |
| 987 | # different programming environments, including REST APIs and RPC APIs. It is |
| 988 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 989 | # three pieces of data: error code, error message, and error details. |
| 990 | # |
| 991 | # You can find out more about this error model and how to work with it in the |
| 992 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 993 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 994 | # user-facing error message should be localized and sent in the |
| 995 | # google.rpc.Status.details field, or localized by the client. |
| 996 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 997 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 998 | # message types for APIs to use. |
| 999 | { |
| 1000 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 1001 | }, |
| 1002 | ], |
| 1003 | }, |
| 1004 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 1005 | # |
| 1006 | # `response_time` will be truncated to the nearest microsecond. |
| 1007 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 1008 | # |
| 1009 | # `schedule_time` will be truncated to the nearest microsecond. |
| 1010 | }, |
| 1011 | "attemptResponseCount": 42, # Output only. The number of attempts which have received a response. |
| 1012 | # |
| 1013 | # This field is not calculated for pull tasks. |
| 1014 | }, |
| 1015 | "createTime": "A String", # Output only. The time that the task was created. |
| 1016 | # |
| 1017 | # `create_time` will be truncated to the nearest second. |
| 1018 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 1019 | # |
| 1020 | # The task name. |
| 1021 | # |
| 1022 | # The task name must have the following format: |
| 1023 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 1024 | # |
| 1025 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 1026 | # hyphens (-), colons (:), or periods (.). |
| 1027 | # For more information, see |
| 1028 | # [Identifying |
| 1029 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 1030 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 1031 | # The list of available locations can be obtained by calling |
| 1032 | # ListLocations. |
| 1033 | # For more information, see https://cloud.google.com/about/locations/. |
| 1034 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 1035 | # hyphens (-). The maximum length is 100 characters. |
| 1036 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 1037 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1038 | "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be |
| 1039 | # set only if pull_target is set on the queue. |
| 1040 | # |
| 1041 | # A pull task is a task that has PullMessage set. |
| 1042 | # LeaseTasks to process the task. |
| 1043 | # |
| 1044 | # This proto can only be used for tasks in a queue which has |
| 1045 | # pull_target set. |
| 1046 | "payload": "A String", # A data payload consumed by the worker to execute the task. |
| 1047 | "tag": "A String", # The task's tag. |
| 1048 | # |
| 1049 | # Tags allow similar tasks to be processed in a batch. If you label |
| 1050 | # tasks with a tag, your worker can |
| 1051 | # lease tasks with the same tag using |
| 1052 | # filter. For example, if you want to |
| 1053 | # aggregate the events associated with a specific user once a day, |
| 1054 | # you could tag tasks with the user ID. |
| 1055 | # |
| 1056 | # The task's tag can only be set when the |
| 1057 | # task is created. |
| 1058 | # |
| 1059 | # The tag must be less than 500 characters. |
| 1060 | # |
| 1061 | # SDK compatibility: Although the SDK allows tags to be either |
| 1062 | # string or |
| 1063 | # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), |
| 1064 | # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 |
| 1065 | # encoded, the tag will be empty when the task is returned by Cloud Tasks. |
| 1066 | }, |
| 1067 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted. |
| 1068 | # |
| 1069 | # For App Engine queues, this is when the task will be attempted or retried. |
| 1070 | # |
| 1071 | # For pull queues, this is the time when the task is available to |
| 1072 | # be leased; if a task is currently leased, this is the time when |
| 1073 | # the current lease expires, that is, the time that the task was |
| 1074 | # leased plus the lease_duration. |
| 1075 | # |
| 1076 | # `schedule_time` will be truncated to the nearest microsecond. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1077 | "view": "A String", # Output only. The view specifies which subset of the Task has |
| 1078 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1079 | }, |
| 1080 | } |
| 1081 | |
| 1082 | x__xgafv: string, V1 error format. |
| 1083 | Allowed values |
| 1084 | 1 - v1 error format |
| 1085 | 2 - v2 error format |
| 1086 | |
| 1087 | Returns: |
| 1088 | An object of the form: |
| 1089 | |
| 1090 | { # A unit of scheduled work. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1091 | "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1092 | # be set only if |
| 1093 | # app_engine_http_target is set |
| 1094 | # on the queue. |
| 1095 | # |
| 1096 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 1097 | # |
| 1098 | # The message defines the HTTP request that is sent to an App Engine app when |
| 1099 | # the task is dispatched. |
| 1100 | # |
| 1101 | # This proto can only be used for tasks in a queue which has |
| 1102 | # app_engine_http_target set. |
| 1103 | # |
| 1104 | # Using AppEngineHttpRequest requires |
| 1105 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 1106 | # Google IAM permission for the project |
| 1107 | # and the following scope: |
| 1108 | # |
| 1109 | # `https://www.googleapis.com/auth/cloud-platform` |
| 1110 | # |
| 1111 | # The task will be delivered to the App Engine app which belongs to the same |
| 1112 | # project as the queue. For more information, see |
| 1113 | # [How Requests are |
| 1114 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 1115 | # and how routing is affected by |
| 1116 | # [dispatch |
| 1117 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 1118 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 1119 | # Because this traffic is carried over a communication mechanism internal to |
| 1120 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 1121 | # The request to the handler, however, will appear to have used the HTTP |
| 1122 | # protocol. |
| 1123 | # |
| 1124 | # The AppEngineRouting used to construct the URL that the task is |
| 1125 | # delivered to can be set at the queue-level or task-level: |
| 1126 | # |
| 1127 | # * If set, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1128 | # app_engine_routing_override |
| 1129 | # is used for all tasks in the queue, no matter what the setting |
| 1130 | # is for the |
| 1131 | # task-level app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1132 | # |
| 1133 | # |
| 1134 | # The `url` that the task will be sent to is: |
| 1135 | # |
| 1136 | # * `url =` host `+` |
| 1137 | # relative_url |
| 1138 | # |
| 1139 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 1140 | # URIs restricted with |
| 1141 | # [`login: |
| 1142 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 1143 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 1144 | # restricted with |
| 1145 | # [`login: |
| 1146 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 1147 | # Task dispatches also do not follow redirects. |
| 1148 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1149 | # 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] | 1150 | # 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] | 1151 | # 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] | 1152 | # not receive response before the deadline. Failed |
| 1153 | # tasks will be retried according to the |
| 1154 | # retry configuration. `503` (Service Unavailable) is |
| 1155 | # 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] | 1156 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 1157 | # 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] | 1158 | # Requests) response from an app handler does not cause traffic congestion |
| 1159 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1160 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1161 | # |
| 1162 | # If set, |
| 1163 | # app_engine_routing_override |
| 1164 | # is used for all tasks in the queue, no matter what the setting is for the |
| 1165 | # task-level app_engine_routing. |
| 1166 | # |
| 1167 | # Defines routing characteristics specific to App Engine - service, version, |
| 1168 | # and instance. |
| 1169 | # |
| 1170 | # For more information about services, versions, and instances see |
| 1171 | # [An Overview of App |
| 1172 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 1173 | # [Microservices Architecture on Google App |
| 1174 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 1175 | # [App Engine Standard request |
| 1176 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 1177 | # and [App Engine Flex request |
| 1178 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1179 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1180 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1181 | # By default, the task is sent to the service which is the default |
| 1182 | # service when the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1183 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1184 | # For some queues or tasks which were created using the App Engine |
| 1185 | # Task Queue API, host is not parsable |
| 1186 | # into service, |
| 1187 | # version, and |
| 1188 | # instance. For example, some tasks |
| 1189 | # which were created using the App Engine SDK use a custom domain |
| 1190 | # name; custom domains are not parsed by Cloud Tasks. If |
| 1191 | # host is not parsable, then |
| 1192 | # service, |
| 1193 | # version, and |
| 1194 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1195 | "version": "A String", # App version. |
| 1196 | # |
| 1197 | # By default, the task is sent to the version which is the default |
| 1198 | # version when the task is attempted. |
| 1199 | # |
| 1200 | # For some queues or tasks which were created using the App Engine |
| 1201 | # Task Queue API, host is not parsable |
| 1202 | # into service, |
| 1203 | # version, and |
| 1204 | # instance. For example, some tasks |
| 1205 | # which were created using the App Engine SDK use a custom domain |
| 1206 | # name; custom domains are not parsed by Cloud Tasks. If |
| 1207 | # host is not parsable, then |
| 1208 | # service, |
| 1209 | # version, and |
| 1210 | # instance are the empty string. |
| 1211 | "host": "A String", # Output only. The host that the task is sent to. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1212 | # |
| 1213 | # For more information, see |
| 1214 | # [How Requests are |
| 1215 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
| 1216 | # |
| 1217 | # The host is constructed as: |
| 1218 | # |
| 1219 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1220 | # * `host = [application_domain_name]`</br> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1221 | # `| [service] + '.' + [application_domain_name]`</br> |
| 1222 | # `| [version] + '.' + [application_domain_name]`</br> |
| 1223 | # `| [version_dot_service]+ '.' + [application_domain_name]`</br> |
| 1224 | # `| [instance] + '.' + [application_domain_name]`</br> |
| 1225 | # `| [instance_dot_service] + '.' + [application_domain_name]`</br> |
| 1226 | # `| [instance_dot_version] + '.' + [application_domain_name]`</br> |
| 1227 | # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1228 | # |
| 1229 | # * `application_domain_name` = The domain name of the app, for |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1230 | # example <app-id>.appspot.com, which is associated with the |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1231 | # queue's project ID. Some tasks which were created using the App Engine |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1232 | # SDK use a custom domain name. |
| 1233 | # |
| 1234 | # * `service =` service |
| 1235 | # |
| 1236 | # * `version =` version |
| 1237 | # |
| 1238 | # * `version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1239 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1240 | # service |
| 1241 | # |
| 1242 | # * `instance =` instance |
| 1243 | # |
| 1244 | # * `instance_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1245 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1246 | # service |
| 1247 | # |
| 1248 | # * `instance_dot_version =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1249 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1250 | # version |
| 1251 | # |
| 1252 | # * `instance_dot_version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1253 | # instance `+ '.' +` |
| 1254 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1255 | # service |
| 1256 | # |
| 1257 | # If service is empty, then the task will be sent |
| 1258 | # to the service which is the default service when the task is attempted. |
| 1259 | # |
| 1260 | # If version is empty, then the task will be sent |
| 1261 | # to the version which is the default version when the task is attempted. |
| 1262 | # |
| 1263 | # If instance is empty, then the task |
| 1264 | # will be sent to an instance which is available when the task is |
| 1265 | # attempted. |
| 1266 | # |
| 1267 | # If service, |
| 1268 | # version, or |
| 1269 | # instance is invalid, then the task |
| 1270 | # will be sent to the default version of the default service when |
| 1271 | # the task is attempted. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1272 | "instance": "A String", # App instance. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1273 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1274 | # By default, the task is sent to an instance which is available when |
| 1275 | # the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1276 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1277 | # Requests can only be sent to a specific instance if |
| 1278 | # [manual scaling is used in App Engine |
| 1279 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 1280 | # App Engine Flex does not support instances. For more information, see |
| 1281 | # [App Engine Standard request |
| 1282 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 1283 | # and [App Engine Flex request |
| 1284 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1285 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1286 | "headers": { # HTTP request headers. |
| 1287 | # |
| 1288 | # This map contains the header field names and values. |
| 1289 | # Headers can be set when the |
| 1290 | # task is created. |
| 1291 | # Repeated headers are not supported but a header value can contain commas. |
| 1292 | # |
| 1293 | # Cloud Tasks sets some headers to default values: |
| 1294 | # |
| 1295 | # * `User-Agent`: By default, this header is |
| 1296 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
| 1297 | # This header can be modified, but Cloud Tasks will append |
| 1298 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
| 1299 | # modified `User-Agent`. |
| 1300 | # |
| 1301 | # If the task has a payload, Cloud |
| 1302 | # Tasks sets the following headers: |
| 1303 | # |
| 1304 | # * `Content-Type`: By default, the `Content-Type` header is set to |
| 1305 | # `"application/octet-stream"`. The default can be overridden by explicitly |
| 1306 | # setting `Content-Type` to a particular media type when the |
| 1307 | # task is created. |
| 1308 | # For example, `Content-Type` can be set to `"application/json"`. |
| 1309 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 1310 | # output only. It cannot be changed. |
| 1311 | # |
| 1312 | # The headers below cannot be set or overridden: |
| 1313 | # |
| 1314 | # * `Host` |
| 1315 | # * `X-Google-*` |
| 1316 | # * `X-AppEngine-*` |
| 1317 | # |
| 1318 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 1319 | # such as headers containing information about the task; see |
| 1320 | # [request |
| 1321 | # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). |
| 1322 | # These headers are set only when the task is dispatched, so they are not |
| 1323 | # visible when the task is returned in a Cloud Tasks response. |
| 1324 | # |
| 1325 | # Although there is no specific limit for the maximum number of headers or |
| 1326 | # the size, there is a limit on the maximum size of the Task. For more |
| 1327 | # information, see the CreateTask documentation. |
| 1328 | "a_key": "A String", |
| 1329 | }, |
| 1330 | "relativeUrl": "A String", # The relative URL. |
| 1331 | # |
| 1332 | # The relative URL must begin with "/" and must be a valid HTTP relative URL. |
| 1333 | # It can contain a path and query string arguments. |
| 1334 | # If the relative URL is empty, then the root path "/" will be used. |
| 1335 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 1336 | "payload": "A String", # Payload. |
| 1337 | # |
| 1338 | # The payload will be sent as the HTTP message body. A message |
| 1339 | # body, and thus a payload, is allowed only if the HTTP method is |
| 1340 | # POST or PUT. It is an error to set a data payload on a task with |
| 1341 | # an incompatible HttpMethod. |
| 1342 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 1343 | # |
| 1344 | # The app's request handler for the task's target URL must be able to handle |
| 1345 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 1346 | # error code 405 (Method Not Allowed). See [Writing a push task request |
| 1347 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
| 1348 | # and the App Engine documentation for your runtime on [How Requests are |
| 1349 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1350 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1351 | "status": { # Status of the task. # Output only. The task status. |
| 1352 | "attemptDispatchCount": 42, # Output only. The number of attempts dispatched. |
| 1353 | # |
| 1354 | # This count includes attempts which have been dispatched but haven't |
| 1355 | # received a response. |
| 1356 | "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 1357 | # |
| 1358 | # Only dispatch_time will be set. |
| 1359 | # The other AttemptStatus information is not retained by Cloud Tasks. |
| 1360 | # |
| 1361 | # This field is not calculated for pull tasks. |
| 1362 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 1363 | # |
| 1364 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 1365 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 1366 | # |
| 1367 | # If the task has not been attempted or the task is currently running |
| 1368 | # then the response status is unset. |
| 1369 | # different programming environments, including REST APIs and RPC APIs. It is |
| 1370 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 1371 | # three pieces of data: error code, error message, and error details. |
| 1372 | # |
| 1373 | # You can find out more about this error model and how to work with it in the |
| 1374 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 1375 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 1376 | # user-facing error message should be localized and sent in the |
| 1377 | # google.rpc.Status.details field, or localized by the client. |
| 1378 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 1379 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 1380 | # message types for APIs to use. |
| 1381 | { |
| 1382 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 1383 | }, |
| 1384 | ], |
| 1385 | }, |
| 1386 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 1387 | # |
| 1388 | # `response_time` will be truncated to the nearest microsecond. |
| 1389 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 1390 | # |
| 1391 | # `schedule_time` will be truncated to the nearest microsecond. |
| 1392 | }, |
| 1393 | "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 1394 | # |
| 1395 | # This field is not calculated for pull tasks. |
| 1396 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 1397 | # |
| 1398 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 1399 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 1400 | # |
| 1401 | # If the task has not been attempted or the task is currently running |
| 1402 | # then the response status is unset. |
| 1403 | # different programming environments, including REST APIs and RPC APIs. It is |
| 1404 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 1405 | # three pieces of data: error code, error message, and error details. |
| 1406 | # |
| 1407 | # You can find out more about this error model and how to work with it in the |
| 1408 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 1409 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 1410 | # user-facing error message should be localized and sent in the |
| 1411 | # google.rpc.Status.details field, or localized by the client. |
| 1412 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 1413 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 1414 | # message types for APIs to use. |
| 1415 | { |
| 1416 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 1417 | }, |
| 1418 | ], |
| 1419 | }, |
| 1420 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 1421 | # |
| 1422 | # `response_time` will be truncated to the nearest microsecond. |
| 1423 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 1424 | # |
| 1425 | # `schedule_time` will be truncated to the nearest microsecond. |
| 1426 | }, |
| 1427 | "attemptResponseCount": 42, # Output only. The number of attempts which have received a response. |
| 1428 | # |
| 1429 | # This field is not calculated for pull tasks. |
| 1430 | }, |
| 1431 | "createTime": "A String", # Output only. The time that the task was created. |
| 1432 | # |
| 1433 | # `create_time` will be truncated to the nearest second. |
| 1434 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 1435 | # |
| 1436 | # The task name. |
| 1437 | # |
| 1438 | # The task name must have the following format: |
| 1439 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 1440 | # |
| 1441 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 1442 | # hyphens (-), colons (:), or periods (.). |
| 1443 | # For more information, see |
| 1444 | # [Identifying |
| 1445 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 1446 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 1447 | # The list of available locations can be obtained by calling |
| 1448 | # ListLocations. |
| 1449 | # For more information, see https://cloud.google.com/about/locations/. |
| 1450 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 1451 | # hyphens (-). The maximum length is 100 characters. |
| 1452 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 1453 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1454 | "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be |
| 1455 | # set only if pull_target is set on the queue. |
| 1456 | # |
| 1457 | # A pull task is a task that has PullMessage set. |
| 1458 | # LeaseTasks to process the task. |
| 1459 | # |
| 1460 | # This proto can only be used for tasks in a queue which has |
| 1461 | # pull_target set. |
| 1462 | "payload": "A String", # A data payload consumed by the worker to execute the task. |
| 1463 | "tag": "A String", # The task's tag. |
| 1464 | # |
| 1465 | # Tags allow similar tasks to be processed in a batch. If you label |
| 1466 | # tasks with a tag, your worker can |
| 1467 | # lease tasks with the same tag using |
| 1468 | # filter. For example, if you want to |
| 1469 | # aggregate the events associated with a specific user once a day, |
| 1470 | # you could tag tasks with the user ID. |
| 1471 | # |
| 1472 | # The task's tag can only be set when the |
| 1473 | # task is created. |
| 1474 | # |
| 1475 | # The tag must be less than 500 characters. |
| 1476 | # |
| 1477 | # SDK compatibility: Although the SDK allows tags to be either |
| 1478 | # string or |
| 1479 | # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), |
| 1480 | # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 |
| 1481 | # encoded, the tag will be empty when the task is returned by Cloud Tasks. |
| 1482 | }, |
| 1483 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted. |
| 1484 | # |
| 1485 | # For App Engine queues, this is when the task will be attempted or retried. |
| 1486 | # |
| 1487 | # For pull queues, this is the time when the task is available to |
| 1488 | # be leased; if a task is currently leased, this is the time when |
| 1489 | # the current lease expires, that is, the time that the task was |
| 1490 | # leased plus the lease_duration. |
| 1491 | # |
| 1492 | # `schedule_time` will be truncated to the nearest microsecond. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1493 | "view": "A String", # Output only. The view specifies which subset of the Task has |
| 1494 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1495 | }</pre> |
| 1496 | </div> |
| 1497 | |
| 1498 | <div class="method"> |
| 1499 | <code class="details" id="delete">delete(name, x__xgafv=None)</code> |
| 1500 | <pre>Deletes a task. |
| 1501 | |
| 1502 | A task can be deleted if it is scheduled or dispatched. A task |
| 1503 | cannot be deleted if it has completed successfully or permanently |
| 1504 | failed. |
| 1505 | |
| 1506 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1507 | name: string, Required. The task name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1508 | `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required) |
| 1509 | x__xgafv: string, V1 error format. |
| 1510 | Allowed values |
| 1511 | 1 - v1 error format |
| 1512 | 2 - v2 error format |
| 1513 | |
| 1514 | Returns: |
| 1515 | An object of the form: |
| 1516 | |
| 1517 | { # A generic empty message that you can re-use to avoid defining duplicated |
| 1518 | # empty messages in your APIs. A typical example is to use it as the request |
| 1519 | # or the response type of an API method. For instance: |
| 1520 | # |
| 1521 | # service Foo { |
| 1522 | # rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 1523 | # } |
| 1524 | # |
| 1525 | # The JSON representation for `Empty` is empty JSON object `{}`. |
| 1526 | }</pre> |
| 1527 | </div> |
| 1528 | |
| 1529 | <div class="method"> |
| 1530 | <code class="details" id="get">get(name, responseView=None, x__xgafv=None)</code> |
| 1531 | <pre>Gets a task. |
| 1532 | |
| 1533 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1534 | name: string, Required. The task name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1535 | `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` (required) |
| 1536 | responseView: string, The response_view specifies which subset of the Task will be |
| 1537 | returned. |
| 1538 | |
| 1539 | By default response_view is BASIC; not all |
| 1540 | information is retrieved by default because some data, such as |
| 1541 | payloads, might be desirable to return only when needed because |
| 1542 | of its large size or because of the sensitivity of data that it |
| 1543 | contains. |
| 1544 | |
| 1545 | Authorization for FULL requires |
| 1546 | `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) |
| 1547 | permission on the Task resource. |
| 1548 | x__xgafv: string, V1 error format. |
| 1549 | Allowed values |
| 1550 | 1 - v1 error format |
| 1551 | 2 - v2 error format |
| 1552 | |
| 1553 | Returns: |
| 1554 | An object of the form: |
| 1555 | |
| 1556 | { # A unit of scheduled work. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1557 | "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1558 | # be set only if |
| 1559 | # app_engine_http_target is set |
| 1560 | # on the queue. |
| 1561 | # |
| 1562 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 1563 | # |
| 1564 | # The message defines the HTTP request that is sent to an App Engine app when |
| 1565 | # the task is dispatched. |
| 1566 | # |
| 1567 | # This proto can only be used for tasks in a queue which has |
| 1568 | # app_engine_http_target set. |
| 1569 | # |
| 1570 | # Using AppEngineHttpRequest requires |
| 1571 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 1572 | # Google IAM permission for the project |
| 1573 | # and the following scope: |
| 1574 | # |
| 1575 | # `https://www.googleapis.com/auth/cloud-platform` |
| 1576 | # |
| 1577 | # The task will be delivered to the App Engine app which belongs to the same |
| 1578 | # project as the queue. For more information, see |
| 1579 | # [How Requests are |
| 1580 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 1581 | # and how routing is affected by |
| 1582 | # [dispatch |
| 1583 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 1584 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 1585 | # Because this traffic is carried over a communication mechanism internal to |
| 1586 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 1587 | # The request to the handler, however, will appear to have used the HTTP |
| 1588 | # protocol. |
| 1589 | # |
| 1590 | # The AppEngineRouting used to construct the URL that the task is |
| 1591 | # delivered to can be set at the queue-level or task-level: |
| 1592 | # |
| 1593 | # * If set, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1594 | # app_engine_routing_override |
| 1595 | # is used for all tasks in the queue, no matter what the setting |
| 1596 | # is for the |
| 1597 | # task-level app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1598 | # |
| 1599 | # |
| 1600 | # The `url` that the task will be sent to is: |
| 1601 | # |
| 1602 | # * `url =` host `+` |
| 1603 | # relative_url |
| 1604 | # |
| 1605 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 1606 | # URIs restricted with |
| 1607 | # [`login: |
| 1608 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 1609 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 1610 | # restricted with |
| 1611 | # [`login: |
| 1612 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 1613 | # Task dispatches also do not follow redirects. |
| 1614 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1615 | # 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] | 1616 | # 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] | 1617 | # 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] | 1618 | # not receive response before the deadline. Failed |
| 1619 | # tasks will be retried according to the |
| 1620 | # retry configuration. `503` (Service Unavailable) is |
| 1621 | # 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] | 1622 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 1623 | # 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] | 1624 | # Requests) response from an app handler does not cause traffic congestion |
| 1625 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1626 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1627 | # |
| 1628 | # If set, |
| 1629 | # app_engine_routing_override |
| 1630 | # is used for all tasks in the queue, no matter what the setting is for the |
| 1631 | # task-level app_engine_routing. |
| 1632 | # |
| 1633 | # Defines routing characteristics specific to App Engine - service, version, |
| 1634 | # and instance. |
| 1635 | # |
| 1636 | # For more information about services, versions, and instances see |
| 1637 | # [An Overview of App |
| 1638 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 1639 | # [Microservices Architecture on Google App |
| 1640 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 1641 | # [App Engine Standard request |
| 1642 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 1643 | # and [App Engine Flex request |
| 1644 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1645 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1646 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1647 | # By default, the task is sent to the service which is the default |
| 1648 | # service when the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1649 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1650 | # For some queues or tasks which were created using the App Engine |
| 1651 | # Task Queue API, host is not parsable |
| 1652 | # into service, |
| 1653 | # version, and |
| 1654 | # instance. For example, some tasks |
| 1655 | # which were created using the App Engine SDK use a custom domain |
| 1656 | # name; custom domains are not parsed by Cloud Tasks. If |
| 1657 | # host is not parsable, then |
| 1658 | # service, |
| 1659 | # version, and |
| 1660 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1661 | "version": "A String", # App version. |
| 1662 | # |
| 1663 | # By default, the task is sent to the version which is the default |
| 1664 | # version when the task is attempted. |
| 1665 | # |
| 1666 | # For some queues or tasks which were created using the App Engine |
| 1667 | # Task Queue API, host is not parsable |
| 1668 | # into service, |
| 1669 | # version, and |
| 1670 | # instance. For example, some tasks |
| 1671 | # which were created using the App Engine SDK use a custom domain |
| 1672 | # name; custom domains are not parsed by Cloud Tasks. If |
| 1673 | # host is not parsable, then |
| 1674 | # service, |
| 1675 | # version, and |
| 1676 | # instance are the empty string. |
| 1677 | "host": "A String", # Output only. The host that the task is sent to. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1678 | # |
| 1679 | # For more information, see |
| 1680 | # [How Requests are |
| 1681 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
| 1682 | # |
| 1683 | # The host is constructed as: |
| 1684 | # |
| 1685 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1686 | # * `host = [application_domain_name]`</br> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1687 | # `| [service] + '.' + [application_domain_name]`</br> |
| 1688 | # `| [version] + '.' + [application_domain_name]`</br> |
| 1689 | # `| [version_dot_service]+ '.' + [application_domain_name]`</br> |
| 1690 | # `| [instance] + '.' + [application_domain_name]`</br> |
| 1691 | # `| [instance_dot_service] + '.' + [application_domain_name]`</br> |
| 1692 | # `| [instance_dot_version] + '.' + [application_domain_name]`</br> |
| 1693 | # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1694 | # |
| 1695 | # * `application_domain_name` = The domain name of the app, for |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1696 | # example <app-id>.appspot.com, which is associated with the |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1697 | # queue's project ID. Some tasks which were created using the App Engine |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1698 | # SDK use a custom domain name. |
| 1699 | # |
| 1700 | # * `service =` service |
| 1701 | # |
| 1702 | # * `version =` version |
| 1703 | # |
| 1704 | # * `version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1705 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1706 | # service |
| 1707 | # |
| 1708 | # * `instance =` instance |
| 1709 | # |
| 1710 | # * `instance_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1711 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1712 | # service |
| 1713 | # |
| 1714 | # * `instance_dot_version =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1715 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1716 | # version |
| 1717 | # |
| 1718 | # * `instance_dot_version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1719 | # instance `+ '.' +` |
| 1720 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1721 | # service |
| 1722 | # |
| 1723 | # If service is empty, then the task will be sent |
| 1724 | # to the service which is the default service when the task is attempted. |
| 1725 | # |
| 1726 | # If version is empty, then the task will be sent |
| 1727 | # to the version which is the default version when the task is attempted. |
| 1728 | # |
| 1729 | # If instance is empty, then the task |
| 1730 | # will be sent to an instance which is available when the task is |
| 1731 | # attempted. |
| 1732 | # |
| 1733 | # If service, |
| 1734 | # version, or |
| 1735 | # instance is invalid, then the task |
| 1736 | # will be sent to the default version of the default service when |
| 1737 | # the task is attempted. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1738 | "instance": "A String", # App instance. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1739 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1740 | # By default, the task is sent to an instance which is available when |
| 1741 | # the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1742 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1743 | # Requests can only be sent to a specific instance if |
| 1744 | # [manual scaling is used in App Engine |
| 1745 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 1746 | # App Engine Flex does not support instances. For more information, see |
| 1747 | # [App Engine Standard request |
| 1748 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 1749 | # and [App Engine Flex request |
| 1750 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1751 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1752 | "headers": { # HTTP request headers. |
| 1753 | # |
| 1754 | # This map contains the header field names and values. |
| 1755 | # Headers can be set when the |
| 1756 | # task is created. |
| 1757 | # Repeated headers are not supported but a header value can contain commas. |
| 1758 | # |
| 1759 | # Cloud Tasks sets some headers to default values: |
| 1760 | # |
| 1761 | # * `User-Agent`: By default, this header is |
| 1762 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
| 1763 | # This header can be modified, but Cloud Tasks will append |
| 1764 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
| 1765 | # modified `User-Agent`. |
| 1766 | # |
| 1767 | # If the task has a payload, Cloud |
| 1768 | # Tasks sets the following headers: |
| 1769 | # |
| 1770 | # * `Content-Type`: By default, the `Content-Type` header is set to |
| 1771 | # `"application/octet-stream"`. The default can be overridden by explicitly |
| 1772 | # setting `Content-Type` to a particular media type when the |
| 1773 | # task is created. |
| 1774 | # For example, `Content-Type` can be set to `"application/json"`. |
| 1775 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 1776 | # output only. It cannot be changed. |
| 1777 | # |
| 1778 | # The headers below cannot be set or overridden: |
| 1779 | # |
| 1780 | # * `Host` |
| 1781 | # * `X-Google-*` |
| 1782 | # * `X-AppEngine-*` |
| 1783 | # |
| 1784 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 1785 | # such as headers containing information about the task; see |
| 1786 | # [request |
| 1787 | # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). |
| 1788 | # These headers are set only when the task is dispatched, so they are not |
| 1789 | # visible when the task is returned in a Cloud Tasks response. |
| 1790 | # |
| 1791 | # Although there is no specific limit for the maximum number of headers or |
| 1792 | # the size, there is a limit on the maximum size of the Task. For more |
| 1793 | # information, see the CreateTask documentation. |
| 1794 | "a_key": "A String", |
| 1795 | }, |
| 1796 | "relativeUrl": "A String", # The relative URL. |
| 1797 | # |
| 1798 | # The relative URL must begin with "/" and must be a valid HTTP relative URL. |
| 1799 | # It can contain a path and query string arguments. |
| 1800 | # If the relative URL is empty, then the root path "/" will be used. |
| 1801 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 1802 | "payload": "A String", # Payload. |
| 1803 | # |
| 1804 | # The payload will be sent as the HTTP message body. A message |
| 1805 | # body, and thus a payload, is allowed only if the HTTP method is |
| 1806 | # POST or PUT. It is an error to set a data payload on a task with |
| 1807 | # an incompatible HttpMethod. |
| 1808 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 1809 | # |
| 1810 | # The app's request handler for the task's target URL must be able to handle |
| 1811 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 1812 | # error code 405 (Method Not Allowed). See [Writing a push task request |
| 1813 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
| 1814 | # and the App Engine documentation for your runtime on [How Requests are |
| 1815 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1816 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1817 | "status": { # Status of the task. # Output only. The task status. |
| 1818 | "attemptDispatchCount": 42, # Output only. The number of attempts dispatched. |
| 1819 | # |
| 1820 | # This count includes attempts which have been dispatched but haven't |
| 1821 | # received a response. |
| 1822 | "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 1823 | # |
| 1824 | # Only dispatch_time will be set. |
| 1825 | # The other AttemptStatus information is not retained by Cloud Tasks. |
| 1826 | # |
| 1827 | # This field is not calculated for pull tasks. |
| 1828 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 1829 | # |
| 1830 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 1831 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 1832 | # |
| 1833 | # If the task has not been attempted or the task is currently running |
| 1834 | # then the response status is unset. |
| 1835 | # different programming environments, including REST APIs and RPC APIs. It is |
| 1836 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 1837 | # three pieces of data: error code, error message, and error details. |
| 1838 | # |
| 1839 | # You can find out more about this error model and how to work with it in the |
| 1840 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 1841 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 1842 | # user-facing error message should be localized and sent in the |
| 1843 | # google.rpc.Status.details field, or localized by the client. |
| 1844 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 1845 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 1846 | # message types for APIs to use. |
| 1847 | { |
| 1848 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 1849 | }, |
| 1850 | ], |
| 1851 | }, |
| 1852 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 1853 | # |
| 1854 | # `response_time` will be truncated to the nearest microsecond. |
| 1855 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 1856 | # |
| 1857 | # `schedule_time` will be truncated to the nearest microsecond. |
| 1858 | }, |
| 1859 | "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 1860 | # |
| 1861 | # This field is not calculated for pull tasks. |
| 1862 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 1863 | # |
| 1864 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 1865 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 1866 | # |
| 1867 | # If the task has not been attempted or the task is currently running |
| 1868 | # then the response status is unset. |
| 1869 | # different programming environments, including REST APIs and RPC APIs. It is |
| 1870 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 1871 | # three pieces of data: error code, error message, and error details. |
| 1872 | # |
| 1873 | # You can find out more about this error model and how to work with it in the |
| 1874 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 1875 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 1876 | # user-facing error message should be localized and sent in the |
| 1877 | # google.rpc.Status.details field, or localized by the client. |
| 1878 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 1879 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 1880 | # message types for APIs to use. |
| 1881 | { |
| 1882 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 1883 | }, |
| 1884 | ], |
| 1885 | }, |
| 1886 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 1887 | # |
| 1888 | # `response_time` will be truncated to the nearest microsecond. |
| 1889 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 1890 | # |
| 1891 | # `schedule_time` will be truncated to the nearest microsecond. |
| 1892 | }, |
| 1893 | "attemptResponseCount": 42, # Output only. The number of attempts which have received a response. |
| 1894 | # |
| 1895 | # This field is not calculated for pull tasks. |
| 1896 | }, |
| 1897 | "createTime": "A String", # Output only. The time that the task was created. |
| 1898 | # |
| 1899 | # `create_time` will be truncated to the nearest second. |
| 1900 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 1901 | # |
| 1902 | # The task name. |
| 1903 | # |
| 1904 | # The task name must have the following format: |
| 1905 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 1906 | # |
| 1907 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 1908 | # hyphens (-), colons (:), or periods (.). |
| 1909 | # For more information, see |
| 1910 | # [Identifying |
| 1911 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 1912 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 1913 | # The list of available locations can be obtained by calling |
| 1914 | # ListLocations. |
| 1915 | # For more information, see https://cloud.google.com/about/locations/. |
| 1916 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 1917 | # hyphens (-). The maximum length is 100 characters. |
| 1918 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 1919 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 1920 | "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be |
| 1921 | # set only if pull_target is set on the queue. |
| 1922 | # |
| 1923 | # A pull task is a task that has PullMessage set. |
| 1924 | # LeaseTasks to process the task. |
| 1925 | # |
| 1926 | # This proto can only be used for tasks in a queue which has |
| 1927 | # pull_target set. |
| 1928 | "payload": "A String", # A data payload consumed by the worker to execute the task. |
| 1929 | "tag": "A String", # The task's tag. |
| 1930 | # |
| 1931 | # Tags allow similar tasks to be processed in a batch. If you label |
| 1932 | # tasks with a tag, your worker can |
| 1933 | # lease tasks with the same tag using |
| 1934 | # filter. For example, if you want to |
| 1935 | # aggregate the events associated with a specific user once a day, |
| 1936 | # you could tag tasks with the user ID. |
| 1937 | # |
| 1938 | # The task's tag can only be set when the |
| 1939 | # task is created. |
| 1940 | # |
| 1941 | # The tag must be less than 500 characters. |
| 1942 | # |
| 1943 | # SDK compatibility: Although the SDK allows tags to be either |
| 1944 | # string or |
| 1945 | # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), |
| 1946 | # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 |
| 1947 | # encoded, the tag will be empty when the task is returned by Cloud Tasks. |
| 1948 | }, |
| 1949 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted. |
| 1950 | # |
| 1951 | # For App Engine queues, this is when the task will be attempted or retried. |
| 1952 | # |
| 1953 | # For pull queues, this is the time when the task is available to |
| 1954 | # be leased; if a task is currently leased, this is the time when |
| 1955 | # the current lease expires, that is, the time that the task was |
| 1956 | # leased plus the lease_duration. |
| 1957 | # |
| 1958 | # `schedule_time` will be truncated to the nearest microsecond. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 1959 | "view": "A String", # Output only. The view specifies which subset of the Task has |
| 1960 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1961 | }</pre> |
| 1962 | </div> |
| 1963 | |
| 1964 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1965 | <code class="details" id="lease">lease(parent, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1966 | <pre>Leases tasks from a pull queue for |
| 1967 | lease_duration. |
| 1968 | |
| 1969 | This method is invoked by the worker to obtain a lease. The |
| 1970 | worker must acknowledge the task via |
| 1971 | AcknowledgeTask after they have |
| 1972 | performed the work associated with the task. |
| 1973 | |
| 1974 | The payload is intended to store data that |
| 1975 | the worker needs to perform the work associated with the task. To |
| 1976 | return the payloads in the response, set |
| 1977 | response_view to |
| 1978 | FULL. |
| 1979 | |
| 1980 | A maximum of 10 qps of LeaseTasks |
| 1981 | requests are allowed per |
| 1982 | queue. RESOURCE_EXHAUSTED |
| 1983 | is returned when this limit is |
| 1984 | exceeded. RESOURCE_EXHAUSTED |
| 1985 | is also returned when |
| 1986 | max_tasks_dispatched_per_second |
| 1987 | is exceeded. |
| 1988 | |
| 1989 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1990 | parent: string, Required. The queue name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1991 | `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 1992 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1993 | The object takes the form of: |
| 1994 | |
| 1995 | { # Request message for leasing tasks using LeaseTasks. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 1996 | "responseView": "A String", # The response_view specifies which subset of the Task will be |
| 1997 | # returned. |
| 1998 | # |
| 1999 | # By default response_view is BASIC; not all |
| 2000 | # information is retrieved by default because some data, such as |
| 2001 | # payloads, might be desirable to return only when needed because |
| 2002 | # of its large size or because of the sensitivity of data that it |
| 2003 | # contains. |
| 2004 | # |
| 2005 | # Authorization for FULL requires |
| 2006 | # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) |
| 2007 | # permission on the Task resource. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2008 | "leaseDuration": "A String", # Required. The duration of the lease. |
| 2009 | # |
| 2010 | # Each task returned in the response will |
| 2011 | # have its schedule_time set to the current |
| 2012 | # time plus the `lease_duration`. The task is leased until its |
| 2013 | # schedule_time; thus, the task will not be |
| 2014 | # returned to another LeaseTasks call |
| 2015 | # before its schedule_time. |
| 2016 | # |
| 2017 | # |
| 2018 | # After the worker has successfully finished the work associated |
| 2019 | # with the task, the worker must call via |
| 2020 | # AcknowledgeTask before the |
| 2021 | # schedule_time. Otherwise the task will be |
| 2022 | # returned to a later LeaseTasks call so |
| 2023 | # that another worker can retry it. |
| 2024 | # |
| 2025 | # The maximum lease duration is 1 week. |
| 2026 | # `lease_duration` will be truncated to the nearest second. |
| 2027 | "maxTasks": 42, # The maximum number of tasks to lease. |
| 2028 | # |
| 2029 | # The system will make a best effort to return as close to as |
| 2030 | # `max_tasks` as possible. |
| 2031 | # |
| 2032 | # The largest that `max_tasks` can be is 1000. |
| 2033 | # |
| 2034 | # The maximum total size of a lease tasks response is |
| 2035 | # 32 MB. If the sum of all task sizes requested reaches this limit, |
| 2036 | # fewer tasks than requested are returned. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2037 | "filter": "A String", # `filter` can be used to specify a subset of tasks to lease. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2038 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2039 | # When `filter` is set to `tag=<my-tag>` then the |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2040 | # response will contain only tasks whose |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2041 | # tag is equal to `<my-tag>`. `<my-tag>` must be |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2042 | # less than 500 characters. |
| 2043 | # |
| 2044 | # When `filter` is set to `tag_function=oldest_tag()`, only tasks which have |
| 2045 | # the same tag as the task with the oldest |
| 2046 | # schedule_time will be returned. |
| 2047 | # |
| 2048 | # Grammar Syntax: |
| 2049 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2050 | # * `filter = "tag=" tag | "tag_function=" function` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2051 | # |
| 2052 | # * `tag = string` |
| 2053 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2054 | # * `function = "oldest_tag()"` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2055 | # |
| 2056 | # The `oldest_tag()` function returns tasks which have the same tag as the |
| 2057 | # oldest task (ordered by schedule time). |
| 2058 | # |
| 2059 | # SDK compatibility: Although the SDK allows tags to be either |
| 2060 | # string or |
| 2061 | # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), |
| 2062 | # only UTF-8 encoded tags can be used in Cloud Tasks. Tag which |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2063 | # aren't UTF-8 encoded can't be used in the |
| 2064 | # filter and the task's |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2065 | # tag will be displayed as empty in Cloud Tasks. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2066 | } |
| 2067 | |
| 2068 | x__xgafv: string, V1 error format. |
| 2069 | Allowed values |
| 2070 | 1 - v1 error format |
| 2071 | 2 - v2 error format |
| 2072 | |
| 2073 | Returns: |
| 2074 | An object of the form: |
| 2075 | |
| 2076 | { # Response message for leasing tasks using LeaseTasks. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2077 | "tasks": [ # The leased tasks. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2078 | { # A unit of scheduled work. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2079 | "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2080 | # be set only if |
| 2081 | # app_engine_http_target is set |
| 2082 | # on the queue. |
| 2083 | # |
| 2084 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 2085 | # |
| 2086 | # The message defines the HTTP request that is sent to an App Engine app when |
| 2087 | # the task is dispatched. |
| 2088 | # |
| 2089 | # This proto can only be used for tasks in a queue which has |
| 2090 | # app_engine_http_target set. |
| 2091 | # |
| 2092 | # Using AppEngineHttpRequest requires |
| 2093 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 2094 | # Google IAM permission for the project |
| 2095 | # and the following scope: |
| 2096 | # |
| 2097 | # `https://www.googleapis.com/auth/cloud-platform` |
| 2098 | # |
| 2099 | # The task will be delivered to the App Engine app which belongs to the same |
| 2100 | # project as the queue. For more information, see |
| 2101 | # [How Requests are |
| 2102 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 2103 | # and how routing is affected by |
| 2104 | # [dispatch |
| 2105 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 2106 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 2107 | # Because this traffic is carried over a communication mechanism internal to |
| 2108 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 2109 | # The request to the handler, however, will appear to have used the HTTP |
| 2110 | # protocol. |
| 2111 | # |
| 2112 | # The AppEngineRouting used to construct the URL that the task is |
| 2113 | # delivered to can be set at the queue-level or task-level: |
| 2114 | # |
| 2115 | # * If set, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2116 | # app_engine_routing_override |
| 2117 | # is used for all tasks in the queue, no matter what the setting |
| 2118 | # is for the |
| 2119 | # task-level app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2120 | # |
| 2121 | # |
| 2122 | # The `url` that the task will be sent to is: |
| 2123 | # |
| 2124 | # * `url =` host `+` |
| 2125 | # relative_url |
| 2126 | # |
| 2127 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 2128 | # URIs restricted with |
| 2129 | # [`login: |
| 2130 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 2131 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 2132 | # restricted with |
| 2133 | # [`login: |
| 2134 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 2135 | # Task dispatches also do not follow redirects. |
| 2136 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2137 | # 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] | 2138 | # 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] | 2139 | # 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] | 2140 | # not receive response before the deadline. Failed |
| 2141 | # tasks will be retried according to the |
| 2142 | # retry configuration. `503` (Service Unavailable) is |
| 2143 | # 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] | 2144 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 2145 | # 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] | 2146 | # Requests) response from an app handler does not cause traffic congestion |
| 2147 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2148 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2149 | # |
| 2150 | # If set, |
| 2151 | # app_engine_routing_override |
| 2152 | # is used for all tasks in the queue, no matter what the setting is for the |
| 2153 | # task-level app_engine_routing. |
| 2154 | # |
| 2155 | # Defines routing characteristics specific to App Engine - service, version, |
| 2156 | # and instance. |
| 2157 | # |
| 2158 | # For more information about services, versions, and instances see |
| 2159 | # [An Overview of App |
| 2160 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 2161 | # [Microservices Architecture on Google App |
| 2162 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 2163 | # [App Engine Standard request |
| 2164 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 2165 | # and [App Engine Flex request |
| 2166 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2167 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2168 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2169 | # By default, the task is sent to the service which is the default |
| 2170 | # service when the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2171 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2172 | # For some queues or tasks which were created using the App Engine |
| 2173 | # Task Queue API, host is not parsable |
| 2174 | # into service, |
| 2175 | # version, and |
| 2176 | # instance. For example, some tasks |
| 2177 | # which were created using the App Engine SDK use a custom domain |
| 2178 | # name; custom domains are not parsed by Cloud Tasks. If |
| 2179 | # host is not parsable, then |
| 2180 | # service, |
| 2181 | # version, and |
| 2182 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2183 | "version": "A String", # App version. |
| 2184 | # |
| 2185 | # By default, the task is sent to the version which is the default |
| 2186 | # version when the task is attempted. |
| 2187 | # |
| 2188 | # For some queues or tasks which were created using the App Engine |
| 2189 | # Task Queue API, host is not parsable |
| 2190 | # into service, |
| 2191 | # version, and |
| 2192 | # instance. For example, some tasks |
| 2193 | # which were created using the App Engine SDK use a custom domain |
| 2194 | # name; custom domains are not parsed by Cloud Tasks. If |
| 2195 | # host is not parsable, then |
| 2196 | # service, |
| 2197 | # version, and |
| 2198 | # instance are the empty string. |
| 2199 | "host": "A String", # Output only. The host that the task is sent to. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2200 | # |
| 2201 | # For more information, see |
| 2202 | # [How Requests are |
| 2203 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
| 2204 | # |
| 2205 | # The host is constructed as: |
| 2206 | # |
| 2207 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2208 | # * `host = [application_domain_name]`</br> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2209 | # `| [service] + '.' + [application_domain_name]`</br> |
| 2210 | # `| [version] + '.' + [application_domain_name]`</br> |
| 2211 | # `| [version_dot_service]+ '.' + [application_domain_name]`</br> |
| 2212 | # `| [instance] + '.' + [application_domain_name]`</br> |
| 2213 | # `| [instance_dot_service] + '.' + [application_domain_name]`</br> |
| 2214 | # `| [instance_dot_version] + '.' + [application_domain_name]`</br> |
| 2215 | # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2216 | # |
| 2217 | # * `application_domain_name` = The domain name of the app, for |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2218 | # example <app-id>.appspot.com, which is associated with the |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2219 | # queue's project ID. Some tasks which were created using the App Engine |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2220 | # SDK use a custom domain name. |
| 2221 | # |
| 2222 | # * `service =` service |
| 2223 | # |
| 2224 | # * `version =` version |
| 2225 | # |
| 2226 | # * `version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2227 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2228 | # service |
| 2229 | # |
| 2230 | # * `instance =` instance |
| 2231 | # |
| 2232 | # * `instance_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2233 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2234 | # service |
| 2235 | # |
| 2236 | # * `instance_dot_version =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2237 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2238 | # version |
| 2239 | # |
| 2240 | # * `instance_dot_version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2241 | # instance `+ '.' +` |
| 2242 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2243 | # service |
| 2244 | # |
| 2245 | # If service is empty, then the task will be sent |
| 2246 | # to the service which is the default service when the task is attempted. |
| 2247 | # |
| 2248 | # If version is empty, then the task will be sent |
| 2249 | # to the version which is the default version when the task is attempted. |
| 2250 | # |
| 2251 | # If instance is empty, then the task |
| 2252 | # will be sent to an instance which is available when the task is |
| 2253 | # attempted. |
| 2254 | # |
| 2255 | # If service, |
| 2256 | # version, or |
| 2257 | # instance is invalid, then the task |
| 2258 | # will be sent to the default version of the default service when |
| 2259 | # the task is attempted. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2260 | "instance": "A String", # App instance. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2261 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2262 | # By default, the task is sent to an instance which is available when |
| 2263 | # the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2264 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2265 | # Requests can only be sent to a specific instance if |
| 2266 | # [manual scaling is used in App Engine |
| 2267 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 2268 | # App Engine Flex does not support instances. For more information, see |
| 2269 | # [App Engine Standard request |
| 2270 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 2271 | # and [App Engine Flex request |
| 2272 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2273 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2274 | "headers": { # HTTP request headers. |
| 2275 | # |
| 2276 | # This map contains the header field names and values. |
| 2277 | # Headers can be set when the |
| 2278 | # task is created. |
| 2279 | # Repeated headers are not supported but a header value can contain commas. |
| 2280 | # |
| 2281 | # Cloud Tasks sets some headers to default values: |
| 2282 | # |
| 2283 | # * `User-Agent`: By default, this header is |
| 2284 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
| 2285 | # This header can be modified, but Cloud Tasks will append |
| 2286 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
| 2287 | # modified `User-Agent`. |
| 2288 | # |
| 2289 | # If the task has a payload, Cloud |
| 2290 | # Tasks sets the following headers: |
| 2291 | # |
| 2292 | # * `Content-Type`: By default, the `Content-Type` header is set to |
| 2293 | # `"application/octet-stream"`. The default can be overridden by explicitly |
| 2294 | # setting `Content-Type` to a particular media type when the |
| 2295 | # task is created. |
| 2296 | # For example, `Content-Type` can be set to `"application/json"`. |
| 2297 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 2298 | # output only. It cannot be changed. |
| 2299 | # |
| 2300 | # The headers below cannot be set or overridden: |
| 2301 | # |
| 2302 | # * `Host` |
| 2303 | # * `X-Google-*` |
| 2304 | # * `X-AppEngine-*` |
| 2305 | # |
| 2306 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 2307 | # such as headers containing information about the task; see |
| 2308 | # [request |
| 2309 | # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). |
| 2310 | # These headers are set only when the task is dispatched, so they are not |
| 2311 | # visible when the task is returned in a Cloud Tasks response. |
| 2312 | # |
| 2313 | # Although there is no specific limit for the maximum number of headers or |
| 2314 | # the size, there is a limit on the maximum size of the Task. For more |
| 2315 | # information, see the CreateTask documentation. |
| 2316 | "a_key": "A String", |
| 2317 | }, |
| 2318 | "relativeUrl": "A String", # The relative URL. |
| 2319 | # |
| 2320 | # The relative URL must begin with "/" and must be a valid HTTP relative URL. |
| 2321 | # It can contain a path and query string arguments. |
| 2322 | # If the relative URL is empty, then the root path "/" will be used. |
| 2323 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 2324 | "payload": "A String", # Payload. |
| 2325 | # |
| 2326 | # The payload will be sent as the HTTP message body. A message |
| 2327 | # body, and thus a payload, is allowed only if the HTTP method is |
| 2328 | # POST or PUT. It is an error to set a data payload on a task with |
| 2329 | # an incompatible HttpMethod. |
| 2330 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 2331 | # |
| 2332 | # The app's request handler for the task's target URL must be able to handle |
| 2333 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 2334 | # error code 405 (Method Not Allowed). See [Writing a push task request |
| 2335 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
| 2336 | # and the App Engine documentation for your runtime on [How Requests are |
| 2337 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2338 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2339 | "status": { # Status of the task. # Output only. The task status. |
| 2340 | "attemptDispatchCount": 42, # Output only. The number of attempts dispatched. |
| 2341 | # |
| 2342 | # This count includes attempts which have been dispatched but haven't |
| 2343 | # received a response. |
| 2344 | "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 2345 | # |
| 2346 | # Only dispatch_time will be set. |
| 2347 | # The other AttemptStatus information is not retained by Cloud Tasks. |
| 2348 | # |
| 2349 | # This field is not calculated for pull tasks. |
| 2350 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 2351 | # |
| 2352 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 2353 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 2354 | # |
| 2355 | # If the task has not been attempted or the task is currently running |
| 2356 | # then the response status is unset. |
| 2357 | # different programming environments, including REST APIs and RPC APIs. It is |
| 2358 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 2359 | # three pieces of data: error code, error message, and error details. |
| 2360 | # |
| 2361 | # You can find out more about this error model and how to work with it in the |
| 2362 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 2363 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 2364 | # user-facing error message should be localized and sent in the |
| 2365 | # google.rpc.Status.details field, or localized by the client. |
| 2366 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 2367 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 2368 | # message types for APIs to use. |
| 2369 | { |
| 2370 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 2371 | }, |
| 2372 | ], |
| 2373 | }, |
| 2374 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 2375 | # |
| 2376 | # `response_time` will be truncated to the nearest microsecond. |
| 2377 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 2378 | # |
| 2379 | # `schedule_time` will be truncated to the nearest microsecond. |
| 2380 | }, |
| 2381 | "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 2382 | # |
| 2383 | # This field is not calculated for pull tasks. |
| 2384 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 2385 | # |
| 2386 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 2387 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 2388 | # |
| 2389 | # If the task has not been attempted or the task is currently running |
| 2390 | # then the response status is unset. |
| 2391 | # different programming environments, including REST APIs and RPC APIs. It is |
| 2392 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 2393 | # three pieces of data: error code, error message, and error details. |
| 2394 | # |
| 2395 | # You can find out more about this error model and how to work with it in the |
| 2396 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 2397 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 2398 | # user-facing error message should be localized and sent in the |
| 2399 | # google.rpc.Status.details field, or localized by the client. |
| 2400 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 2401 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 2402 | # message types for APIs to use. |
| 2403 | { |
| 2404 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 2405 | }, |
| 2406 | ], |
| 2407 | }, |
| 2408 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 2409 | # |
| 2410 | # `response_time` will be truncated to the nearest microsecond. |
| 2411 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 2412 | # |
| 2413 | # `schedule_time` will be truncated to the nearest microsecond. |
| 2414 | }, |
| 2415 | "attemptResponseCount": 42, # Output only. The number of attempts which have received a response. |
| 2416 | # |
| 2417 | # This field is not calculated for pull tasks. |
| 2418 | }, |
| 2419 | "createTime": "A String", # Output only. The time that the task was created. |
| 2420 | # |
| 2421 | # `create_time` will be truncated to the nearest second. |
| 2422 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 2423 | # |
| 2424 | # The task name. |
| 2425 | # |
| 2426 | # The task name must have the following format: |
| 2427 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 2428 | # |
| 2429 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 2430 | # hyphens (-), colons (:), or periods (.). |
| 2431 | # For more information, see |
| 2432 | # [Identifying |
| 2433 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 2434 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 2435 | # The list of available locations can be obtained by calling |
| 2436 | # ListLocations. |
| 2437 | # For more information, see https://cloud.google.com/about/locations/. |
| 2438 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 2439 | # hyphens (-). The maximum length is 100 characters. |
| 2440 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 2441 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2442 | "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be |
| 2443 | # set only if pull_target is set on the queue. |
| 2444 | # |
| 2445 | # A pull task is a task that has PullMessage set. |
| 2446 | # LeaseTasks to process the task. |
| 2447 | # |
| 2448 | # This proto can only be used for tasks in a queue which has |
| 2449 | # pull_target set. |
| 2450 | "payload": "A String", # A data payload consumed by the worker to execute the task. |
| 2451 | "tag": "A String", # The task's tag. |
| 2452 | # |
| 2453 | # Tags allow similar tasks to be processed in a batch. If you label |
| 2454 | # tasks with a tag, your worker can |
| 2455 | # lease tasks with the same tag using |
| 2456 | # filter. For example, if you want to |
| 2457 | # aggregate the events associated with a specific user once a day, |
| 2458 | # you could tag tasks with the user ID. |
| 2459 | # |
| 2460 | # The task's tag can only be set when the |
| 2461 | # task is created. |
| 2462 | # |
| 2463 | # The tag must be less than 500 characters. |
| 2464 | # |
| 2465 | # SDK compatibility: Although the SDK allows tags to be either |
| 2466 | # string or |
| 2467 | # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), |
| 2468 | # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 |
| 2469 | # encoded, the tag will be empty when the task is returned by Cloud Tasks. |
| 2470 | }, |
| 2471 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted. |
| 2472 | # |
| 2473 | # For App Engine queues, this is when the task will be attempted or retried. |
| 2474 | # |
| 2475 | # For pull queues, this is the time when the task is available to |
| 2476 | # be leased; if a task is currently leased, this is the time when |
| 2477 | # the current lease expires, that is, the time that the task was |
| 2478 | # leased plus the lease_duration. |
| 2479 | # |
| 2480 | # `schedule_time` will be truncated to the nearest microsecond. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2481 | "view": "A String", # Output only. The view specifies which subset of the Task has |
| 2482 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2483 | }, |
| 2484 | ], |
| 2485 | }</pre> |
| 2486 | </div> |
| 2487 | |
| 2488 | <div class="method"> |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2489 | <code class="details" id="list">list(parent, pageSize=None, pageToken=None, responseView=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2490 | <pre>Lists the tasks in a queue. |
| 2491 | |
| 2492 | By default, only the BASIC view is retrieved |
| 2493 | due to performance considerations; |
| 2494 | response_view controls the |
| 2495 | subset of information which is returned. |
| 2496 | |
| 2497 | The tasks may be returned in any order. The ordering may change at any |
| 2498 | time. |
| 2499 | |
| 2500 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2501 | parent: string, Required. The queue name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2502 | `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` (required) |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2503 | pageSize: integer, Maximum page size. |
| 2504 | |
| 2505 | Fewer tasks than requested might be returned, even if more tasks exist; use |
| 2506 | next_page_token in the response to |
| 2507 | determine if more tasks exist. |
| 2508 | |
| 2509 | The maximum page size is 1000. If unspecified, the page size will be the |
| 2510 | maximum. |
| 2511 | pageToken: string, A token identifying the page of results to return. |
| 2512 | |
| 2513 | To request the first page results, page_token must be empty. To |
| 2514 | request the next page of results, page_token must be the value of |
| 2515 | next_page_token returned |
| 2516 | from the previous call to ListTasks |
| 2517 | method. |
| 2518 | |
| 2519 | The page token is valid for only 2 hours. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2520 | responseView: string, The response_view specifies which subset of the Task will be |
| 2521 | returned. |
| 2522 | |
| 2523 | By default response_view is BASIC; not all |
| 2524 | information is retrieved by default because some data, such as |
| 2525 | payloads, might be desirable to return only when needed because |
| 2526 | of its large size or because of the sensitivity of data that it |
| 2527 | contains. |
| 2528 | |
| 2529 | Authorization for FULL requires |
| 2530 | `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) |
| 2531 | permission on the Task resource. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2532 | x__xgafv: string, V1 error format. |
| 2533 | Allowed values |
| 2534 | 1 - v1 error format |
| 2535 | 2 - v2 error format |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2536 | |
| 2537 | Returns: |
| 2538 | An object of the form: |
| 2539 | |
| 2540 | { # Response message for listing tasks using ListTasks. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2541 | "nextPageToken": "A String", # A token to retrieve next page of results. |
| 2542 | # |
| 2543 | # To return the next page of results, call |
| 2544 | # ListTasks with this value as the |
| 2545 | # page_token. |
| 2546 | # |
| 2547 | # If the next_page_token is empty, there are no more results. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2548 | "tasks": [ # The list of tasks. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2549 | { # A unit of scheduled work. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2550 | "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2551 | # be set only if |
| 2552 | # app_engine_http_target is set |
| 2553 | # on the queue. |
| 2554 | # |
| 2555 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 2556 | # |
| 2557 | # The message defines the HTTP request that is sent to an App Engine app when |
| 2558 | # the task is dispatched. |
| 2559 | # |
| 2560 | # This proto can only be used for tasks in a queue which has |
| 2561 | # app_engine_http_target set. |
| 2562 | # |
| 2563 | # Using AppEngineHttpRequest requires |
| 2564 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 2565 | # Google IAM permission for the project |
| 2566 | # and the following scope: |
| 2567 | # |
| 2568 | # `https://www.googleapis.com/auth/cloud-platform` |
| 2569 | # |
| 2570 | # The task will be delivered to the App Engine app which belongs to the same |
| 2571 | # project as the queue. For more information, see |
| 2572 | # [How Requests are |
| 2573 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 2574 | # and how routing is affected by |
| 2575 | # [dispatch |
| 2576 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 2577 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 2578 | # Because this traffic is carried over a communication mechanism internal to |
| 2579 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 2580 | # The request to the handler, however, will appear to have used the HTTP |
| 2581 | # protocol. |
| 2582 | # |
| 2583 | # The AppEngineRouting used to construct the URL that the task is |
| 2584 | # delivered to can be set at the queue-level or task-level: |
| 2585 | # |
| 2586 | # * If set, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2587 | # app_engine_routing_override |
| 2588 | # is used for all tasks in the queue, no matter what the setting |
| 2589 | # is for the |
| 2590 | # task-level app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2591 | # |
| 2592 | # |
| 2593 | # The `url` that the task will be sent to is: |
| 2594 | # |
| 2595 | # * `url =` host `+` |
| 2596 | # relative_url |
| 2597 | # |
| 2598 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 2599 | # URIs restricted with |
| 2600 | # [`login: |
| 2601 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 2602 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 2603 | # restricted with |
| 2604 | # [`login: |
| 2605 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 2606 | # Task dispatches also do not follow redirects. |
| 2607 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2608 | # 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] | 2609 | # 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] | 2610 | # 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] | 2611 | # not receive response before the deadline. Failed |
| 2612 | # tasks will be retried according to the |
| 2613 | # retry configuration. `503` (Service Unavailable) is |
| 2614 | # 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] | 2615 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 2616 | # 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] | 2617 | # Requests) response from an app handler does not cause traffic congestion |
| 2618 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2619 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2620 | # |
| 2621 | # If set, |
| 2622 | # app_engine_routing_override |
| 2623 | # is used for all tasks in the queue, no matter what the setting is for the |
| 2624 | # task-level app_engine_routing. |
| 2625 | # |
| 2626 | # Defines routing characteristics specific to App Engine - service, version, |
| 2627 | # and instance. |
| 2628 | # |
| 2629 | # For more information about services, versions, and instances see |
| 2630 | # [An Overview of App |
| 2631 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 2632 | # [Microservices Architecture on Google App |
| 2633 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 2634 | # [App Engine Standard request |
| 2635 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 2636 | # and [App Engine Flex request |
| 2637 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2638 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2639 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2640 | # By default, the task is sent to the service which is the default |
| 2641 | # service when the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2642 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2643 | # For some queues or tasks which were created using the App Engine |
| 2644 | # Task Queue API, host is not parsable |
| 2645 | # into service, |
| 2646 | # version, and |
| 2647 | # instance. For example, some tasks |
| 2648 | # which were created using the App Engine SDK use a custom domain |
| 2649 | # name; custom domains are not parsed by Cloud Tasks. If |
| 2650 | # host is not parsable, then |
| 2651 | # service, |
| 2652 | # version, and |
| 2653 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2654 | "version": "A String", # App version. |
| 2655 | # |
| 2656 | # By default, the task is sent to the version which is the default |
| 2657 | # version when the task is attempted. |
| 2658 | # |
| 2659 | # For some queues or tasks which were created using the App Engine |
| 2660 | # Task Queue API, host is not parsable |
| 2661 | # into service, |
| 2662 | # version, and |
| 2663 | # instance. For example, some tasks |
| 2664 | # which were created using the App Engine SDK use a custom domain |
| 2665 | # name; custom domains are not parsed by Cloud Tasks. If |
| 2666 | # host is not parsable, then |
| 2667 | # service, |
| 2668 | # version, and |
| 2669 | # instance are the empty string. |
| 2670 | "host": "A String", # Output only. The host that the task is sent to. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2671 | # |
| 2672 | # For more information, see |
| 2673 | # [How Requests are |
| 2674 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
| 2675 | # |
| 2676 | # The host is constructed as: |
| 2677 | # |
| 2678 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2679 | # * `host = [application_domain_name]`</br> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2680 | # `| [service] + '.' + [application_domain_name]`</br> |
| 2681 | # `| [version] + '.' + [application_domain_name]`</br> |
| 2682 | # `| [version_dot_service]+ '.' + [application_domain_name]`</br> |
| 2683 | # `| [instance] + '.' + [application_domain_name]`</br> |
| 2684 | # `| [instance_dot_service] + '.' + [application_domain_name]`</br> |
| 2685 | # `| [instance_dot_version] + '.' + [application_domain_name]`</br> |
| 2686 | # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2687 | # |
| 2688 | # * `application_domain_name` = The domain name of the app, for |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2689 | # example <app-id>.appspot.com, which is associated with the |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2690 | # queue's project ID. Some tasks which were created using the App Engine |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2691 | # SDK use a custom domain name. |
| 2692 | # |
| 2693 | # * `service =` service |
| 2694 | # |
| 2695 | # * `version =` version |
| 2696 | # |
| 2697 | # * `version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2698 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2699 | # service |
| 2700 | # |
| 2701 | # * `instance =` instance |
| 2702 | # |
| 2703 | # * `instance_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2704 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2705 | # service |
| 2706 | # |
| 2707 | # * `instance_dot_version =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2708 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2709 | # version |
| 2710 | # |
| 2711 | # * `instance_dot_version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2712 | # instance `+ '.' +` |
| 2713 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2714 | # service |
| 2715 | # |
| 2716 | # If service is empty, then the task will be sent |
| 2717 | # to the service which is the default service when the task is attempted. |
| 2718 | # |
| 2719 | # If version is empty, then the task will be sent |
| 2720 | # to the version which is the default version when the task is attempted. |
| 2721 | # |
| 2722 | # If instance is empty, then the task |
| 2723 | # will be sent to an instance which is available when the task is |
| 2724 | # attempted. |
| 2725 | # |
| 2726 | # If service, |
| 2727 | # version, or |
| 2728 | # instance is invalid, then the task |
| 2729 | # will be sent to the default version of the default service when |
| 2730 | # the task is attempted. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2731 | "instance": "A String", # App instance. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2732 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2733 | # By default, the task is sent to an instance which is available when |
| 2734 | # the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2735 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2736 | # Requests can only be sent to a specific instance if |
| 2737 | # [manual scaling is used in App Engine |
| 2738 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 2739 | # App Engine Flex does not support instances. For more information, see |
| 2740 | # [App Engine Standard request |
| 2741 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 2742 | # and [App Engine Flex request |
| 2743 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2744 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2745 | "headers": { # HTTP request headers. |
| 2746 | # |
| 2747 | # This map contains the header field names and values. |
| 2748 | # Headers can be set when the |
| 2749 | # task is created. |
| 2750 | # Repeated headers are not supported but a header value can contain commas. |
| 2751 | # |
| 2752 | # Cloud Tasks sets some headers to default values: |
| 2753 | # |
| 2754 | # * `User-Agent`: By default, this header is |
| 2755 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
| 2756 | # This header can be modified, but Cloud Tasks will append |
| 2757 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
| 2758 | # modified `User-Agent`. |
| 2759 | # |
| 2760 | # If the task has a payload, Cloud |
| 2761 | # Tasks sets the following headers: |
| 2762 | # |
| 2763 | # * `Content-Type`: By default, the `Content-Type` header is set to |
| 2764 | # `"application/octet-stream"`. The default can be overridden by explicitly |
| 2765 | # setting `Content-Type` to a particular media type when the |
| 2766 | # task is created. |
| 2767 | # For example, `Content-Type` can be set to `"application/json"`. |
| 2768 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 2769 | # output only. It cannot be changed. |
| 2770 | # |
| 2771 | # The headers below cannot be set or overridden: |
| 2772 | # |
| 2773 | # * `Host` |
| 2774 | # * `X-Google-*` |
| 2775 | # * `X-AppEngine-*` |
| 2776 | # |
| 2777 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 2778 | # such as headers containing information about the task; see |
| 2779 | # [request |
| 2780 | # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). |
| 2781 | # These headers are set only when the task is dispatched, so they are not |
| 2782 | # visible when the task is returned in a Cloud Tasks response. |
| 2783 | # |
| 2784 | # Although there is no specific limit for the maximum number of headers or |
| 2785 | # the size, there is a limit on the maximum size of the Task. For more |
| 2786 | # information, see the CreateTask documentation. |
| 2787 | "a_key": "A String", |
| 2788 | }, |
| 2789 | "relativeUrl": "A String", # The relative URL. |
| 2790 | # |
| 2791 | # The relative URL must begin with "/" and must be a valid HTTP relative URL. |
| 2792 | # It can contain a path and query string arguments. |
| 2793 | # If the relative URL is empty, then the root path "/" will be used. |
| 2794 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 2795 | "payload": "A String", # Payload. |
| 2796 | # |
| 2797 | # The payload will be sent as the HTTP message body. A message |
| 2798 | # body, and thus a payload, is allowed only if the HTTP method is |
| 2799 | # POST or PUT. It is an error to set a data payload on a task with |
| 2800 | # an incompatible HttpMethod. |
| 2801 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 2802 | # |
| 2803 | # The app's request handler for the task's target URL must be able to handle |
| 2804 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 2805 | # error code 405 (Method Not Allowed). See [Writing a push task request |
| 2806 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
| 2807 | # and the App Engine documentation for your runtime on [How Requests are |
| 2808 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2809 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2810 | "status": { # Status of the task. # Output only. The task status. |
| 2811 | "attemptDispatchCount": 42, # Output only. The number of attempts dispatched. |
| 2812 | # |
| 2813 | # This count includes attempts which have been dispatched but haven't |
| 2814 | # received a response. |
| 2815 | "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 2816 | # |
| 2817 | # Only dispatch_time will be set. |
| 2818 | # The other AttemptStatus information is not retained by Cloud Tasks. |
| 2819 | # |
| 2820 | # This field is not calculated for pull tasks. |
| 2821 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 2822 | # |
| 2823 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 2824 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 2825 | # |
| 2826 | # If the task has not been attempted or the task is currently running |
| 2827 | # then the response status is unset. |
| 2828 | # different programming environments, including REST APIs and RPC APIs. It is |
| 2829 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 2830 | # three pieces of data: error code, error message, and error details. |
| 2831 | # |
| 2832 | # You can find out more about this error model and how to work with it in the |
| 2833 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 2834 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 2835 | # user-facing error message should be localized and sent in the |
| 2836 | # google.rpc.Status.details field, or localized by the client. |
| 2837 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 2838 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 2839 | # message types for APIs to use. |
| 2840 | { |
| 2841 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 2842 | }, |
| 2843 | ], |
| 2844 | }, |
| 2845 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 2846 | # |
| 2847 | # `response_time` will be truncated to the nearest microsecond. |
| 2848 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 2849 | # |
| 2850 | # `schedule_time` will be truncated to the nearest microsecond. |
| 2851 | }, |
| 2852 | "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 2853 | # |
| 2854 | # This field is not calculated for pull tasks. |
| 2855 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 2856 | # |
| 2857 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 2858 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 2859 | # |
| 2860 | # If the task has not been attempted or the task is currently running |
| 2861 | # then the response status is unset. |
| 2862 | # different programming environments, including REST APIs and RPC APIs. It is |
| 2863 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 2864 | # three pieces of data: error code, error message, and error details. |
| 2865 | # |
| 2866 | # You can find out more about this error model and how to work with it in the |
| 2867 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 2868 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 2869 | # user-facing error message should be localized and sent in the |
| 2870 | # google.rpc.Status.details field, or localized by the client. |
| 2871 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 2872 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 2873 | # message types for APIs to use. |
| 2874 | { |
| 2875 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 2876 | }, |
| 2877 | ], |
| 2878 | }, |
| 2879 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 2880 | # |
| 2881 | # `response_time` will be truncated to the nearest microsecond. |
| 2882 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 2883 | # |
| 2884 | # `schedule_time` will be truncated to the nearest microsecond. |
| 2885 | }, |
| 2886 | "attemptResponseCount": 42, # Output only. The number of attempts which have received a response. |
| 2887 | # |
| 2888 | # This field is not calculated for pull tasks. |
| 2889 | }, |
| 2890 | "createTime": "A String", # Output only. The time that the task was created. |
| 2891 | # |
| 2892 | # `create_time` will be truncated to the nearest second. |
| 2893 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 2894 | # |
| 2895 | # The task name. |
| 2896 | # |
| 2897 | # The task name must have the following format: |
| 2898 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 2899 | # |
| 2900 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 2901 | # hyphens (-), colons (:), or periods (.). |
| 2902 | # For more information, see |
| 2903 | # [Identifying |
| 2904 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 2905 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 2906 | # The list of available locations can be obtained by calling |
| 2907 | # ListLocations. |
| 2908 | # For more information, see https://cloud.google.com/about/locations/. |
| 2909 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 2910 | # hyphens (-). The maximum length is 100 characters. |
| 2911 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 2912 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2913 | "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be |
| 2914 | # set only if pull_target is set on the queue. |
| 2915 | # |
| 2916 | # A pull task is a task that has PullMessage set. |
| 2917 | # LeaseTasks to process the task. |
| 2918 | # |
| 2919 | # This proto can only be used for tasks in a queue which has |
| 2920 | # pull_target set. |
| 2921 | "payload": "A String", # A data payload consumed by the worker to execute the task. |
| 2922 | "tag": "A String", # The task's tag. |
| 2923 | # |
| 2924 | # Tags allow similar tasks to be processed in a batch. If you label |
| 2925 | # tasks with a tag, your worker can |
| 2926 | # lease tasks with the same tag using |
| 2927 | # filter. For example, if you want to |
| 2928 | # aggregate the events associated with a specific user once a day, |
| 2929 | # you could tag tasks with the user ID. |
| 2930 | # |
| 2931 | # The task's tag can only be set when the |
| 2932 | # task is created. |
| 2933 | # |
| 2934 | # The tag must be less than 500 characters. |
| 2935 | # |
| 2936 | # SDK compatibility: Although the SDK allows tags to be either |
| 2937 | # string or |
| 2938 | # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), |
| 2939 | # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 |
| 2940 | # encoded, the tag will be empty when the task is returned by Cloud Tasks. |
| 2941 | }, |
| 2942 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted. |
| 2943 | # |
| 2944 | # For App Engine queues, this is when the task will be attempted or retried. |
| 2945 | # |
| 2946 | # For pull queues, this is the time when the task is available to |
| 2947 | # be leased; if a task is currently leased, this is the time when |
| 2948 | # the current lease expires, that is, the time that the task was |
| 2949 | # leased plus the lease_duration. |
| 2950 | # |
| 2951 | # `schedule_time` will be truncated to the nearest microsecond. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 2952 | "view": "A String", # Output only. The view specifies which subset of the Task has |
| 2953 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2954 | }, |
| 2955 | ], |
| 2956 | }</pre> |
| 2957 | </div> |
| 2958 | |
| 2959 | <div class="method"> |
| 2960 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 2961 | <pre>Retrieves the next page of results. |
| 2962 | |
| 2963 | Args: |
| 2964 | previous_request: The request for the previous page. (required) |
| 2965 | previous_response: The response from the request for the previous page. (required) |
| 2966 | |
| 2967 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2968 | 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] | 2969 | page. Returns None if there are no more items in the collection. |
| 2970 | </pre> |
| 2971 | </div> |
| 2972 | |
| 2973 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2974 | <code class="details" id="renewLease">renewLease(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2975 | <pre>Renew the current lease of a pull task. |
| 2976 | |
| 2977 | The worker can use this method to extend the lease by a new |
| 2978 | duration, starting from now. The new task lease will be |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2979 | returned in the task's schedule_time. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2980 | |
| 2981 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 2982 | name: string, Required. The task name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2983 | `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] | 2984 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 2985 | The object takes the form of: |
| 2986 | |
| 2987 | { # Request message for renewing a lease using |
| 2988 | # RenewLease. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 2989 | "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] | 2990 | # returned. |
| 2991 | # |
| 2992 | # By default response_view is BASIC; not all |
| 2993 | # information is retrieved by default because some data, such as |
| 2994 | # payloads, might be desirable to return only when needed because |
| 2995 | # of its large size or because of the sensitivity of data that it |
| 2996 | # contains. |
| 2997 | # |
| 2998 | # Authorization for FULL requires |
| 2999 | # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) |
| 3000 | # permission on the Task resource. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3001 | "leaseDuration": "A String", # Required. The desired new lease duration, starting from now. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3002 | # |
| 3003 | # |
| 3004 | # The maximum lease duration is 1 week. |
| 3005 | # `lease_duration` will be truncated to the nearest second. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3006 | "scheduleTime": "A String", # Required. The task's current schedule time, available in the |
| 3007 | # schedule_time returned by |
| 3008 | # LeaseTasks response or |
| 3009 | # RenewLease response. This restriction is |
| 3010 | # to ensure that your worker currently holds the lease. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3011 | } |
| 3012 | |
| 3013 | x__xgafv: string, V1 error format. |
| 3014 | Allowed values |
| 3015 | 1 - v1 error format |
| 3016 | 2 - v2 error format |
| 3017 | |
| 3018 | Returns: |
| 3019 | An object of the form: |
| 3020 | |
| 3021 | { # A unit of scheduled work. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3022 | "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3023 | # be set only if |
| 3024 | # app_engine_http_target is set |
| 3025 | # on the queue. |
| 3026 | # |
| 3027 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 3028 | # |
| 3029 | # The message defines the HTTP request that is sent to an App Engine app when |
| 3030 | # the task is dispatched. |
| 3031 | # |
| 3032 | # This proto can only be used for tasks in a queue which has |
| 3033 | # app_engine_http_target set. |
| 3034 | # |
| 3035 | # Using AppEngineHttpRequest requires |
| 3036 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 3037 | # Google IAM permission for the project |
| 3038 | # and the following scope: |
| 3039 | # |
| 3040 | # `https://www.googleapis.com/auth/cloud-platform` |
| 3041 | # |
| 3042 | # The task will be delivered to the App Engine app which belongs to the same |
| 3043 | # project as the queue. For more information, see |
| 3044 | # [How Requests are |
| 3045 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 3046 | # and how routing is affected by |
| 3047 | # [dispatch |
| 3048 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 3049 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 3050 | # Because this traffic is carried over a communication mechanism internal to |
| 3051 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 3052 | # The request to the handler, however, will appear to have used the HTTP |
| 3053 | # protocol. |
| 3054 | # |
| 3055 | # The AppEngineRouting used to construct the URL that the task is |
| 3056 | # delivered to can be set at the queue-level or task-level: |
| 3057 | # |
| 3058 | # * If set, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3059 | # app_engine_routing_override |
| 3060 | # is used for all tasks in the queue, no matter what the setting |
| 3061 | # is for the |
| 3062 | # task-level app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3063 | # |
| 3064 | # |
| 3065 | # The `url` that the task will be sent to is: |
| 3066 | # |
| 3067 | # * `url =` host `+` |
| 3068 | # relative_url |
| 3069 | # |
| 3070 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 3071 | # URIs restricted with |
| 3072 | # [`login: |
| 3073 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 3074 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 3075 | # restricted with |
| 3076 | # [`login: |
| 3077 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 3078 | # Task dispatches also do not follow redirects. |
| 3079 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3080 | # 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] | 3081 | # 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] | 3082 | # 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] | 3083 | # not receive response before the deadline. Failed |
| 3084 | # tasks will be retried according to the |
| 3085 | # retry configuration. `503` (Service Unavailable) is |
| 3086 | # 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] | 3087 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 3088 | # 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] | 3089 | # Requests) response from an app handler does not cause traffic congestion |
| 3090 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3091 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3092 | # |
| 3093 | # If set, |
| 3094 | # app_engine_routing_override |
| 3095 | # is used for all tasks in the queue, no matter what the setting is for the |
| 3096 | # task-level app_engine_routing. |
| 3097 | # |
| 3098 | # Defines routing characteristics specific to App Engine - service, version, |
| 3099 | # and instance. |
| 3100 | # |
| 3101 | # For more information about services, versions, and instances see |
| 3102 | # [An Overview of App |
| 3103 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 3104 | # [Microservices Architecture on Google App |
| 3105 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 3106 | # [App Engine Standard request |
| 3107 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 3108 | # and [App Engine Flex request |
| 3109 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3110 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3111 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3112 | # By default, the task is sent to the service which is the default |
| 3113 | # service when the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3114 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3115 | # For some queues or tasks which were created using the App Engine |
| 3116 | # Task Queue API, host is not parsable |
| 3117 | # into service, |
| 3118 | # version, and |
| 3119 | # instance. For example, some tasks |
| 3120 | # which were created using the App Engine SDK use a custom domain |
| 3121 | # name; custom domains are not parsed by Cloud Tasks. If |
| 3122 | # host is not parsable, then |
| 3123 | # service, |
| 3124 | # version, and |
| 3125 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3126 | "version": "A String", # App version. |
| 3127 | # |
| 3128 | # By default, the task is sent to the version which is the default |
| 3129 | # version when the task is attempted. |
| 3130 | # |
| 3131 | # For some queues or tasks which were created using the App Engine |
| 3132 | # Task Queue API, host is not parsable |
| 3133 | # into service, |
| 3134 | # version, and |
| 3135 | # instance. For example, some tasks |
| 3136 | # which were created using the App Engine SDK use a custom domain |
| 3137 | # name; custom domains are not parsed by Cloud Tasks. If |
| 3138 | # host is not parsable, then |
| 3139 | # service, |
| 3140 | # version, and |
| 3141 | # instance are the empty string. |
| 3142 | "host": "A String", # Output only. The host that the task is sent to. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3143 | # |
| 3144 | # For more information, see |
| 3145 | # [How Requests are |
| 3146 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
| 3147 | # |
| 3148 | # The host is constructed as: |
| 3149 | # |
| 3150 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3151 | # * `host = [application_domain_name]`</br> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3152 | # `| [service] + '.' + [application_domain_name]`</br> |
| 3153 | # `| [version] + '.' + [application_domain_name]`</br> |
| 3154 | # `| [version_dot_service]+ '.' + [application_domain_name]`</br> |
| 3155 | # `| [instance] + '.' + [application_domain_name]`</br> |
| 3156 | # `| [instance_dot_service] + '.' + [application_domain_name]`</br> |
| 3157 | # `| [instance_dot_version] + '.' + [application_domain_name]`</br> |
| 3158 | # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3159 | # |
| 3160 | # * `application_domain_name` = The domain name of the app, for |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3161 | # example <app-id>.appspot.com, which is associated with the |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3162 | # queue's project ID. Some tasks which were created using the App Engine |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3163 | # SDK use a custom domain name. |
| 3164 | # |
| 3165 | # * `service =` service |
| 3166 | # |
| 3167 | # * `version =` version |
| 3168 | # |
| 3169 | # * `version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3170 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3171 | # service |
| 3172 | # |
| 3173 | # * `instance =` instance |
| 3174 | # |
| 3175 | # * `instance_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3176 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3177 | # service |
| 3178 | # |
| 3179 | # * `instance_dot_version =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3180 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3181 | # version |
| 3182 | # |
| 3183 | # * `instance_dot_version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3184 | # instance `+ '.' +` |
| 3185 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3186 | # service |
| 3187 | # |
| 3188 | # If service is empty, then the task will be sent |
| 3189 | # to the service which is the default service when the task is attempted. |
| 3190 | # |
| 3191 | # If version is empty, then the task will be sent |
| 3192 | # to the version which is the default version when the task is attempted. |
| 3193 | # |
| 3194 | # If instance is empty, then the task |
| 3195 | # will be sent to an instance which is available when the task is |
| 3196 | # attempted. |
| 3197 | # |
| 3198 | # If service, |
| 3199 | # version, or |
| 3200 | # instance is invalid, then the task |
| 3201 | # will be sent to the default version of the default service when |
| 3202 | # the task is attempted. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3203 | "instance": "A String", # App instance. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3204 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3205 | # By default, the task is sent to an instance which is available when |
| 3206 | # the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3207 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3208 | # Requests can only be sent to a specific instance if |
| 3209 | # [manual scaling is used in App Engine |
| 3210 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 3211 | # App Engine Flex does not support instances. For more information, see |
| 3212 | # [App Engine Standard request |
| 3213 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 3214 | # and [App Engine Flex request |
| 3215 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3216 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3217 | "headers": { # HTTP request headers. |
| 3218 | # |
| 3219 | # This map contains the header field names and values. |
| 3220 | # Headers can be set when the |
| 3221 | # task is created. |
| 3222 | # Repeated headers are not supported but a header value can contain commas. |
| 3223 | # |
| 3224 | # Cloud Tasks sets some headers to default values: |
| 3225 | # |
| 3226 | # * `User-Agent`: By default, this header is |
| 3227 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
| 3228 | # This header can be modified, but Cloud Tasks will append |
| 3229 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
| 3230 | # modified `User-Agent`. |
| 3231 | # |
| 3232 | # If the task has a payload, Cloud |
| 3233 | # Tasks sets the following headers: |
| 3234 | # |
| 3235 | # * `Content-Type`: By default, the `Content-Type` header is set to |
| 3236 | # `"application/octet-stream"`. The default can be overridden by explicitly |
| 3237 | # setting `Content-Type` to a particular media type when the |
| 3238 | # task is created. |
| 3239 | # For example, `Content-Type` can be set to `"application/json"`. |
| 3240 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 3241 | # output only. It cannot be changed. |
| 3242 | # |
| 3243 | # The headers below cannot be set or overridden: |
| 3244 | # |
| 3245 | # * `Host` |
| 3246 | # * `X-Google-*` |
| 3247 | # * `X-AppEngine-*` |
| 3248 | # |
| 3249 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 3250 | # such as headers containing information about the task; see |
| 3251 | # [request |
| 3252 | # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). |
| 3253 | # These headers are set only when the task is dispatched, so they are not |
| 3254 | # visible when the task is returned in a Cloud Tasks response. |
| 3255 | # |
| 3256 | # Although there is no specific limit for the maximum number of headers or |
| 3257 | # the size, there is a limit on the maximum size of the Task. For more |
| 3258 | # information, see the CreateTask documentation. |
| 3259 | "a_key": "A String", |
| 3260 | }, |
| 3261 | "relativeUrl": "A String", # The relative URL. |
| 3262 | # |
| 3263 | # The relative URL must begin with "/" and must be a valid HTTP relative URL. |
| 3264 | # It can contain a path and query string arguments. |
| 3265 | # If the relative URL is empty, then the root path "/" will be used. |
| 3266 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 3267 | "payload": "A String", # Payload. |
| 3268 | # |
| 3269 | # The payload will be sent as the HTTP message body. A message |
| 3270 | # body, and thus a payload, is allowed only if the HTTP method is |
| 3271 | # POST or PUT. It is an error to set a data payload on a task with |
| 3272 | # an incompatible HttpMethod. |
| 3273 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 3274 | # |
| 3275 | # The app's request handler for the task's target URL must be able to handle |
| 3276 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 3277 | # error code 405 (Method Not Allowed). See [Writing a push task request |
| 3278 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
| 3279 | # and the App Engine documentation for your runtime on [How Requests are |
| 3280 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3281 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3282 | "status": { # Status of the task. # Output only. The task status. |
| 3283 | "attemptDispatchCount": 42, # Output only. The number of attempts dispatched. |
| 3284 | # |
| 3285 | # This count includes attempts which have been dispatched but haven't |
| 3286 | # received a response. |
| 3287 | "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 3288 | # |
| 3289 | # Only dispatch_time will be set. |
| 3290 | # The other AttemptStatus information is not retained by Cloud Tasks. |
| 3291 | # |
| 3292 | # This field is not calculated for pull tasks. |
| 3293 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 3294 | # |
| 3295 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 3296 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 3297 | # |
| 3298 | # If the task has not been attempted or the task is currently running |
| 3299 | # then the response status is unset. |
| 3300 | # different programming environments, including REST APIs and RPC APIs. It is |
| 3301 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 3302 | # three pieces of data: error code, error message, and error details. |
| 3303 | # |
| 3304 | # You can find out more about this error model and how to work with it in the |
| 3305 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 3306 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 3307 | # user-facing error message should be localized and sent in the |
| 3308 | # google.rpc.Status.details field, or localized by the client. |
| 3309 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 3310 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 3311 | # message types for APIs to use. |
| 3312 | { |
| 3313 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 3314 | }, |
| 3315 | ], |
| 3316 | }, |
| 3317 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 3318 | # |
| 3319 | # `response_time` will be truncated to the nearest microsecond. |
| 3320 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 3321 | # |
| 3322 | # `schedule_time` will be truncated to the nearest microsecond. |
| 3323 | }, |
| 3324 | "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 3325 | # |
| 3326 | # This field is not calculated for pull tasks. |
| 3327 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 3328 | # |
| 3329 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 3330 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 3331 | # |
| 3332 | # If the task has not been attempted or the task is currently running |
| 3333 | # then the response status is unset. |
| 3334 | # different programming environments, including REST APIs and RPC APIs. It is |
| 3335 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 3336 | # three pieces of data: error code, error message, and error details. |
| 3337 | # |
| 3338 | # You can find out more about this error model and how to work with it in the |
| 3339 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 3340 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 3341 | # user-facing error message should be localized and sent in the |
| 3342 | # google.rpc.Status.details field, or localized by the client. |
| 3343 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 3344 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 3345 | # message types for APIs to use. |
| 3346 | { |
| 3347 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 3348 | }, |
| 3349 | ], |
| 3350 | }, |
| 3351 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 3352 | # |
| 3353 | # `response_time` will be truncated to the nearest microsecond. |
| 3354 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 3355 | # |
| 3356 | # `schedule_time` will be truncated to the nearest microsecond. |
| 3357 | }, |
| 3358 | "attemptResponseCount": 42, # Output only. The number of attempts which have received a response. |
| 3359 | # |
| 3360 | # This field is not calculated for pull tasks. |
| 3361 | }, |
| 3362 | "createTime": "A String", # Output only. The time that the task was created. |
| 3363 | # |
| 3364 | # `create_time` will be truncated to the nearest second. |
| 3365 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 3366 | # |
| 3367 | # The task name. |
| 3368 | # |
| 3369 | # The task name must have the following format: |
| 3370 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 3371 | # |
| 3372 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 3373 | # hyphens (-), colons (:), or periods (.). |
| 3374 | # For more information, see |
| 3375 | # [Identifying |
| 3376 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 3377 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 3378 | # The list of available locations can be obtained by calling |
| 3379 | # ListLocations. |
| 3380 | # For more information, see https://cloud.google.com/about/locations/. |
| 3381 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 3382 | # hyphens (-). The maximum length is 100 characters. |
| 3383 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 3384 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3385 | "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be |
| 3386 | # set only if pull_target is set on the queue. |
| 3387 | # |
| 3388 | # A pull task is a task that has PullMessage set. |
| 3389 | # LeaseTasks to process the task. |
| 3390 | # |
| 3391 | # This proto can only be used for tasks in a queue which has |
| 3392 | # pull_target set. |
| 3393 | "payload": "A String", # A data payload consumed by the worker to execute the task. |
| 3394 | "tag": "A String", # The task's tag. |
| 3395 | # |
| 3396 | # Tags allow similar tasks to be processed in a batch. If you label |
| 3397 | # tasks with a tag, your worker can |
| 3398 | # lease tasks with the same tag using |
| 3399 | # filter. For example, if you want to |
| 3400 | # aggregate the events associated with a specific user once a day, |
| 3401 | # you could tag tasks with the user ID. |
| 3402 | # |
| 3403 | # The task's tag can only be set when the |
| 3404 | # task is created. |
| 3405 | # |
| 3406 | # The tag must be less than 500 characters. |
| 3407 | # |
| 3408 | # SDK compatibility: Although the SDK allows tags to be either |
| 3409 | # string or |
| 3410 | # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), |
| 3411 | # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 |
| 3412 | # encoded, the tag will be empty when the task is returned by Cloud Tasks. |
| 3413 | }, |
| 3414 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted. |
| 3415 | # |
| 3416 | # For App Engine queues, this is when the task will be attempted or retried. |
| 3417 | # |
| 3418 | # For pull queues, this is the time when the task is available to |
| 3419 | # be leased; if a task is currently leased, this is the time when |
| 3420 | # the current lease expires, that is, the time that the task was |
| 3421 | # leased plus the lease_duration. |
| 3422 | # |
| 3423 | # `schedule_time` will be truncated to the nearest microsecond. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3424 | "view": "A String", # Output only. The view specifies which subset of the Task has |
| 3425 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3426 | }</pre> |
| 3427 | </div> |
| 3428 | |
| 3429 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3430 | <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] | 3431 | <pre>Forces a task to run now. |
| 3432 | |
| 3433 | When this method is called, Cloud Tasks will dispatch the task, even if |
| 3434 | the task is already running, the queue has reached its RateLimits or |
| 3435 | is PAUSED. |
| 3436 | |
| 3437 | This command is meant to be used for manual debugging. For |
| 3438 | example, RunTask can be used to retry a failed |
| 3439 | task after a fix has been made or to manually force a task to be |
| 3440 | dispatched now. |
| 3441 | |
| 3442 | The dispatched task is returned. That is, the task that is returned |
| 3443 | contains the status after the task is dispatched but |
| 3444 | before the task is received by its target. |
| 3445 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3446 | If Cloud Tasks receives a successful response from the task's |
| 3447 | target, then the task will be deleted; otherwise the task's |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3448 | schedule_time will be reset to the time that |
| 3449 | RunTask was called plus the retry delay specified |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3450 | in the queue's RetryConfig. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3451 | |
| 3452 | RunTask returns |
| 3453 | NOT_FOUND when it is called on a |
| 3454 | task that has already succeeded or permanently failed. |
| 3455 | |
| 3456 | RunTask cannot be called on a |
| 3457 | pull task. |
| 3458 | |
| 3459 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3460 | name: string, Required. The task name. For example: |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3461 | `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] | 3462 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3463 | The object takes the form of: |
| 3464 | |
| 3465 | { # Request message for forcing a task to run now using |
| 3466 | # RunTask. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3467 | "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] | 3468 | # returned. |
| 3469 | # |
| 3470 | # By default response_view is BASIC; not all |
| 3471 | # information is retrieved by default because some data, such as |
| 3472 | # payloads, might be desirable to return only when needed because |
| 3473 | # of its large size or because of the sensitivity of data that it |
| 3474 | # contains. |
| 3475 | # |
| 3476 | # Authorization for FULL requires |
| 3477 | # `cloudtasks.tasks.fullView` [Google IAM](https://cloud.google.com/iam/) |
| 3478 | # permission on the Task resource. |
| 3479 | } |
| 3480 | |
| 3481 | x__xgafv: string, V1 error format. |
| 3482 | Allowed values |
| 3483 | 1 - v1 error format |
| 3484 | 2 - v2 error format |
| 3485 | |
| 3486 | Returns: |
| 3487 | An object of the form: |
| 3488 | |
| 3489 | { # A unit of scheduled work. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3490 | "appEngineHttpRequest": { # App Engine HTTP request. # App Engine HTTP request that is sent to the task's target. Can |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3491 | # be set only if |
| 3492 | # app_engine_http_target is set |
| 3493 | # on the queue. |
| 3494 | # |
| 3495 | # An App Engine task is a task that has AppEngineHttpRequest set. |
| 3496 | # |
| 3497 | # The message defines the HTTP request that is sent to an App Engine app when |
| 3498 | # the task is dispatched. |
| 3499 | # |
| 3500 | # This proto can only be used for tasks in a queue which has |
| 3501 | # app_engine_http_target set. |
| 3502 | # |
| 3503 | # Using AppEngineHttpRequest requires |
| 3504 | # [`appengine.applications.get`](https://cloud.google.com/appengine/docs/admin-api/access-control) |
| 3505 | # Google IAM permission for the project |
| 3506 | # and the following scope: |
| 3507 | # |
| 3508 | # `https://www.googleapis.com/auth/cloud-platform` |
| 3509 | # |
| 3510 | # The task will be delivered to the App Engine app which belongs to the same |
| 3511 | # project as the queue. For more information, see |
| 3512 | # [How Requests are |
| 3513 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 3514 | # and how routing is affected by |
| 3515 | # [dispatch |
| 3516 | # files](https://cloud.google.com/appengine/docs/python/config/dispatchref). |
| 3517 | # Traffic is encrypted during transport and never leaves Google datacenters. |
| 3518 | # Because this traffic is carried over a communication mechanism internal to |
| 3519 | # Google, you cannot explicitly set the protocol (for example, HTTP or HTTPS). |
| 3520 | # The request to the handler, however, will appear to have used the HTTP |
| 3521 | # protocol. |
| 3522 | # |
| 3523 | # The AppEngineRouting used to construct the URL that the task is |
| 3524 | # delivered to can be set at the queue-level or task-level: |
| 3525 | # |
| 3526 | # * If set, |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3527 | # app_engine_routing_override |
| 3528 | # is used for all tasks in the queue, no matter what the setting |
| 3529 | # is for the |
| 3530 | # task-level app_engine_routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3531 | # |
| 3532 | # |
| 3533 | # The `url` that the task will be sent to is: |
| 3534 | # |
| 3535 | # * `url =` host `+` |
| 3536 | # relative_url |
| 3537 | # |
| 3538 | # Tasks can be dispatched to secure app handlers, unsecure app handlers, and |
| 3539 | # URIs restricted with |
| 3540 | # [`login: |
| 3541 | # admin`](https://cloud.google.com/appengine/docs/standard/python/config/appref). |
| 3542 | # Because tasks are not run as any user, they cannot be dispatched to URIs |
| 3543 | # restricted with |
| 3544 | # [`login: |
| 3545 | # required`](https://cloud.google.com/appengine/docs/standard/python/config/appref) |
| 3546 | # Task dispatches also do not follow redirects. |
| 3547 | # |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3548 | # 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] | 3549 | # 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] | 3550 | # 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] | 3551 | # not receive response before the deadline. Failed |
| 3552 | # tasks will be retried according to the |
| 3553 | # retry configuration. `503` (Service Unavailable) is |
| 3554 | # 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] | 3555 | # will cause Cloud Tasks' traffic congestion control to temporarily throttle |
| 3556 | # 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] | 3557 | # Requests) response from an app handler does not cause traffic congestion |
| 3558 | # control to throttle the queue. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3559 | "appEngineRouting": { # App Engine Routing. # Task-level setting for App Engine routing. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3560 | # |
| 3561 | # If set, |
| 3562 | # app_engine_routing_override |
| 3563 | # is used for all tasks in the queue, no matter what the setting is for the |
| 3564 | # task-level app_engine_routing. |
| 3565 | # |
| 3566 | # Defines routing characteristics specific to App Engine - service, version, |
| 3567 | # and instance. |
| 3568 | # |
| 3569 | # For more information about services, versions, and instances see |
| 3570 | # [An Overview of App |
| 3571 | # Engine](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine), |
| 3572 | # [Microservices Architecture on Google App |
| 3573 | # Engine](https://cloud.google.com/appengine/docs/python/microservices-on-app-engine), |
| 3574 | # [App Engine Standard request |
| 3575 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed), |
| 3576 | # and [App Engine Flex request |
| 3577 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3578 | "service": "A String", # App service. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3579 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3580 | # By default, the task is sent to the service which is the default |
| 3581 | # service when the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3582 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3583 | # For some queues or tasks which were created using the App Engine |
| 3584 | # Task Queue API, host is not parsable |
| 3585 | # into service, |
| 3586 | # version, and |
| 3587 | # instance. For example, some tasks |
| 3588 | # which were created using the App Engine SDK use a custom domain |
| 3589 | # name; custom domains are not parsed by Cloud Tasks. If |
| 3590 | # host is not parsable, then |
| 3591 | # service, |
| 3592 | # version, and |
| 3593 | # instance are the empty string. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3594 | "version": "A String", # App version. |
| 3595 | # |
| 3596 | # By default, the task is sent to the version which is the default |
| 3597 | # version when the task is attempted. |
| 3598 | # |
| 3599 | # For some queues or tasks which were created using the App Engine |
| 3600 | # Task Queue API, host is not parsable |
| 3601 | # into service, |
| 3602 | # version, and |
| 3603 | # instance. For example, some tasks |
| 3604 | # which were created using the App Engine SDK use a custom domain |
| 3605 | # name; custom domains are not parsed by Cloud Tasks. If |
| 3606 | # host is not parsable, then |
| 3607 | # service, |
| 3608 | # version, and |
| 3609 | # instance are the empty string. |
| 3610 | "host": "A String", # Output only. The host that the task is sent to. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3611 | # |
| 3612 | # For more information, see |
| 3613 | # [How Requests are |
| 3614 | # Routed](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed). |
| 3615 | # |
| 3616 | # The host is constructed as: |
| 3617 | # |
| 3618 | # |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3619 | # * `host = [application_domain_name]`</br> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3620 | # `| [service] + '.' + [application_domain_name]`</br> |
| 3621 | # `| [version] + '.' + [application_domain_name]`</br> |
| 3622 | # `| [version_dot_service]+ '.' + [application_domain_name]`</br> |
| 3623 | # `| [instance] + '.' + [application_domain_name]`</br> |
| 3624 | # `| [instance_dot_service] + '.' + [application_domain_name]`</br> |
| 3625 | # `| [instance_dot_version] + '.' + [application_domain_name]`</br> |
| 3626 | # `| [instance_dot_version_dot_service] + '.' + [application_domain_name]` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3627 | # |
| 3628 | # * `application_domain_name` = The domain name of the app, for |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 3629 | # example <app-id>.appspot.com, which is associated with the |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3630 | # queue's project ID. Some tasks which were created using the App Engine |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3631 | # SDK use a custom domain name. |
| 3632 | # |
| 3633 | # * `service =` service |
| 3634 | # |
| 3635 | # * `version =` version |
| 3636 | # |
| 3637 | # * `version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3638 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3639 | # service |
| 3640 | # |
| 3641 | # * `instance =` instance |
| 3642 | # |
| 3643 | # * `instance_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3644 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3645 | # service |
| 3646 | # |
| 3647 | # * `instance_dot_version =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3648 | # instance `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3649 | # version |
| 3650 | # |
| 3651 | # * `instance_dot_version_dot_service =` |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3652 | # instance `+ '.' +` |
| 3653 | # version `+ '.' +` |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3654 | # service |
| 3655 | # |
| 3656 | # If service is empty, then the task will be sent |
| 3657 | # to the service which is the default service when the task is attempted. |
| 3658 | # |
| 3659 | # If version is empty, then the task will be sent |
| 3660 | # to the version which is the default version when the task is attempted. |
| 3661 | # |
| 3662 | # If instance is empty, then the task |
| 3663 | # will be sent to an instance which is available when the task is |
| 3664 | # attempted. |
| 3665 | # |
| 3666 | # If service, |
| 3667 | # version, or |
| 3668 | # instance is invalid, then the task |
| 3669 | # will be sent to the default version of the default service when |
| 3670 | # the task is attempted. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3671 | "instance": "A String", # App instance. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3672 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3673 | # By default, the task is sent to an instance which is available when |
| 3674 | # the task is attempted. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3675 | # |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3676 | # Requests can only be sent to a specific instance if |
| 3677 | # [manual scaling is used in App Engine |
| 3678 | # Standard](https://cloud.google.com/appengine/docs/python/an-overview-of-app-engine?hl=en_US#scaling_types_and_instance_classes). |
| 3679 | # App Engine Flex does not support instances. For more information, see |
| 3680 | # [App Engine Standard request |
| 3681 | # routing](https://cloud.google.com/appengine/docs/standard/python/how-requests-are-routed) |
| 3682 | # and [App Engine Flex request |
| 3683 | # routing](https://cloud.google.com/appengine/docs/flexible/python/how-requests-are-routed). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3684 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3685 | "headers": { # HTTP request headers. |
| 3686 | # |
| 3687 | # This map contains the header field names and values. |
| 3688 | # Headers can be set when the |
| 3689 | # task is created. |
| 3690 | # Repeated headers are not supported but a header value can contain commas. |
| 3691 | # |
| 3692 | # Cloud Tasks sets some headers to default values: |
| 3693 | # |
| 3694 | # * `User-Agent`: By default, this header is |
| 3695 | # `"AppEngine-Google; (+http://code.google.com/appengine)"`. |
| 3696 | # This header can be modified, but Cloud Tasks will append |
| 3697 | # `"AppEngine-Google; (+http://code.google.com/appengine)"` to the |
| 3698 | # modified `User-Agent`. |
| 3699 | # |
| 3700 | # If the task has a payload, Cloud |
| 3701 | # Tasks sets the following headers: |
| 3702 | # |
| 3703 | # * `Content-Type`: By default, the `Content-Type` header is set to |
| 3704 | # `"application/octet-stream"`. The default can be overridden by explicitly |
| 3705 | # setting `Content-Type` to a particular media type when the |
| 3706 | # task is created. |
| 3707 | # For example, `Content-Type` can be set to `"application/json"`. |
| 3708 | # * `Content-Length`: This is computed by Cloud Tasks. This value is |
| 3709 | # output only. It cannot be changed. |
| 3710 | # |
| 3711 | # The headers below cannot be set or overridden: |
| 3712 | # |
| 3713 | # * `Host` |
| 3714 | # * `X-Google-*` |
| 3715 | # * `X-AppEngine-*` |
| 3716 | # |
| 3717 | # In addition, Cloud Tasks sets some headers when the task is dispatched, |
| 3718 | # such as headers containing information about the task; see |
| 3719 | # [request |
| 3720 | # headers](https://cloud.google.com/appengine/docs/python/taskqueue/push/creating-handlers#reading_request_headers). |
| 3721 | # These headers are set only when the task is dispatched, so they are not |
| 3722 | # visible when the task is returned in a Cloud Tasks response. |
| 3723 | # |
| 3724 | # Although there is no specific limit for the maximum number of headers or |
| 3725 | # the size, there is a limit on the maximum size of the Task. For more |
| 3726 | # information, see the CreateTask documentation. |
| 3727 | "a_key": "A String", |
| 3728 | }, |
| 3729 | "relativeUrl": "A String", # The relative URL. |
| 3730 | # |
| 3731 | # The relative URL must begin with "/" and must be a valid HTTP relative URL. |
| 3732 | # It can contain a path and query string arguments. |
| 3733 | # If the relative URL is empty, then the root path "/" will be used. |
| 3734 | # No spaces are allowed, and the maximum length allowed is 2083 characters. |
| 3735 | "payload": "A String", # Payload. |
| 3736 | # |
| 3737 | # The payload will be sent as the HTTP message body. A message |
| 3738 | # body, and thus a payload, is allowed only if the HTTP method is |
| 3739 | # POST or PUT. It is an error to set a data payload on a task with |
| 3740 | # an incompatible HttpMethod. |
| 3741 | "httpMethod": "A String", # The HTTP method to use for the request. The default is POST. |
| 3742 | # |
| 3743 | # The app's request handler for the task's target URL must be able to handle |
| 3744 | # HTTP requests with this http_method, otherwise the task attempt fails with |
| 3745 | # error code 405 (Method Not Allowed). See [Writing a push task request |
| 3746 | # handler](https://cloud.google.com/appengine/docs/java/taskqueue/push/creating-handlers#writing_a_push_task_request_handler) |
| 3747 | # and the App Engine documentation for your runtime on [How Requests are |
| 3748 | # Handled](https://cloud.google.com/appengine/docs/standard/python3/how-requests-are-handled). |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3749 | }, |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3750 | "status": { # Status of the task. # Output only. The task status. |
| 3751 | "attemptDispatchCount": 42, # Output only. The number of attempts dispatched. |
| 3752 | # |
| 3753 | # This count includes attempts which have been dispatched but haven't |
| 3754 | # received a response. |
| 3755 | "firstAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's first attempt. |
| 3756 | # |
| 3757 | # Only dispatch_time will be set. |
| 3758 | # The other AttemptStatus information is not retained by Cloud Tasks. |
| 3759 | # |
| 3760 | # This field is not calculated for pull tasks. |
| 3761 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 3762 | # |
| 3763 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 3764 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 3765 | # |
| 3766 | # If the task has not been attempted or the task is currently running |
| 3767 | # then the response status is unset. |
| 3768 | # different programming environments, including REST APIs and RPC APIs. It is |
| 3769 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 3770 | # three pieces of data: error code, error message, and error details. |
| 3771 | # |
| 3772 | # You can find out more about this error model and how to work with it in the |
| 3773 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 3774 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 3775 | # user-facing error message should be localized and sent in the |
| 3776 | # google.rpc.Status.details field, or localized by the client. |
| 3777 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 3778 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 3779 | # message types for APIs to use. |
| 3780 | { |
| 3781 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 3782 | }, |
| 3783 | ], |
| 3784 | }, |
| 3785 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 3786 | # |
| 3787 | # `response_time` will be truncated to the nearest microsecond. |
| 3788 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 3789 | # |
| 3790 | # `schedule_time` will be truncated to the nearest microsecond. |
| 3791 | }, |
| 3792 | "lastAttemptStatus": { # The status of a task attempt. # Output only. The status of the task's last attempt. |
| 3793 | # |
| 3794 | # This field is not calculated for pull tasks. |
| 3795 | "dispatchTime": "A String", # Output only. The time that this attempt was dispatched. |
| 3796 | # |
| 3797 | # `dispatch_time` will be truncated to the nearest microsecond. |
| 3798 | "responseStatus": { # The `Status` type defines a logical error model that is suitable for # Output only. The response from the target for this attempt. |
| 3799 | # |
| 3800 | # If the task has not been attempted or the task is currently running |
| 3801 | # then the response status is unset. |
| 3802 | # different programming environments, including REST APIs and RPC APIs. It is |
| 3803 | # used by [gRPC](https://github.com/grpc). Each `Status` message contains |
| 3804 | # three pieces of data: error code, error message, and error details. |
| 3805 | # |
| 3806 | # You can find out more about this error model and how to work with it in the |
| 3807 | # [API Design Guide](https://cloud.google.com/apis/design/errors). |
| 3808 | "message": "A String", # A developer-facing error message, which should be in English. Any |
| 3809 | # user-facing error message should be localized and sent in the |
| 3810 | # google.rpc.Status.details field, or localized by the client. |
| 3811 | "code": 42, # The status code, which should be an enum value of google.rpc.Code. |
| 3812 | "details": [ # A list of messages that carry the error details. There is a common set of |
| 3813 | # message types for APIs to use. |
| 3814 | { |
| 3815 | "a_key": "", # Properties of the object. Contains field @type with type URL. |
| 3816 | }, |
| 3817 | ], |
| 3818 | }, |
| 3819 | "responseTime": "A String", # Output only. The time that this attempt response was received. |
| 3820 | # |
| 3821 | # `response_time` will be truncated to the nearest microsecond. |
| 3822 | "scheduleTime": "A String", # Output only. The time that this attempt was scheduled. |
| 3823 | # |
| 3824 | # `schedule_time` will be truncated to the nearest microsecond. |
| 3825 | }, |
| 3826 | "attemptResponseCount": 42, # Output only. The number of attempts which have received a response. |
| 3827 | # |
| 3828 | # This field is not calculated for pull tasks. |
| 3829 | }, |
| 3830 | "createTime": "A String", # Output only. The time that the task was created. |
| 3831 | # |
| 3832 | # `create_time` will be truncated to the nearest second. |
| 3833 | "name": "A String", # Optionally caller-specified in CreateTask. |
| 3834 | # |
| 3835 | # The task name. |
| 3836 | # |
| 3837 | # The task name must have the following format: |
| 3838 | # `projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID` |
| 3839 | # |
| 3840 | # * `PROJECT_ID` can contain letters ([A-Za-z]), numbers ([0-9]), |
| 3841 | # hyphens (-), colons (:), or periods (.). |
| 3842 | # For more information, see |
| 3843 | # [Identifying |
| 3844 | # projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) |
| 3845 | # * `LOCATION_ID` is the canonical ID for the task's location. |
| 3846 | # The list of available locations can be obtained by calling |
| 3847 | # ListLocations. |
| 3848 | # For more information, see https://cloud.google.com/about/locations/. |
| 3849 | # * `QUEUE_ID` can contain letters ([A-Za-z]), numbers ([0-9]), or |
| 3850 | # hyphens (-). The maximum length is 100 characters. |
| 3851 | # * `TASK_ID` can contain only letters ([A-Za-z]), numbers ([0-9]), |
| 3852 | # hyphens (-), or underscores (_). The maximum length is 500 characters. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 3853 | "pullMessage": { # The pull message contains data that can be used by the caller of # LeaseTasks to process the task. Can be |
| 3854 | # set only if pull_target is set on the queue. |
| 3855 | # |
| 3856 | # A pull task is a task that has PullMessage set. |
| 3857 | # LeaseTasks to process the task. |
| 3858 | # |
| 3859 | # This proto can only be used for tasks in a queue which has |
| 3860 | # pull_target set. |
| 3861 | "payload": "A String", # A data payload consumed by the worker to execute the task. |
| 3862 | "tag": "A String", # The task's tag. |
| 3863 | # |
| 3864 | # Tags allow similar tasks to be processed in a batch. If you label |
| 3865 | # tasks with a tag, your worker can |
| 3866 | # lease tasks with the same tag using |
| 3867 | # filter. For example, if you want to |
| 3868 | # aggregate the events associated with a specific user once a day, |
| 3869 | # you could tag tasks with the user ID. |
| 3870 | # |
| 3871 | # The task's tag can only be set when the |
| 3872 | # task is created. |
| 3873 | # |
| 3874 | # The tag must be less than 500 characters. |
| 3875 | # |
| 3876 | # SDK compatibility: Although the SDK allows tags to be either |
| 3877 | # string or |
| 3878 | # [bytes](https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/taskqueue/TaskOptions.html#tag-byte:A-), |
| 3879 | # only UTF-8 encoded tags can be used in Cloud Tasks. If a tag isn't UTF-8 |
| 3880 | # encoded, the tag will be empty when the task is returned by Cloud Tasks. |
| 3881 | }, |
| 3882 | "scheduleTime": "A String", # The time when the task is scheduled to be attempted. |
| 3883 | # |
| 3884 | # For App Engine queues, this is when the task will be attempted or retried. |
| 3885 | # |
| 3886 | # For pull queues, this is the time when the task is available to |
| 3887 | # be leased; if a task is currently leased, this is the time when |
| 3888 | # the current lease expires, that is, the time that the task was |
| 3889 | # leased plus the lease_duration. |
| 3890 | # |
| 3891 | # `schedule_time` will be truncated to the nearest microsecond. |
Bu Sun Kim | d059ad8 | 2020-07-22 17:02:09 -0700 | [diff] [blame] | 3892 | "view": "A String", # Output only. The view specifies which subset of the Task has |
| 3893 | # been returned. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 3894 | }</pre> |
| 3895 | </div> |
| 3896 | |
| 3897 | </body></html> |