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-beta3 --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-queue:
    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-dispatches: integer
    max-dispatches-per-second: number
  retry-config:
    max-attempts: integer
    max-backoff: string
    max-doublings: integer
    max-retry-duration: string
    min-backoff: string
  stackdriver-logging-config:
    sampling-ratio: number
  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
  type: 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-queue.app-engine-routing-override host=et
    • Output only. The host that the task is sent to. The host is constructed from the domain name of the app associated with the queue's project ID (for example .appspot.com), and the service, version, and instance. Tasks which were created using the App Engine SDK might have a custom domain name. For more information, see How Requests are Routed.
  • instance=magna
  • service=no
    • 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=ipsum

    • 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=voluptua.

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

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

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

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

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

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

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

    • 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=eos
    • 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=97
    • 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-dispatches=84
    • 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 has the same meaning as max_concurrent_requests in queue.yaml/xml.
  • max-dispatches-per-second=0.8638300740145545

    • 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 has the same meaning as rate in queue.yaml/xml.
  • ..retry-config max-attempts=46

    • Number of attempts per 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 >= -1. If unspecified when the queue is created, Cloud Tasks will pick the default. -1 indicates unlimited attempts. This field has the same meaning as task_retry_limit in queue.yaml/xml.
  • max-backoff=invidunt
    • 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. The value must be given as a string that indicates the length of time (in seconds) followed by s (for "seconds"). For more information on the format, see the documentation for Duration. 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=54
    • 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 has the same meaning as max_doublings in queue.yaml/xml.
  • max-retry-duration=duo
    • 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. The value must be given as a string that indicates the length of time (in seconds) followed by s (for "seconds"). For the maximum possible value or the format, see the documentation for Duration. 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=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. The value must be given as a string that indicates the length of time (in seconds) followed by s (for "seconds"). For more information on the format, see the documentation for Duration. min_backoff will be truncated to the nearest second. This field has the same meaning as min_backoff_seconds in queue.yaml/xml.
  • ..stackdriver-logging-config sampling-ratio=0.9001265173058445

    • Specifies the fraction of operations to write to Stackdriver Logging. This field may contain any value between 0.0 and 1.0, inclusive. 0.0 is the default and means that no operations are logged.
  • .. state=ut

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

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

    • The maximum amount of time that a task will be retained in this queue. After a task has lived for task_ttl, the task will be deleted regardless of whether it was dispatched or not. The minimum value is 10 days. The maximum value is 10 years. The value must be given as a string that indicates the length of time (in seconds) followed by s (for "seconds"). For more information on the format, see the documentation for Duration. Queues created by Cloud Tasks have a default task_ttl of 31 days. . Queues created by queue.yaml/xml have a fixed task_ttl of the maximum duration, because there is a storage quota for these queues.
  • tombstone-ttl=ea
    • The task tombstone time to live (TTL). After a task is deleted or executed, 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. The minimum value is 1 hour. The maximum value is 9 days. The value must be given as a string that indicates the length of time (in seconds) followed by s (for "seconds"). For more information on the format, see the documentation for Duration. Queues created by Cloud Tasks have a default tombstone_ttl of 1 hour.
  • type=dolor
    • Immutable. The type of a queue (push or pull). Queue.type is an immutable property of the queue that is set at the queue creation time. When left unspecified, the default value of PUSH is selected.

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