Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Cancels the specified task.
Syntax
HRESULT CancelTask(
[in] long jobId,
[in] long taskId,
[in] BSTR Message
);
Parameters
jobId [in]
The job identifier. The ICluster::AddJob method returns this value. If you have an instance of the job that has already been added to the cluster, you can call the IJob::get_Id method to get the identifier.taskId [in]
The task identifier. The ITask::get_Id method returns this value.Message [in]
A message that describes the reason why the task was canceled. The message is limited to 320 Unicode characters.The message is stored with the task. To get the message, call the ITask::get_ErrorMessage method. This parameter can be NULL.
Return value
If the method succeeds, the return value is S_OK. Otherwise, the return value is an error code. To get a description of the error, call the ICluster::get_ErrorMessage method.
Remarks
To cancel a task, the task's status must be: not submitted, queued, or running. If a task is running when it is canceled, the task is terminated and the status of the task changes to TaskStatus_Cancelled. To determine a task's status, call the ITask::get_Status method.
You can call the ICluster::RequeueTask method to queue the task again.
Requirements
Product |
Compute Cluster Pack Client Utilities |
Type library |
Ccpapi.tlb |