class ProjectsLocationsQueues extends Resource (View source)

The "queues" collection of methods.

Typical usage is:

 $cloudtasksService = new Google\Service\CloudTasks(...);
 $queues = $cloudtasksService->projects_locations_queues;

Methods

create(string $parent, Queue $postBody, array $optParams = [])

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. (queues.create)

delete(string $name, array $optParams = [])

Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, you may be prevented from creating a new queue with the same name as the deleted queue for a tombstone window of up to 3 days. During this window, the CreateQueue operation may appear to recreate the queue, but this can be misleading. If you attempt to create a queue with the same name as one that is in the tombstone window, run GetQueue to confirm that the queue creation was successful. If GetQueue returns 200 response code, your queue was successfully created with the name of the previously deleted queue. Otherwise, your queue did not successfully recreate. 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. (queues.delete)

get(string $name, array $optParams = [])

Gets a queue. (queues.get)

getIamPolicy(string $resource, GetIamPolicyRequest $postBody, array $optParams = [])

Gets the access control policy for a Queue. Returns an empty policy if the resource exists and does not have a policy set. Authorization requires the following Google IAM permission on the specified resource parent: * cloudtasks.queues.getIamPolicy (queues.getIamPolicy)

listProjectsLocationsQueues(string $parent, array $optParams = [])

Lists queues. Queues are returned in lexicographical order.

patch(string $name, Queue $postBody, array $optParams = [])

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. (queues.patch)

pause(string $name, PauseQueueRequest $postBody, array $optParams = [])

Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the queue is resumed via ResumeQueue. Tasks can still be added when the queue is paused. A queue is paused if its state is PAUSED.

purge(string $name, PurgeQueueRequest $postBody, array $optParams = [])

Purges a queue by deleting all of its tasks. All tasks created before this method is called are permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. (queues.purge)

resume(string $name, ResumeQueueRequest $postBody, array $optParams = [])

Resume a queue. This method resumes a queue after it has been PAUSED or DISABLED. The state of a queue is stored in the queue's state; after calling this method it will be set to RUNNING. WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks. (queues.resume)

setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])

Sets the access control policy for a Queue. Replaces any existing policy.

testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on a Queue. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Details

Queue create(string $parent, Queue $postBody, array $optParams = [])

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. (queues.create)

Parameters

string $parent

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.

Queue $postBody
array $optParams

Optional parameters.

Return Value

Queue

Exceptions

Exception

CloudtasksEmpty delete(string $name, array $optParams = [])

Deletes a queue. This command will delete the queue even if it has tasks in it. Note: If you delete a queue, you may be prevented from creating a new queue with the same name as the deleted queue for a tombstone window of up to 3 days. During this window, the CreateQueue operation may appear to recreate the queue, but this can be misleading. If you attempt to create a queue with the same name as one that is in the tombstone window, run GetQueue to confirm that the queue creation was successful. If GetQueue returns 200 response code, your queue was successfully created with the name of the previously deleted queue. Otherwise, your queue did not successfully recreate. 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. (queues.delete)

Parameters

string $name

Required. The queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID

array $optParams

Optional parameters.

Return Value

CloudtasksEmpty

Exceptions

Exception

Queue get(string $name, array $optParams = [])

Gets a queue. (queues.get)

Parameters

string $name

Required. The resource name of the queue. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID

array $optParams

Optional parameters.

Return Value

Queue

Exceptions

Exception

Policy getIamPolicy(string $resource, GetIamPolicyRequest $postBody, array $optParams = [])

Gets the access control policy for a Queue. Returns an empty policy if the resource exists and does not have a policy set. Authorization requires the following Google IAM permission on the specified resource parent: * cloudtasks.queues.getIamPolicy (queues.getIamPolicy)

Parameters

string $resource

REQUIRED: The resource for which the policy is being requested. See Resource names for the appropriate value for this field.

GetIamPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

ListQueuesResponse listProjectsLocationsQueues(string $parent, array $optParams = [])

Lists queues. Queues are returned in lexicographical order.

(queues.listProjectsLocationsQueues)

Parameters

string $parent

Required. The location name. For example: projects/PROJECT_ID/locations/LOCATION_ID

array $optParams

Optional parameters.

Return Value

ListQueuesResponse

Exceptions

Exception

Queue patch(string $name, Queue $postBody, array $optParams = [])

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. (queues.patch)

Parameters

string $name

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.
Queue $postBody
array $optParams

Optional parameters.

Return Value

Queue

Exceptions

Exception

Queue pause(string $name, PauseQueueRequest $postBody, array $optParams = [])

Pauses the queue. If a queue is paused then the system will stop dispatching tasks until the queue is resumed via ResumeQueue. Tasks can still be added when the queue is paused. A queue is paused if its state is PAUSED.

(queues.pause)

Parameters

string $name

Required. The queue name. For example: projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID

PauseQueueRequest $postBody
array $optParams

Optional parameters.

Return Value

Queue

Exceptions

Exception

Queue purge(string $name, PurgeQueueRequest $postBody, array $optParams = [])

Purges a queue by deleting all of its tasks. All tasks created before this method is called are permanently deleted. Purge operations can take up to one minute to take effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. (queues.purge)

Parameters

string $name

Required. The queue name. For example: projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID

PurgeQueueRequest $postBody
array $optParams

Optional parameters.

Return Value

Queue

Exceptions

Exception

Queue resume(string $name, ResumeQueueRequest $postBody, array $optParams = [])

Resume a queue. This method resumes a queue after it has been PAUSED or DISABLED. The state of a queue is stored in the queue's state; after calling this method it will be set to RUNNING. WARNING: Resuming many high-QPS queues at the same time can lead to target overloading. If you are resuming high-QPS queues, follow the 500/50/5 pattern described in Managing Cloud Tasks Scaling Risks. (queues.resume)

Parameters

string $name

Required. The queue name. For example: projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID

ResumeQueueRequest $postBody
array $optParams

Optional parameters.

Return Value

Queue

Exceptions

Exception

Policy setIamPolicy(string $resource, SetIamPolicyRequest $postBody, array $optParams = [])

Sets the access control policy for a Queue. Replaces any existing policy.

Note: The Cloud Console does not check queue-level IAM permissions yet. Project-level permissions are required to use the Cloud Console. Authorization requires the following Google IAM permission on the specified resource parent: * cloudtasks.queues.setIamPolicy (queues.setIamPolicy)

Parameters

string $resource

REQUIRED: The resource for which the policy is being specified. See Resource names for the appropriate value for this field.

SetIamPolicyRequest $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

TestIamPermissionsResponse testIamPermissions(string $resource, TestIamPermissionsRequest $postBody, array $optParams = [])

Returns permissions that a caller has on a Queue. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.

Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may "fail open" without warning. (queues.testIamPermissions)

Parameters

string $resource

REQUIRED: The resource for which the policy detail is being requested. See Resource names for the appropriate value for this field.

TestIamPermissionsRequest $postBody
array $optParams

Optional parameters.

Return Value

TestIamPermissionsResponse

Exceptions

Exception