Show / Hide Table of Contents

Class ProjectsResource.LocationsResource.QueuesResource.TasksResource

The "tasks" collection of methods.

Inheritance
object
ProjectsResource.LocationsResource.QueuesResource.TasksResource
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Google.Apis.CloudTasks.v2
Assembly: Google.Apis.CloudTasks.v2.dll
Syntax
public class ProjectsResource.LocationsResource.QueuesResource.TasksResource

Constructors

TasksResource(IClientService)

Constructs a new resource.

Declaration
public TasksResource(IClientService service)
Parameters
Type Name Description
IClientService service

Methods

Buffer(BufferTaskRequest, string, string)

Creates and buffers a new task without the need to explicitly define a Task message. The queue must have HTTP target. To create the task with a custom ID, use the following format and set TASK_ID to your desired ID: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer To create the task with an automatically generated ID, use the following format: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer.

Declaration
public virtual ProjectsResource.LocationsResource.QueuesResource.TasksResource.BufferRequest Buffer(BufferTaskRequest body, string queue, string taskId)
Parameters
Type Name Description
BufferTaskRequest body

The body of the request.

string queue

Required. The parent queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID` The queue must already exist.

string taskId

Optional. Task ID for the task being created. If not provided, Cloud Tasks generates an ID for the task.

Returns
Type Description
ProjectsResource.LocationsResource.QueuesResource.TasksResource.BufferRequest

Create(CreateTaskRequest, string)

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.

Declaration
public virtual ProjectsResource.LocationsResource.QueuesResource.TasksResource.CreateRequest Create(CreateTaskRequest body, string parent)
Parameters
Type Name Description
CreateTaskRequest body

The body of the request.

string parent

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

Returns
Type Description
ProjectsResource.LocationsResource.QueuesResource.TasksResource.CreateRequest

Delete(string)

Deletes a task. A task can be deleted if it is scheduled or dispatched. A task cannot be deleted if it has executed successfully or permanently failed.

Declaration
public virtual ProjectsResource.LocationsResource.QueuesResource.TasksResource.DeleteRequest Delete(string name)
Parameters
Type Name Description
string name

Required. The task name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID

Returns
Type Description
ProjectsResource.LocationsResource.QueuesResource.TasksResource.DeleteRequest

Get(string)

Gets a task.

Declaration
public virtual ProjectsResource.LocationsResource.QueuesResource.TasksResource.GetRequest Get(string name)
Parameters
Type Name Description
string name

Required. The task name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID

Returns
Type Description
ProjectsResource.LocationsResource.QueuesResource.TasksResource.GetRequest

List(string)

Lists the tasks in a queue. By default, only the BASIC view is retrieved due to performance considerations; response_view controls the subset of information which is returned. The tasks may be returned in any order. The ordering may change at any time.

Declaration
public virtual ProjectsResource.LocationsResource.QueuesResource.TasksResource.ListRequest List(string parent)
Parameters
Type Name Description
string parent

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

Returns
Type Description
ProjectsResource.LocationsResource.QueuesResource.TasksResource.ListRequest

Run(RunTaskRequest, string)

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, RunTask can be used to retry a failed task after a fix has been made or to manually force a task to be dispatched now. If Cloud Tasks receives a successful response from the task's target, then the task will be deleted; otherwise the task's schedule_time will be reset to the time that RunTask was called plus the retry delay specified in the queue's RetryConfig. RunTask returns NOT_FOUND when it is called on a task that has already succeeded or permanently failed.

Declaration
public virtual ProjectsResource.LocationsResource.QueuesResource.TasksResource.RunRequest Run(RunTaskRequest body, string name)
Parameters
Type Name Description
RunTaskRequest body

The body of the request.

string name

Required. The task name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID

Returns
Type Description
ProjectsResource.LocationsResource.QueuesResource.TasksResource.RunRequest
In this article
Back to top Generated by DocFX