Skip to main content
Version: Current

TaskServices.CancelTaskAsync

Description

Cancel an existing Task with a specified Task ID from the connected AI Command Center.

Signature [C#]

Task CancelTaskAsync(int taskId)

Properties

Input

PropertyDescription
taskIdSpecify the taskId to cancel.

Remarks

Use CancelTaskAsync API to cancel a Task with a specified task ID from the connected AI Command Center.

Example

C#
public void CancelTask()
{
IControlRoomContext context = LoginControlRoom("RegularBuild", "BasicAuth");

int taskId = 1;

Task.Run(() => context.Tasks.CancelTaskAsync(taskId)).Wait();
}
C#
public IControlRoomContext LoginControlRoom()
{
IControlRoomContext context;
string connectionString;

connectionString = "ServerUrl=https://demo.onnitellibuddies.com;UserName=demoadmin;Password=password";
context = new ControlRoomContext(connectionString);

context.Open();
return context;
}