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