Share via


Modifying a Job

To modify a job after the job has been added to the cluster, call the ICluster::ModifyJob or ICluster::ModifyJobTerm method. If you need to modify several of the job terms, use the ModifyJob method. If you need to modify a single term, use ModifyJobTerm.

For both methods, you need to use a job identifier to specify the job to update. The ICluster::AddJob and ICluster::QueueJob methods return this identifier. If you use one of the methods that list jobs, such as the ICluster::ListJobs method, you can call the IJob::get_Id method to get the job identifier.

The ModifyJob method uses an instance of the job to update the job on the cluster. To get an instance of the job, use one of the list job methods. However, if you know the identifier of the job that you want to update, call the ICluster::GetJob method, modify the necessary terms, and then call the ModifyJob method. The ModifyJob method uses all the terms and extended terms from the job instance to overwrite all the terms and extended terms of the job on the cluster.

The ModifyJobTerm method updates the value of a job term that you specify. The job term names are case-sensitive and are listed in the Remarks section of the ModifyJobTerm method. You can also use this method to update or add extended job terms that you specify. The extended term names are case-insensitive.

If the job is running, you must use the ModifyJobTerm method to modify the job, and you can modify only the properties associated with the IJob::put_Runtime, IJob::put_RunUntilCanceled, and IJob::put_Project methods. The changes take effect immediately. If the job is a backfill job, you cannot modify the Runtime property.

To add tasks to a job after the job has been added to the cluster, call the ICluster::AddTask method.

Using CCP