1{
2  "openapi": "3.0.2",
3  "info": {
4    "title": "Slurm Rest API",
5    "description": "API to access and control Slurm.",
6    "termsOfService": "https://github.com/SchedMD/slurm/blob/master/DISCLAIMER",
7    "license": {
8      "name": "Apache 2.0",
9      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
10    },
11    "version": "0.0.35"
12  },
13  "servers": [
14    {
15      "url": "/"
16    }
17  ],
18  "paths": {
19    "/slurm/v0.0.35/diag/": {
20      "get": {
21        "summary": "get diagnostics",
22        "responses": {
23          "200": {
24            "description": "dictionary of statistics"
25          }
26        }
27      }
28    },
29    "/slurm/v0.0.35/ping/": {
30      "get": {
31        "summary": "ping test",
32        "responses": {
33          "200": {
34            "description": "results of ping test"
35          }
36        }
37      }
38    },
39    "/slurm/v0.0.35/jobs/": {
40      "get": {
41        "summary": "get list of jobs",
42        "responses": {
43          "200": {
44            "description": "array of all job information in slurmctld"
45          }
46        }
47      }
48    },
49    "/slurm/v0.0.35/job/{job_id}": {
50      "get": {
51        "summary": "get job info",
52        "parameters": [
53          {
54            "name": "job_id",
55            "in": "path",
56            "description": "Slurm Job ID",
57            "required": true,
58            "style": "simple",
59            "explode": false,
60            "schema": {
61              "type": "integer",
62              "format": "int64"
63            }
64          }
65        ],
66        "responses": {
67          "200": {
68            "description": "job information"
69          },
70          "500": {
71            "description": "job not found"
72          }
73        }
74      },
75      "post": {
76        "summary": "update job",
77        "parameters": [
78          {
79            "name": "job_id",
80            "in": "path",
81            "description": "Slurm Job ID",
82            "required": true,
83            "style": "simple",
84            "explode": false,
85            "schema": {
86              "type": "integer",
87              "format": "int64"
88            }
89          }
90        ],
91        "requestBody": {
92          "description": "update job",
93          "content": {
94            "application/json": {
95              "schema": {
96                "$ref": "#/components/schemas/job_properties"
97              }
98            },
99            "application/x-yaml": {
100              "schema": {
101                "$ref": "#/components/schemas/job_properties"
102              }
103            }
104          },
105          "required": true
106        },
107        "responses": {
108          "200": {
109            "description": "job information"
110          },
111          "500": {
112            "description": "job not found"
113          }
114        }
115      },
116      "delete": {
117        "summary": "cancel or signal job",
118        "parameters": [
119          {
120            "name": "job_id",
121            "in": "path",
122            "description": "Slurm Job ID",
123            "required": true,
124            "style": "simple",
125            "explode": false,
126            "schema": {
127              "type": "integer",
128              "format": "int64"
129            }
130          },
131          {
132            "name": "signal",
133            "in": "query",
134            "description": "signal to send to job",
135            "required": false,
136            "style": "form",
137            "explode": true,
138            "schema": {
139              "$ref": "#/components/schemas/signal"
140            }
141          }
142        ],
143        "responses": {
144          "200": {
145            "description": "job cancelled or sent signal"
146          },
147          "500": {
148            "description": "job not found"
149          }
150        }
151      }
152    },
153    "/slurm/v0.0.35/job/submit": {
154      "post": {
155        "summary": "submit new job",
156        "requestBody": {
157          "description": "submit new job",
158          "content": {
159            "application/json": {
160              "schema": {
161                "$ref": "#/components/schemas/job_properties"
162              }
163            },
164            "application/x-yaml": {
165              "schema": {
166                "$ref": "#/components/schemas/job_properties"
167              }
168            }
169          },
170          "required": true
171        },
172        "responses": {
173          "200": {
174            "description": "job submitted"
175          },
176          "500": {
177            "description": "job rejected"
178          }
179        }
180      }
181    },
182    "/slurm/v0.0.35/nodes/": {
183      "get": {
184        "summary": "get all node info",
185        "responses": {
186          "200": {
187            "description": "nodes information"
188          },
189          "500": {
190            "description": "no nodes in cluster"
191          }
192        }
193      }
194    },
195    "/slurm/v0.0.35/node/{node_name}": {
196      "get": {
197        "summary": "get node info",
198        "parameters": [
199          {
200            "name": "node_name",
201            "in": "path",
202            "description": "Slurm Node Name",
203            "required": true,
204            "style": "simple",
205            "explode": false,
206            "schema": {
207              "type": "string"
208            }
209          }
210        ],
211        "responses": {
212          "200": {
213            "description": "node information"
214          },
215          "500": {
216            "description": "node not found"
217          }
218        }
219      }
220    },
221    "/slurm/v0.0.35/partitions/": {
222      "get": {
223        "summary": "get all partition info",
224        "responses": {
225          "200": {
226            "description": "partitions information"
227          },
228          "500": {
229            "description": "no partitions in cluster"
230          }
231        }
232      }
233    },
234    "/slurm/v0.0.35/partition/{partition_name}": {
235      "get": {
236        "summary": "get partition info",
237        "parameters": [
238          {
239            "name": "partition_name",
240            "in": "path",
241            "description": "Slurm Partition Name",
242            "required": true,
243            "style": "simple",
244            "explode": false,
245            "schema": {
246              "type": "string"
247            }
248          }
249        ],
250        "responses": {
251          "200": {
252            "description": "partition information"
253          },
254          "500": {
255            "description": "partition not found"
256          }
257        }
258      }
259    },
260    "/openapi.yaml": {
261      "get": {
262        "summary": "Retrieve OpenAPI Specification",
263        "responses": {
264          "200": {
265            "description": "OpenAPI Specification"
266          }
267        }
268      }
269    },
270    "/openapi.json": {
271      "get": {
272        "summary": "Retrieve OpenAPI Specification",
273        "responses": {
274          "200": {
275            "description": "OpenAPI Specification"
276          }
277        }
278      }
279    },
280    "/openapi": {
281      "get": {
282        "summary": "Retrieve OpenAPI Specification",
283        "responses": {
284          "200": {
285            "description": "OpenAPI Specification"
286          }
287        }
288      }
289    },
290    "/openapi/v3": {
291      "get": {
292        "summary": "Retrieve OpenAPI Specification",
293        "responses": {
294          "200": {
295            "description": "OpenAPI Specification"
296          }
297        }
298      }
299    }
300  },
301  "components": {
302    "schemas": {
303      "signal": {
304        "oneOf": [
305          {
306            "type": "integer",
307            "description": "POSIX signal number",
308            "format": "int32"
309          },
310          {
311            "type": "string",
312            "description": "POSIX signal name",
313            "format": "int32",
314            "enum": [
315              "HUP",
316              "INT",
317              "QUIT",
318              "ABRT",
319              "KILL",
320              "ALRM",
321              "TERM",
322              "USR1",
323              "USR2",
324              "URG",
325              "CONT",
326              "STOP",
327              "TSTP",
328              "TTIN",
329              "TTOU"
330            ]
331          }
332        ]
333      },
334      "job_properties": {
335        "properties": {
336          "account": {
337            "type": "string",
338            "description": "Charge resources used by this job to specified account."
339          },
340          "account_gather_freqency": {
341            "type": "string",
342            "description": "Define the job accounting and profiling sampling intervals."
343          },
344          "argv": {
345            "type": "array",
346            "description": "Arguments to the script.",
347            "items": {
348              "type": "string"
349            }
350          },
351          "array": {
352            "type": "string",
353            "description": "Submit a job array, multiple jobs to be executed with identical parameters. The indexes specification identifies what array index values should be used."
354          },
355          "batch_features": {
356            "type": "string",
357            "description": "features required for batch script's node"
358          },
359          "begin_time": {
360            "type": "string",
361            "description": "Submit the batch script to the Slurm controller immediately, like normal, but tell the controller to defer the allocation of the job until the specified time."
362          },
363          "burst_buffer": {
364            "type": "string",
365            "description": "Burst buffer specification."
366          },
367          "cluster_constraints": {
368            "type": "string",
369            "description": "Specifies features that a federated cluster must have to have a sibling job submitted to it."
370          },
371          "comment": {
372            "type": "string",
373            "description": "An arbitrary comment."
374          },
375          "constraints": {
376            "type": "string",
377            "description": "node features required by job."
378          },
379          "core_specification": {
380            "type": "integer",
381            "description": "Count of specialized threads per node reserved by the job for system operations and not used by the application."
382          },
383          "cores_per_socket": {
384            "type": "integer",
385            "description": "Restrict node selection to nodes with at least the specified number of cores per socket."
386          },
387          "cpu_binding": {
388            "type": "string",
389            "description": "Cpu binding"
390          },
391          "cpu_binding_hint": {
392            "type": "string",
393            "description": "Cpu binding hint"
394          },
395          "cpu_frequency": {
396            "type": "string",
397            "description": "Request that job steps initiated by srun commands inside this sbatch script be run at some requested frequency if possible, on the CPUs selected for the step on the compute node(s)."
398          },
399          "cpus_per_gpu": {
400            "type": "string",
401            "description": "Number of CPUs requested per allocated GPU."
402          },
403          "cpus_per_task": {
404            "type": "integer",
405            "description": "Advise the Slurm controller that ensuing job steps will require ncpus number of processors per task."
406          },
407          "current_working_directory": {
408            "type": "string",
409            "description": "Instruct Slurm to connect the batch script's standard output directly to the file name."
410          },
411          "deadline": {
412            "type": "string",
413            "description": "Remove the job if no ending is possible before this deadline (start > (deadline - time[-min]))."
414          },
415          "delay_boot": {
416            "type": "integer",
417            "description": "Do not reboot nodes in order to satisfied this job's feature specification if the job has been eligible to run for less than this time period."
418          },
419          "dependency": {
420            "type": "string",
421            "description": "Defer the start of this job until the specified dependencies have been satisfied completed."
422          },
423          "distribution": {
424            "type": "string",
425            "description": "Specify alternate distribution methods for remote processes."
426          },
427          "environment": {
428            "type": "object",
429            "description": "Dictionary of environment entries."
430          },
431          "exclusive": {
432            "oneOf": [
433              {
434                "type": "string",
435                "description": "The job allocation can share nodes just other users with the \"user\" option or with the \"mcs\" option).",
436                "enum": [
437                  "user",
438                  "mcs"
439                ]
440              },
441              {
442                "type": "boolean",
443                "description": "Request exclusive use of nodes.",
444                "default": true
445              }
446            ]
447          },
448          "get_user_environment": {
449            "type": "boolean",
450            "description": "Load new login environment for user on job node."
451          },
452          "gres": {
453            "type": "string",
454            "description": "Specifies a comma delimited list of generic consumable resources."
455          },
456          "gres_flags": {
457            "type": "string",
458            "description": "Specify generic resource task binding options.",
459            "enum": [
460              "disable-binding",
461              "enforce-binding"
462            ]
463          },
464          "gpu_binding": {
465            "type": "string",
466            "description": "Requested binding of tasks to GPU."
467          },
468          "gpu_frequency": {
469            "type": "string",
470            "description": "Requested GPU frequency."
471          },
472          "gpus": {
473            "type": "string",
474            "description": "GPUs per job."
475          },
476          "gpus_per_node": {
477            "type": "string",
478            "description": "GPUs per node."
479          },
480          "gpus_per_socket": {
481            "type": "string",
482            "description": "GPUs per socket."
483          },
484          "gpus_per_task": {
485            "type": "string",
486            "description": "GPUs per task."
487          },
488          "hold": {
489            "type": "boolean",
490            "description": "Specify the job is to be submitted in a held state (priority of zero)."
491          },
492          "kill_on_invalid_dependency": {
493            "type": "boolean",
494            "description": "If a job has an invalid dependency, then Slurm is to terminate it."
495          },
496          "licenses": {
497            "type": "string",
498            "description": "Specification of licenses (or other resources available on all nodes of the cluster) which must be allocated to this job."
499          },
500          "mail_type": {
501            "type": "string",
502            "description": "Notify user by email when certain event types occur."
503          },
504          "mail_user": {
505            "type": "string",
506            "description": "User to receive email notification of state changes as defined by mail_type."
507          },
508          "mcs_label": {
509            "type": "string",
510            "description": "This parameter is a group among the groups of the user."
511          },
512          "memory_binding": {
513            "type": "string",
514            "description": "Bind tasks to memory."
515          },
516          "memory_per_cpu": {
517            "type": "integer",
518            "description": "Minimum real memory per cpu (MB)."
519          },
520          "memory_per_gpu": {
521            "type": "integer",
522            "description": "Minimum memory required per allocated GPU."
523          },
524          "memory_per_node": {
525            "type": "integer",
526            "description": "Minimum real memory per node (MB)."
527          },
528          "minimum_cpus_per_node": {
529            "type": "integer",
530            "description": "Minimum number of CPUs per node."
531          },
532          "minimum_nodes": {
533            "type": "boolean",
534            "description": "If a range of node counts is given, prefer the smaller count."
535          },
536          "name": {
537            "type": "string",
538            "description": "Specify a name for the job allocation."
539          },
540          "nice": {
541            "type": "string",
542            "description": "Run the job with an adjusted scheduling priority within Slurm."
543          },
544          "no_kill": {
545            "type": "boolean",
546            "description": "Do not automatically terminate a job if one of the nodes it has been allocated fails."
547          },
548          "nodes": {
549            "oneOf": [
550              {
551                "type": "integer",
552                "description": "Request that a minimum of minnodes nodes be allocated to this job."
553              },
554              {
555                "maxItems": 2,
556                "minItems": 2,
557                "type": "array",
558                "description": "Request that a minimum of minnodes nodes and a maximum node count.",
559                "items": {
560                  "type": "integer"
561                }
562              }
563            ]
564          },
565          "open_mode": {
566            "type": "string",
567            "description": "Open the output and error files using append or truncate mode as specified.",
568            "default": "append",
569            "enum": [
570              "append",
571              "truncate"
572            ]
573          },
574          "partition": {
575            "type": "string",
576            "description": "Request a specific partition for the resource allocation."
577          },
578          "priority": {
579            "type": "string",
580            "description": "Request a specific job priority."
581          },
582          "qos": {
583            "type": "string",
584            "description": "Request a quality of service for the job."
585          },
586          "requeue": {
587            "type": "boolean",
588            "description": "Specifies that the batch job should eligible to being requeue."
589          },
590          "reservation": {
591            "type": "string",
592            "description": "Allocate resources for the job from the named reservation."
593          },
594          "signal": {
595            "pattern": "[B:]<sig_num>[@<sig_time>]",
596            "type": "string",
597            "description": "When a job is within sig_time seconds of its end time, send it the signal sig_num."
598          },
599          "sockets_per_node": {
600            "type": "integer",
601            "description": "Restrict node selection to nodes with at least the specified number of sockets."
602          },
603          "spread_job": {
604            "type": "boolean",
605            "description": "Spread the job allocation over as many nodes as possible and attempt to evenly distribute tasks across the allocated nodes."
606          },
607          "standard_error": {
608            "type": "string",
609            "description": "Instruct Slurm to connect the batch script's standard error directly to the file name."
610          },
611          "standard_in": {
612            "type": "string",
613            "description": "Instruct Slurm to connect the batch script's standard input directly to the file name specified."
614          },
615          "standard_out": {
616            "type": "string",
617            "description": "Instruct Slurm to connect the batch script's standard output directly to the file name."
618          },
619          "tasks": {
620            "type": "integer",
621            "description": "Advises the Slurm controller that job steps run within the allocation will launch a maximum of number tasks and to provide for sufficient resources."
622          },
623          "tasks_per_core": {
624            "type": "integer",
625            "description": "Request the maximum ntasks be invoked on each core."
626          },
627          "tasks_per_node": {
628            "type": "integer",
629            "description": "Request the maximum ntasks be invoked on each node."
630          },
631          "tasks_per_socket": {
632            "type": "integer",
633            "description": "Request the maximum ntasks be invoked on each socket."
634          },
635          "thread_specification": {
636            "type": "integer",
637            "description": "Count of specialized threads per node reserved by the job for system operations and not used by the application."
638          },
639          "threads_per_core": {
640            "type": "integer",
641            "description": "Restrict node selection to nodes with at least the specified number of threads per core."
642          },
643          "time_limit": {
644            "type": "integer",
645            "description": "Step time limit."
646          },
647          "time_minimum": {
648            "type": "integer",
649            "description": "Minimum run time in minutes."
650          },
651          "wait_all_nodes": {
652            "type": "boolean",
653            "description": "Do not begin execution until all nodes are ready for use."
654          },
655          "wckey": {
656            "type": "string",
657            "description": "Specify wckey to be used with job."
658          }
659        }
660      }
661    }
662  }
663}
664