Updates a queue. This method creates the queue if it does not exist and updates the queue if it does exist. Queues created with this method allow tasks to live for a maximum of 31 days. After a task is 31 days old, the task will be deleted regardless of whether it was dispatched or not. WARNING: Using this method may have unintended side effects if you are using an App Engine queue.yaml
or queue.xml
file to manage your queues. Read Overview of Queue Management and queue.yaml before using this method.
Scopes
You will need authorization for the https://www.googleapis.com/auth/cloud-platform scope to make a valid call.
If unset, the scope for this method defaults to https://www.googleapis.com/auth/cloud-platform.
You can set the scope for this method like this: cloudtasks2-beta2 --scope <scope> projects locations-queues-patch ...
Required Scalar Argument
- <name> (string)
- Caller-specified and required in CreateQueue, after which it becomes output only. The queue name. The queue name must have the following format:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID
*PROJECT_ID
can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see Identifying projects *LOCATION_ID
is the canonical ID for the queue's location. The list of available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. *QUEUE_ID
can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum length is 100 characters.
- Caller-specified and required in CreateQueue, after which it becomes output only. The queue name. The queue name must have the following format:
Required Request Value
The request value is a data-structure with various fields. Each field may be a simple scalar or another data-structure. In the latter case it is advised to set the field-cursor to the data-structure's field to specify values more concisely.
For example, a structure like this:
Queue:
app-engine-http-target:
app-engine-routing-override:
host: string
instance: string
service: string
version: string
http-target:
http-method: string
oauth-token:
scope: string
service-account-email: string
oidc-token:
audience: string
service-account-email: string
uri-override:
host: string
path-override:
path: string
port: string
query-override:
query-params: string
scheme: string
uri-override-enforce-mode: string
name: string
purge-time: string
rate-limits:
max-burst-size: integer
max-concurrent-tasks: integer
max-tasks-dispatched-per-second: number
retry-config:
max-attempts: integer
max-backoff: string
max-doublings: integer
max-retry-duration: string
min-backoff: string
unlimited-attempts: boolean
state: string
stats:
concurrent-dispatches-count: int64
effective-execution-rate: number
executed-last-minute-count: int64
oldest-estimated-arrival-time: string
tasks-count: int64
task-ttl: string
tombstone-ttl: string
can be set completely with the following arguments which are assumed to be executed in the given order. Note how the cursor position is adjusted to the respective structures, allowing simple field names to be used most of the time.
-r .app-engine-http-target.app-engine-routing-override host=sed
- Output only. The host that the task is sent to. For more information, see How Requests are Routed. The host is constructed as: *
host = [application_domain_name]
| [service] + '.' + [application_domain_name]
| [version] + '.' + [application_domain_name]
| [version_dot_service]+ '.' + [application_domain_name]
| [instance] + '.' + [application_domain_name]
| [instance_dot_service] + '.' + [application_domain_name]
| [instance_dot_version] + '.' + [application_domain_name]
| [instance_dot_version_dot_service] + '.' + [application_domain_name]
*application_domain_name
= The domain name of the app, for example .appspot.com, which is associated with the queue's project ID. Some tasks which were created using the App Engine SDK use a custom domain name. *service =
service *version =
version *version_dot_service =
version+ '.' +
service *instance =
instance *instance_dot_service =
instance+ '.' +
service *instance_dot_version =
instance+ '.' +
version *instance_dot_version_dot_service =
instance+ '.' +
version+ '.' +
service If service is empty, then the task will be sent to the service which is the default service when the task is attempted. If version is empty, then the task will be sent to the version which is the default version when the task is attempted. If instance is empty, then the task will be sent to an instance which is available when the task is attempted. If service, version, or instance is invalid, then the task will be sent to the default version of the default service when the task is attempted.
- Output only. The host that the task is sent to. For more information, see How Requests are Routed. The host is constructed as: *
instance=duo
- App instance. By default, the task is sent to an instance which is available when the task is attempted. Requests can only be sent to a specific instance if manual scaling is used in App Engine Standard. App Engine Flex does not support instances. For more information, see App Engine Standard request routing and App Engine Flex request routing.
service=sed
- App service. By default, the task is sent to the service which is the default service when the task is attempted. For some queues or tasks which were created using the App Engine Task Queue API, host is not parsable into service, version, and instance. For example, some tasks which were created using the App Engine SDK use a custom domain name; custom domains are not parsed by Cloud Tasks. If host is not parsable, then service, version, and instance are the empty string.
-
version=no
- App version. By default, the task is sent to the version which is the default version when the task is attempted. For some queues or tasks which were created using the App Engine Task Queue API, host is not parsable into service, version, and instance. For example, some tasks which were created using the App Engine SDK use a custom domain name; custom domains are not parsed by Cloud Tasks. If host is not parsable, then service, version, and instance are the empty string.
-
...http-target http-method=stet
- The HTTP method to use for the request. When specified, it overrides HttpRequest for the task. Note that if the value is set to HttpMethod the HttpRequest of the task will be ignored at execution time.
oauth-token scope=kasd
- OAuth scope to be used for generating OAuth access token. If not specified, "https://www.googleapis.com/auth/cloud-platform" will be used.
-
service-account-email=et
- Service account email to be used for generating OAuth token. The service account must be within the same project as the queue. The caller must have iam.serviceAccounts.actAs permission for the service account.
-
..oidc-token audience=sed
- Audience to be used when generating OIDC token. If not specified, the URI specified in target will be used.
-
service-account-email=et
- Service account email to be used for generating OIDC token. The service account must be within the same project as the queue. The caller must have iam.serviceAccounts.actAs permission for the service account.
-
..uri-override host=et
- Host override. When specified, replaces the host part of the task URL. For example, if the task URL is "https://www.google.com," and host value is set to "example.net", the overridden URI will be changed to "https://example.net." Host value cannot be an empty string (INVALID_ARGUMENT).
-
path-override path=vero
- The URI path (e.g., /users/1234). Default is an empty string.
-
.. port=erat
- Port override. When specified, replaces the port part of the task URI. For instance, for a URI http://www.google.com/foo and port=123, the overridden URI becomes http://www.google.com:123/foo. Note that the port value must be a positive integer. Setting the port to 0 (Zero) clears the URI port.
-
query-override query-params=sed
- The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty string.
-
.. scheme=duo
- Scheme override. When specified, the task URI scheme is replaced by the provided value (HTTP or HTTPS).
-
uri-override-enforce-mode=dolore
- URI Override Enforce Mode When specified, determines the Target UriOverride mode. If not specified, it defaults to ALWAYS.
-
... name=et
- Caller-specified and required in CreateQueue, after which it becomes output only. The queue name. The queue name must have the following format:
projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID
*PROJECT_ID
can contain letters ([A-Za-z]), numbers ([0-9]), hyphens (-), colons (:), or periods (.). For more information, see Identifying projects *LOCATION_ID
is the canonical ID for the queue's location. The list of available locations can be obtained by calling ListLocations. For more information, see https://cloud.google.com/about/locations/. *QUEUE_ID
can contain letters ([A-Za-z]), numbers ([0-9]), or hyphens (-). The maximum length is 100 characters.
- Caller-specified and required in CreateQueue, after which it becomes output only. The queue name. The queue name must have the following format:
purge-time=voluptua.
- Output only. The last time this queue was purged. All tasks that were created before this time were purged. A queue can be purged using PurgeQueue, the App Engine Task Queue SDK, or the Cloud Console. Purge time will be truncated to the nearest microsecond. Purge time will be unset if the queue has never been purged.
rate-limits max-burst-size=99
- The max burst size. Max burst size limits how fast tasks in queue are processed when many tasks are in the queue and the rate is high. This field allows the queue to have a high rate so processing starts shortly after a task is enqueued, but still limits resource usage when many tasks are enqueued in a short period of time. The token bucket algorithm is used to control the rate of task dispatches. Each queue has a token bucket that holds tokens, up to the maximum specified by
max_burst_size
. Each time a task is dispatched, a token is removed from the bucket. Tasks will be dispatched until the queue's bucket runs out of tokens. The bucket will be continuously refilled with new tokens based on max_dispatches_per_second. The default value ofmax_burst_size
is picked by Cloud Tasks based on the value of max_dispatches_per_second. The maximum value ofmax_burst_size
is 500. For App Engine queues that were created or updated usingqueue.yaml/xml
,max_burst_size
is equal to bucket_size. If UpdateQueue is called on a queue without explicitly setting a value formax_burst_size
,max_burst_size
value will get updated if UpdateQueue is updating max_dispatches_per_second.
- The max burst size. Max burst size limits how fast tasks in queue are processed when many tasks are in the queue and the rate is high. This field allows the queue to have a high rate so processing starts shortly after a task is enqueued, but still limits resource usage when many tasks are enqueued in a short period of time. The token bucket algorithm is used to control the rate of task dispatches. Each queue has a token bucket that holds tokens, up to the maximum specified by
max-concurrent-tasks=5
- The maximum number of concurrent tasks that Cloud Tasks allows to be dispatched for this queue. After this threshold has been reached, Cloud Tasks stops dispatching tasks until the number of concurrent requests decreases. If unspecified when the queue is created, Cloud Tasks will pick the default. The maximum allowed value is 5,000. This field is output only for pull queues and always -1, which indicates no limit. No other queue types can have
max_concurrent_tasks
set to -1. This field has the same meaning as max_concurrent_requests in queue.yaml/xml.
- The maximum number of concurrent tasks that Cloud Tasks allows to be dispatched for this queue. After this threshold has been reached, Cloud Tasks stops dispatching tasks until the number of concurrent requests decreases. If unspecified when the queue is created, Cloud Tasks will pick the default. The maximum allowed value is 5,000. This field is output only for pull queues and always -1, which indicates no limit. No other queue types can have
-
max-tasks-dispatched-per-second=0.07223777776561668
- The maximum rate at which tasks are dispatched from this queue. If unspecified when the queue is created, Cloud Tasks will pick the default. * For App Engine queues, the maximum allowed value is 500. * This field is output only for pull queues. In addition to the
max_tasks_dispatched_per_second
limit, a maximum of 10 QPS of LeaseTasks requests are allowed per pull queue. This field has the same meaning as rate in queue.yaml/xml.
- The maximum rate at which tasks are dispatched from this queue. If unspecified when the queue is created, Cloud Tasks will pick the default. * For App Engine queues, the maximum allowed value is 500. * This field is output only for pull queues. In addition to the
-
..retry-config max-attempts=83
- The maximum number of attempts for a task. Cloud Tasks will attempt the task
max_attempts
times (that is, if the first attempt fails, then there will bemax_attempts - 1
retries). Must be > 0.
- The maximum number of attempts for a task. Cloud Tasks will attempt the task
max-backoff=et
- A task will be scheduled for retry between min_backoff and max_backoff duration after it fails, if the queue's RetryConfig specifies that the task should be retried. If unspecified when the queue is created, Cloud Tasks will pick the default. This field is output only for pull queues.
max_backoff
will be truncated to the nearest second. This field has the same meaning as max_backoff_seconds in queue.yaml/xml.
- A task will be scheduled for retry between min_backoff and max_backoff duration after it fails, if the queue's RetryConfig specifies that the task should be retried. If unspecified when the queue is created, Cloud Tasks will pick the default. This field is output only for pull queues.
max-doublings=6
- The time between retries will double
max_doublings
times. A task's retry interval starts at min_backoff, then doublesmax_doublings
times, then increases linearly, and finally retries at intervals of max_backoff up to max_attempts times. For example, if min_backoff is 10s, max_backoff is 300s, andmax_doublings
is 3, then the a task will first be retried in 10s. The retry interval will double three times, and then increase linearly by 2^3 * 10s. Finally, the task will retry at intervals of max_backoff until the task has been attempted max_attempts times. Thus, the requests will retry at 10s, 20s, 40s, 80s, 160s, 240s, 300s, 300s, .... If unspecified when the queue is created, Cloud Tasks will pick the default. This field is output only for pull queues. This field has the same meaning as max_doublings in queue.yaml/xml.
- The time between retries will double
max-retry-duration=stet
- If positive,
max_retry_duration
specifies the time limit for retrying a failed task, measured from when the task was first attempted. Oncemax_retry_duration
time has passed and the task has been attempted max_attempts times, no further attempts will be made and the task will be deleted. If zero, then the task age is unlimited. If unspecified when the queue is created, Cloud Tasks will pick the default. This field is output only for pull queues.max_retry_duration
will be truncated to the nearest second. This field has the same meaning as task_age_limit in queue.yaml/xml.
- If positive,
min-backoff=dolor
- A task will be scheduled for retry between min_backoff and max_backoff duration after it fails, if the queue's RetryConfig specifies that the task should be retried. If unspecified when the queue is created, Cloud Tasks will pick the default. This field is output only for pull queues.
min_backoff
will be truncated to the nearest second. This field has the same meaning as min_backoff_seconds in queue.yaml/xml.
- A task will be scheduled for retry between min_backoff and max_backoff duration after it fails, if the queue's RetryConfig specifies that the task should be retried. If unspecified when the queue is created, Cloud Tasks will pick the default. This field is output only for pull queues.
-
unlimited-attempts=false
- If true, then the number of attempts is unlimited.
-
.. state=vero
- Output only. The state of the queue.
state
can only be changed by called PauseQueue, ResumeQueue, or uploading queue.yaml/xml. UpdateQueue cannot be used to changestate
.
- Output only. The state of the queue.
stats concurrent-dispatches-count=-88
- Output only. The number of requests that the queue has dispatched but has not received a reply for yet.
effective-execution-rate=0.28492583480905564
- Output only. The current maximum number of tasks per second executed by the queue. The maximum value of this variable is controlled by the RateLimits of the Queue. However, this value could be less to avoid overloading the endpoints tasks in the queue are targeting.
executed-last-minute-count=-44
- Output only. The number of tasks that the queue has dispatched and received a reply for during the last minute. This variable counts both successful and non-successful executions.
oldest-estimated-arrival-time=lorem
- Output only. An estimation of the nearest time in the future where a task in the queue is scheduled to be executed.
-
tasks-count=-29
- Output only. An estimation of the number of tasks in the queue, that is, the tasks in the queue that haven't been executed, the tasks in the queue which the queue has dispatched but has not yet received a reply for, and the failed tasks that the queue is retrying.
-
.. task-ttl=no
- The maximum amount of time that a task will be retained in this queue. Queues created by Cloud Tasks have a default
task_ttl
of 31 days. After a task has lived fortask_ttl
, the task will be deleted regardless of whether it was dispatched or not. Thetask_ttl
for queues created via queue.yaml/xml is equal to the maximum duration because there is a storage quota for these queues. To view the maximum valid duration, see the documentation for Duration.
- The maximum amount of time that a task will be retained in this queue. Queues created by Cloud Tasks have a default
tombstone-ttl=ipsum
- The task tombstone time to live (TTL). After a task is deleted or completed, the task's tombstone is retained for the length of time specified by
tombstone_ttl
. The tombstone is used by task de-duplication; another task with the same name can't be created until the tombstone has expired. For more information about task de-duplication, see the documentation for CreateTaskRequest. Queues created by Cloud Tasks have a defaulttombstone_ttl
of 1 hour.
- The task tombstone time to live (TTL). After a task is deleted or completed, the task's tombstone is retained for the length of time specified by
About Cursors
The cursor position is key to comfortably set complex nested structures. The following rules apply:
- The cursor position is always set relative to the current one, unless the field name starts with the
.
character. Fields can be nested such as in-r f.s.o
. - The cursor position is set relative to the top-level structure if it starts with
.
, e.g.-r .s.s
- You can also set nested fields without setting the cursor explicitly. For example, to set a value relative to the current cursor position, you would specify
-r struct.sub_struct=bar
. - You can move the cursor one level up by using
..
. Each additional.
moves it up one additional level. E.g....
would go three levels up.
Optional Output Flags
The method's return value a JSON encoded structure, which will be written to standard output by default.
- -o out
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
-
to indicate standard output, or a filepath that is to contain the received bytes. If unset, it defaults to standard output.
- out specifies the destination to which to write the server's result to.
It will be a JSON-encoded structure.
The destination may be
Optional Method Properties
You may set the following properties to further configure the call. Please note that -p
is followed by one
or more key-value-pairs, and is called like this -p k1=v1 k2=v2
even though the listing below repeats the
-p
for completeness.
- -p update-mask=string
- A mask used to specify which fields of the queue are being updated. If empty, then all fields will be updated.
Optional General Properties
The following properties can configure any call, and are not specific to this method.
-
-p $-xgafv=string
- V1 error format.
-
-p access-token=string
- OAuth access token.
-
-p alt=string
- Data format for response.
-
-p callback=string
- JSONP
-
-p fields=string
- Selector specifying which fields to include in a partial response.
-
-p key=string
- API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
-
-p oauth-token=string
- OAuth 2.0 token for the current user.
-
-p pretty-print=boolean
- Returns response with indentations and line breaks.
-
-p quota-user=string
- Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
-
-p upload-type=string
- Legacy upload protocol for media (e.g. "media", "multipart").
-
-p upload-protocol=string
- Upload protocol for media (e.g. "raw", "multipart").