Creates a task and adds it to a queue.
Tasks cannot be updated after creation; there is no UpdateTask command.
- The maximum task size is 100KB.
HTTP request
POST https://cloudtasks.googleapis.com/v2/{parent=projects/*/locations/*/queues/*}/tasks
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
parent |
Required. The queue name. For example: The queue must already exist. Authorization requires the following IAM permission on the specified resource
|
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "task": { object ( |
Fields | |
---|---|
task |
Required. The task to add. Task names have the following format: If Task De-duplication: Explicitly specifying a task ID enables task de-duplication. If a task's ID is identical to that of an existing task or a task that was deleted or executed recently then the call will fail with Because there is an extra lookup cost to identify duplicate task names, these |
responseView |
The responseView specifies which subset of the By default responseView is Authorization for |
Response body
If successful, the response body contains a newly created 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.