Creates a queue. 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-create ...

Required Scalar Argument

  • <parent> (string)
    • Required. The location name in which the queue will be created. For example: projects/PROJECT_ID/locations/LOCATION_ID The list of allowed locations can be obtained by calling Cloud Tasks' implementation of ListLocations.

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=no
    • 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] + &#39;.&#39; + [application_domain_name] | [version] + &#39;.&#39; + [application_domain_name] | [version_dot_service]+ &#39;.&#39; + [application_domain_name] | [instance] + &#39;.&#39; + [application_domain_name] | [instance_dot_service] + &#39;.&#39; + [application_domain_name] | [instance_dot_version] + &#39;.&#39; + [application_domain_name] | [instance_dot_version_dot_service] + &#39;.&#39; + [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 + &#39;.&#39; + service * instance = instance * instance_dot_service = instance + &#39;.&#39; + service * instance_dot_version = instance + &#39;.&#39; + version * instance_dot_version_dot_service = instance + &#39;.&#39; + version + &#39;.&#39; + 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.
  • instance=ipsum
  • service=voluptua.
    • 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=at

    • 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=sanctus

    • 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=sed
    • 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=amet.

    • 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=takimata

    • Audience to be used when generating OIDC token. If not specified, the URI specified in target will be used.
  • service-account-email=amet.

    • 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=duo

    • 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=ipsum

    • The URI path (e.g., /users/1234). Default is an empty string.
  • .. port=gubergren

    • 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=lorem

    • The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty string.
  • .. scheme=gubergren

    • Scheme override. When specified, the task URI scheme is replaced by the provided value (HTTP or HTTPS).
  • uri-override-enforce-mode=eos

    • URI Override Enforce Mode When specified, determines the Target UriOverride mode. If not specified, it defaults to ALWAYS.
  • ... name=dolor

    • 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.
  • purge-time=ea
    • 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=46
    • 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 of max_burst_size is picked by Cloud Tasks based on the value of max_dispatches_per_second. The maximum value of max_burst_size is 500. For App Engine queues that were created or updated using queue.yaml/xml, max_burst_size is equal to bucket_size. If UpdateQueue is called on a queue without explicitly setting a value for max_burst_size, max_burst_size value will get updated if UpdateQueue is updating max_dispatches_per_second.
  • max-concurrent-tasks=13
    • 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.
  • max-tasks-dispatched-per-second=0.42548765853373427

    • 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.
  • ..retry-config max-attempts=81

    • 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 be max_attempts - 1 retries). Must be > 0.
  • max-backoff=ipsum
    • 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.
  • max-doublings=8
    • The time between retries will double max_doublings times. A task's retry interval starts at min_backoff, then doubles max_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, and max_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.
  • max-retry-duration=ut
    • If positive, max_retry_duration specifies the time limit for retrying a failed task, measured from when the task was first attempted. Once max_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.
  • min-backoff=gubergren
    • 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.
  • unlimited-attempts=true

    • If true, then the number of attempts is unlimited.
  • .. state=ipsum

    • 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 change state.
  • stats concurrent-dispatches-count=-50
    • Output only. The number of requests that the queue has dispatched but has not received a reply for yet.
  • effective-execution-rate=0.8016125465746553
    • 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=-62
    • 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=ea
    • Output only. An estimation of the nearest time in the future where a task in the queue is scheduled to be executed.
  • tasks-count=-99

    • 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=lorem

    • 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 for task_ttl, the task will be deleted regardless of whether it was dispatched or not. The task_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.
  • tombstone-ttl=eos
    • 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 default tombstone_ttl of 1 hour.

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.

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").