ICluster::QueueJobs method

Adds one or more jobs to the cluster and scheduling queue.

Syntax

HRESULT QueueJobs(
  [in]           IClusterEnumerable *jobs,
  [in]           BSTR               userName,
  [in]           BSTR               password,
  [in]           VARIANT_BOOL       isConsole,
  [in, optional] long               hwndParent,
  [out]          IClusterEnumerable **pRetVal
);

Parameters

  • jobs [in]
    An IClusterEnumerable interface that contains one or more jobs that you want to add to the queue. For each item in the collection, set the variant type to VT_DISPATCH. Query the IJob interface for the IDispatch interface and set the pdispVal member of the variant to the IDispatch interface.

  • userName [in]
    The name of the RunAs user, in the form domain\user, under which the job will run. The user name is limited to 80 Unicode characters.

    If userName is NULL, empty, or not valid, the cluster searches the calling user's credential cache for the credentials to use. If the cache contains only one credential, that credential is used. If the cache does not exist or contains multiple credentials, the user is prompted for the credentials.

  • password [in]
    The RunAs user's password. The password is limited to 127 Unicode characters. If this parameter is NULL or empty, the method uses the cached credentials. See ICluster::SetCachedCredentials. If the credentials are not cached, the current user is prompted for the credentials. If the isConsole parameter is VARIANT_TRUE, the user is prompted in the console window, otherwise, the standard credentials dialog box is used.

  • isConsole [in]
    Set the value to VARIANT_TRUE if the application is a console-mode application. Set the value to VARIANT_FALSE if the application is a GUI application.

  • hwndParent [in, optional]
    The handle to use as the parent window for the modal credentials dialog box. If 0, HWND_DESKTOP is used. The handle is ignored if isConsole is VARIANT_TRUE.

  • pRetVal [out]
    An IClusterEnumerable interface than contains one or more job identifiers. The identifiers in this collection correspond directly to the jobs collection passed in the jobs parameter. When you enumerate the identifiers in this collection, the identifiers are returned as variants. The variant type is VT_I4. The lVal member of the variant contains the identifier.

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 you need to add multiple jobs to the queue, calling this method provides better performance than calling the ICluster::QueueJob method in a loop.

If the method fails to add one of the jobs to the scheduling queue, none of the jobs are added to the queue.

Calling this method is the same as calling both the ICluster::AddJobs and ICluster::SubmitJobs methods.

Examples

For an example that calls this method, see Submitting a Job to the Scheduling Queue.

Requirements

Product

Compute Cluster Pack Client Utilities

Type library

Ccpapi.tlb

See also

ICluster

ICluster::AddJobs

ICluster::QueueJob

ICluster::RequeueJobs

ICluster::SubmitJobs