Freigeben über


ICluster::ListJobsWithPaging method

Retrieves all jobs in the cluster that were submitted by the specified user and that have the specified status. The jobs are returned in blocks of jobs from a specified snapshot of the cluster.

Syntax

HRESULT ListJobsWithPaging(
  [in, optional] BSTR               SubmittedBy,
  [in]           JobStatus          Status,
  [in]           VARIANT_BOOL       withTasks,
  [in, out]      VARIANT            *Timestamp,
  [in, out]      VARIANT            *Version,
  [in]           long               pageSize,
  [out]          IClusterEnumerable **pRetVal
);

Parameters

  • SubmittedBy [in, optional]
    The name of the user, in the form domain\user, that submitted the job. If NULL or "", the method retrieves all jobs with the specified status.

  • Status [in]
    The job status. For a list of values, see JobStatus.

  • withTasks [in]
    Specify VARIANT_TRUE to retrieve only jobs that contain tasks; otherwise, VARIANT_FALSE.

  • Timestamp [in, out]
    The opaque value used by the method to track the jobs 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 jobs to retrieve. The minimum number of jobs 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 jobs. To retrieve the list of IJob interfaces, call the IClusterEnumerable::GetEnumerator method. The variant type of each item is VT_DISPATCH. Query the pdispVal member of the variant for the IJob interface. The enumerable object is empty when there are no jobs 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

If there are more than 2,000 jobs in the cluster or if your application requires quick response time, consider calling this method instead of calling the ICluster::ListJobs method.

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 jobs and returns the requested number of jobs. The loop ends when the enumerable object is empty.

To get the delta of the jobs that were added or whose state has changed since the last snapshot, set Version to NULL, but leave Timestamp 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::ListAllJobsWithPaging

ICluster::ListJobs