Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Tasks: lease

Requires authorization

Acquires a lease on the topmost N unowned tasks in the specified queue. Try it now .

The developer's email address must be specified as a user_email in the acl element of queue.yaml .

Request

HTTP request

POST https://www.googleapis.com/taskqueue/v1beta2/projects/project/taskqueues/taskqueue/tasks/lease

Parameters

Parameter name Value Description
Required parameters
leaseSecs integer How long to lease this task, in seconds.
numTasks integer The number of tasks to lease.
project string The project under which the queue lies.
taskqueue string The taskqueue to lease a task from.
Optional parameters
groupByTag boolean When True, returns tasks of the same tag. Specify which tag by using the tag parameter. If tag is not specified, returns tasks of the same tag as the oldest task in the queue.
tag string Only specify tag if groupByTag is true. If groupByTag is true and tag is not specified, the tag is assumed to be that of the oldest task by ETA. I.e., the first available tag.

Authorization

This request requires authorization with at least one of the following scopes ( read more about authentication and authorization ).

Scope
https://www.googleapis.com/auth/taskqueue
https://www.googleapis.com/auth/cloud-taskqueue
https://www.googleapis.com/auth/taskqueue.consumer
https://www.googleapis.com/auth/cloud-taskqueue.consumer

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response body with the following structure:

{
  "kind": "taskqueue#tasks",
  "items": [
    tasks Resource
  ]
}
Property name Value Description Notes
kind string The kind of object returned, a list of tasks.
items[] list The actual list of tasks returned as a result of the lease operation.

Try it!

Use the APIs Explorer below to call this method on live data and see the response. Alternatively, try the standalone Explorer .

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.