How do I requeue a Job using the Microsoft.Hpc.Scheduler API? RRS feed

  • Question

  • I'm trying to cancel and then re-queue a Job using the following code...

    MyScheduler.CancelJob(jobId, "Canceling to allow higher priority job to run, this job will be re-queued. ");
    var job = MyScheduler.OpenJob(jobId);
    MyScheduler.SubmitJob(job, Username, Password);

    This generates an exception with the message, "The job could not be submitted because it is not in the configuring state.  To restart a Canceled or Failed job, use the "job requeue" command.  To create a new job that is based on a Finished or Running job use the "job clone" command". 

    Where is the job re-queue command in the Microsoft.Hpc.Scheduler API? Is there any way to requeue 'in code' or do I have to either...

    1. Make a REST API call (as detailed here). Or,
    2. Make a command-line call (as detailed here)

    Many thanks in advance, Matt.

    Monday, February 20, 2017 11:49 AM

All replies

  • There is no one API call for requeue, you have to move the job to configure before submit.

    Thus, please try ConfigureJob first and then SubmiJob

    Qiufang Shi

    Wednesday, February 22, 2017 8:34 AM
  • Is there a restful API for ConfigureJob?
    Monday, October 15, 2018 11:12 PM
  • there is requeue job API for REST: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/hh529659%28v%3dvs.85%29

    Qiufang Shi

    Tuesday, October 16, 2018 5:16 AM
  • I tried the requeue job API for REST on HPC 2012 R2 but it gave an error message:

    The remote server returned an error: (405) Method Not Allowed.

    The job to be requeued was in "Failed" state. What else needs to be done in order for the job to be requeued using REST API?

    Tuesday, October 16, 2018 5:22 PM