Forces a task to run now.
When this method is called, Cloud Tasks will dispatch the task, even if the task is already running, the queue has reached its RateLimits
or is PAUSED
.
This command is meant to be used for manual debugging. For example, tasks.run
can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now.
The dispatched task is returned. That is, the task that is returned contains the [status][Task.status] after the task is dispatched but before the task is received by its target.
If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's scheduleTime
will be reset to the time that tasks.run
was called plus the retry delay specified in the queue's RetryConfig
.
tasks.run
returns google.rpc.Code.NOT_FOUND
when it is called on a task that has already succeeded or permanently failed.
HTTP request
POST https://cloudtasks.googleapis.com/v2beta3/{name=projects/*/locations/*/queues/*/tasks/*}:run
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
Required. The task name. For example: Authorization requires the following IAM permission on the specified resource
|
Request body
The request body contains data with the following structure:
JSON representation |
---|
{
"responseView": enum ( |
Fields | |
---|---|
responseView |
The responseView specifies which subset of the By default responseView is Authorization for |
Response body
If successful, the response body contains an instance of Task
.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/cloud-tasks
For more information, see the Authentication Overview.