Hello, I'm looking to use the "/job/submit" endpoint with the REST API. I have an API documentation json file, but it doesn't seem to state how to include the sbatch script I want to use for the job. I found a demo of the job submit in the presentation you guys gave at SLUG2019, but the paramaters look different from the current API. I was wondering if you all have any examples or further documentation on how to use it. Thanks!
Created attachment 15521 [details] PEARC presentation (In reply to Rusty Davis from comment #0) > I'm looking to use the "/job/submit" endpoint with the REST API. I have an > API documentation json file, but it doesn't seem to state how to include the > sbatch script I want to use for the job. Here is an example Job (job.json): > { > "job": { > "tasks": 1, > "name": "test", > "nodes": 1, > "current_working_directory": "/tmp/", > "environment": { > "PATH": "/bin:/usr/bin/:/usr/local/bin/", > "LD_LIBRARY_PATH": "/lib/:/lib64/:/usr/local/lib" > } > }, > "script": "#!/bin/bash\nsrun hostname" > } The "script" field is where the contents of the script are to be placed. In the above example, it is a pretty simple script but anything sbatch accepts should be accepted by slurmrestd. Example call with curl: > export $(scontrol token lifespan=99999) > curl -s -H X-SLURM-USER-NAME:$(whoami) -H X-SLURM-USER-TOKEN:$SLURM_JWT -X POST 'http://rest/slurm/v0.0.35/job/submit' -H "Content-Type: application/json" -d @job.json . > I found a demo of the job submit in > the presentation you guys gave at SLUG2019, but the paramaters look > different from the current API. The SLUG slides are little out of date. I have attached the more recent PEARC20 presentation slides. Slide 30 has an example too. > I was wondering if you all have any examples > or further documentation on how to use it. The main documentation is here: > https://slurm.schedmd.com/rest.html I have been adding to it as we get more questions from sites. Questions are welcome.
That's exactly what I was looking for. Thanks! I'll be sure to let you know if I have any more questions.
(In reply to Rusty Davis from comment #2) > That's exactly what I was looking for. Thanks! I'll be sure to let you know > if I have any more questions. Closing per your response. Please reply if you have any more questions.