Share via


ICluster::ListTasksWithPaging method

Retrieves all tasks in the specified job. The tasks are returned in blocks of tasks from a specified snapshot of the job.

Syntax

HRESULT ListTasksWithPaging(
  [in]      long               jobId,
  [in, out] VARIANT            *Timestamp,
  [in, out] VARIANT            *Version,
  [in]      long               pageSize,
  [out]     IClusterEnumerable **pRetVal
);

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.

  • Timestamp [in, out]
    The opaque value used by the method to track the tasks that have been returned. Set to NULL on first call. See Remarks for details.

  • Version [in, out]
    The opaque value used by the method to track the snapshot of the list. Set to NULL on first call. See Remarks for details.

  • pageSize [in]
    The number of tasks to retrieve. The minimum number of tasks to retrieve is 1, and the maximum is 10,000. If the value is outside this range, the method uses 10,000.

  • pRetVal [out]
    An IClusterEnumerable interface that contains the collection of tasks. To retrieve the list of ITask interfaces, call the IClusterEnumerable::GetEnumerator method. The variant type of each item is VT_DISPATCH. Query the pdispVal member of the variant for the ITask interface. The enumerable object is empty when there are no tasks left to return.

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

This method is meant to be called in a loop. Set the Timestamp and Version parameters to NULL on the first call and do not change their values on subsequent calls. The first call takes a snapshot of the list of tasks and returns the requested number of tasks. The loop ends when the enumerable object is empty.

To get the delta of the tasks that were added or whose state has changed since the last snapshot, set Version to NULL, but leave the Timestamp value unchanged.

To reset the snapshot to the beginning, set Timestamp to NULL, but leave Version unchanged.

Requirements

Product

Compute Cluster Pack Client Utilities

Type library

Ccpapi.tlb

See also

ICluster

ICluster::ListTasks

ICluster::ListTasksOnNode

IJob::GetEnumerator