ICluster::CancelJob method

Cancels the specified job.

Syntax

HRESULT CancelJob(
  [in] long jobId,
  [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.

  • Message [in]
    A message that describes the reason why the job was canceled. The message is limited to 320 Unicode characters. Can be empty.

    The message is stored with the job. To get the message, call the IJob::get_ErrorMessage method.

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

The job is removed from the queue but remains in the cluster until the value of the TTLCompletedJobs cluster configuration parameter is exceeded. For a description of this parameter, see the ICluster::SetClusterParameter method.

To cancel a job, the job's status must be: not submitted, queued, or running. If the job is running tasks when the job is canceled, the tasks are terminated and marked as failed. If you queue the job again, the tasks that were finished when the job was canceled stay finished, but all other tasks are queued (including those that failed).

Requirements

Product

Compute Cluster Pack Client Utilities

Type library

Ccpapi.tlb

See also

ICluster

ICluster::AddJob

ICluster::CancelJobs

ICluster::CancelTask