{
  "openapi": "3.0.2",
  "info": {
    "title": "Slurm Rest API",
    "description": "API to access and control Slurm.",
    "termsOfService": "https://github.com/SchedMD/slurm/blob/master/DISCLAIMER",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "0.0.35"
  },
  "servers": [
    {
      "url": "/"
    }
  ],
  "paths": {
    "/slurm/v0.0.35/diag/": {
      "get": {
	"summary": "get diagnostics",
	"responses": {
	  "200": {
	    "description": "dictionary of statistics"
	  }
	}
      }
    },
    "/slurm/v0.0.35/ping/": {
      "get": {
	"summary": "ping test",
	"responses": {
	  "200": {
	    "description": "results of ping test"
	  }
	}
      }
    },
    "/slurm/v0.0.35/jobs/": {
      "get": {
	"summary": "get list of jobs",
	"responses": {
	  "200": {
	    "description": "array of all job information in slurmctld"
	  }
	}
      }
    },
    "/slurm/v0.0.35/job/{job_id}": {
      "get": {
	"summary": "get job info",
	"parameters": [
	  {
	    "name": "job_id",
	    "in": "path",
	    "description": "Slurm Job ID",
	    "required": true,
	    "style": "simple",
	    "explode": false,
	    "schema": {
	      "type": "integer",
	      "format": "int64"
	    }
	  }
	],
	"responses": {
	  "200": {
	    "description": "job information"
	  },
	  "500": {
	    "description": "job not found"
	  }
	}
      },
      "post": {
	"summary": "update job",
	"parameters": [
	  {
	    "name": "job_id",
	    "in": "path",
	    "description": "Slurm Job ID",
	    "required": true,
	    "style": "simple",
	    "explode": false,
	    "schema": {
	      "type": "integer",
	      "format": "int64"
	    }
	  }
	],
	"requestBody": {
	  "description": "update job",
	  "content": {
	    "application/json": {
	      "schema": {
		"$ref": "#/components/schemas/job_properties"
	      }
	    },
	    "application/x-yaml": {
	      "schema": {
		"$ref": "#/components/schemas/job_properties"
	      }
	    }
	  },
	  "required": true
	},
	"responses": {
	  "200": {
	    "description": "job information"
	  },
	  "500": {
	    "description": "job not found"
	  }
	}
      },
      "delete": {
	"summary": "cancel or signal job",
	"parameters": [
	  {
	    "name": "job_id",
	    "in": "path",
	    "description": "Slurm Job ID",
	    "required": true,
	    "style": "simple",
	    "explode": false,
	    "schema": {
	      "type": "integer",
	      "format": "int64"
	    }
	  },
	  {
	    "name": "signal",
	    "in": "query",
	    "description": "signal to send to job",
	    "required": false,
	    "style": "form",
	    "explode": true,
	    "schema": {
	      "$ref": "#/components/schemas/signal"
	    }
	  }
	],
	"responses": {
	  "200": {
	    "description": "job cancelled or sent signal"
	  },
	  "500": {
	    "description": "job not found"
	  }
	}
      }
    },
    "/slurm/v0.0.35/job/submit": {
      "post": {
	"summary": "submit new job",
	"requestBody": {
	  "description": "submit new job",
	  "content": {
	    "application/json": {
	      "schema": {
		"$ref": "#/components/schemas/job_properties"
	      }
	    },
	    "application/x-yaml": {
	      "schema": {
		"$ref": "#/components/schemas/job_properties"
	      }
	    }
	  },
	  "required": true
	},
	"responses": {
	  "200": {
	    "description": "job submitted"
	  },
	  "500": {
	    "description": "job rejected"
	  }
	}
      }
    },
    "/slurm/v0.0.35/nodes/": {
      "get": {
	"summary": "get all node info",
	"responses": {
	  "200": {
	    "description": "nodes information"
	  },
	  "500": {
	    "description": "no nodes in cluster"
	  }
	}
      }
    },
    "/slurm/v0.0.35/node/{node_name}": {
      "get": {
	"summary": "get node info",
	"parameters": [
	  {
	    "name": "node_name",
	    "in": "path",
	    "description": "Slurm Node Name",
	    "required": true,
	    "style": "simple",
	    "explode": false,
	    "schema": {
	      "type": "string"
	    }
	  }
	],
	"responses": {
	  "200": {
	    "description": "node information"
	  },
	  "500": {
	    "description": "node not found"
	  }
	}
      }
    },
    "/slurm/v0.0.35/partitions/": {
      "get": {
	"summary": "get all partition info",
	"responses": {
	  "200": {
	    "description": "partitions information"
	  },
	  "500": {
	    "description": "no partitions in cluster"
	  }
	}
      }
    },
    "/slurm/v0.0.35/partition/{partition_name}": {
      "get": {
	"summary": "get partition info",
	"parameters": [
	  {
	    "name": "partition_name",
	    "in": "path",
	    "description": "Slurm Partition Name",
	    "required": true,
	    "style": "simple",
	    "explode": false,
	    "schema": {
	      "type": "string"
	    }
	  }
	],
	"responses": {
	  "200": {
	    "description": "partition information"
	  },
	  "500": {
	    "description": "partition not found"
	  }
	}
      }
    },
    "/openapi.yaml": {
      "get": {
	"summary": "Retrieve OpenAPI Specification",
	"responses": {
	  "200": {
	    "description": "OpenAPI Specification"
	  }
	}
      }
    },
    "/openapi.json": {
      "get": {
	"summary": "Retrieve OpenAPI Specification",
	"responses": {
	  "200": {
	    "description": "OpenAPI Specification"
	  }
	}
      }
    },
    "/openapi": {
      "get": {
	"summary": "Retrieve OpenAPI Specification",
	"responses": {
	  "200": {
	    "description": "OpenAPI Specification"
	  }
	}
      }
    },
    "/openapi/v3": {
      "get": {
	"summary": "Retrieve OpenAPI Specification",
	"responses": {
	  "200": {
	    "description": "OpenAPI Specification"
	  }
	}
      }
    }
  },
  "components": {
    "schemas": {
      "signal": {
	"oneOf": [
	  {
	    "type": "integer",
	    "description": "POSIX signal number",
	    "format": "int32"
	  },
	  {
	    "type": "string",
	    "description": "POSIX signal name",
	    "format": "int32",
	    "enum": [
	      "HUP",
	      "INT",
	      "QUIT",
	      "ABRT",
	      "KILL",
	      "ALRM",
	      "TERM",
	      "USR1",
	      "USR2",
	      "URG",
	      "CONT",
	      "STOP",
	      "TSTP",
	      "TTIN",
	      "TTOU"
	    ]
	  }
	]
      },
      "job_properties": {
	"properties": {
	  "account": {
	    "type": "string",
	    "description": "Charge resources used by this job to specified account."
	  },
	  "account_gather_freqency": {
	    "type": "string",
	    "description": "Define the job accounting and profiling sampling intervals."
	  },
	  "argv": {
	    "type": "array",
	    "description": "Arguments to the script.",
	    "items": {
	      "type": "string"
	    }
	  },
	  "array": {
	    "type": "string",
	    "description": "Submit a job array, multiple jobs to be executed with identical parameters. The indexes specification identifies what array index values should be used."
	  },
	  "batch_features": {
	    "type": "string",
	    "description": "features required for batch script's node"
	  },
	  "begin_time": {
	    "type": "string",
	    "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."
	  },
	  "burst_buffer": {
	    "type": "string",
	    "description": "Burst buffer specification."
	  },
	  "cluster_constraints": {
	    "type": "string",
	    "description": "Specifies features that a federated cluster must have to have a sibling job submitted to it."
	  },
	  "comment": {
	    "type": "string",
	    "description": "An arbitrary comment."
	  },
	  "constraints": {
	    "type": "string",
	    "description": "node features required by job."
	  },
	  "core_specification": {
	    "type": "integer",
	    "description": "Count of specialized threads per node reserved by the job for system operations and not used by the application."
	  },
	  "cores_per_socket": {
	    "type": "integer",
	    "description": "Restrict node selection to nodes with at least the specified number of cores per socket."
	  },
	  "cpu_binding": {
	    "type": "string",
	    "description": "Cpu binding"
	  },
	  "cpu_binding_hint": {
	    "type": "string",
	    "description": "Cpu binding hint"
	  },
	  "cpu_frequency": {
	    "type": "string",
	    "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)."
	  },
	  "cpus_per_gpu": {
	    "type": "string",
	    "description": "Number of CPUs requested per allocated GPU."
	  },
	  "cpus_per_task": {
	    "type": "integer",
	    "description": "Advise the Slurm controller that ensuing job steps will require ncpus number of processors per task."
	  },
	  "current_working_directory": {
	    "type": "string",
	    "description": "Instruct Slurm to connect the batch script's standard output directly to the file name."
	  },
	  "deadline": {
	    "type": "string",
	    "description": "Remove the job if no ending is possible before this deadline (start > (deadline - time[-min]))."
	  },
	  "delay_boot": {
	    "type": "integer",
	    "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."
	  },
	  "dependency": {
	    "type": "string",
	    "description": "Defer the start of this job until the specified dependencies have been satisfied completed."
	  },
	  "distribution": {
	    "type": "string",
	    "description": "Specify alternate distribution methods for remote processes."
	  },
	  "environment": {
	    "type": "object",
	    "description": "Dictionary of environment entries."
	  },
	  "exclusive": {
	    "oneOf": [
	      {
		"type": "string",
		"description": "The job allocation can share nodes just other users with the \"user\" option or with the \"mcs\" option).",
		"enum": [
		  "user",
		  "mcs"
		]
	      },
	      {
		"type": "boolean",
		"description": "Request exclusive use of nodes.",
		"default": true
	      }
	    ]
	  },
	  "get_user_environment": {
	    "type": "boolean",
	    "description": "Load new login environment for user on job node."
	  },
	  "gres": {
	    "type": "string",
	    "description": "Specifies a comma delimited list of generic consumable resources."
	  },
	  "gres_flags": {
	    "type": "string",
	    "description": "Specify generic resource task binding options.",
	    "enum": [
	      "disable-binding",
	      "enforce-binding"
	    ]
	  },
	  "gpu_binding": {
	    "type": "string",
	    "description": "Requested binding of tasks to GPU."
	  },
	  "gpu_frequency": {
	    "type": "string",
	    "description": "Requested GPU frequency."
	  },
	  "gpus": {
	    "type": "string",
	    "description": "GPUs per job."
	  },
	  "gpus_per_node": {
	    "type": "string",
	    "description": "GPUs per node."
	  },
	  "gpus_per_socket": {
	    "type": "string",
	    "description": "GPUs per socket."
	  },
	  "gpus_per_task": {
	    "type": "string",
	    "description": "GPUs per task."
	  },
	  "hold": {
	    "type": "boolean",
	    "description": "Specify the job is to be submitted in a held state (priority of zero)."
	  },
	  "kill_on_invalid_dependency": {
	    "type": "boolean",
	    "description": "If a job has an invalid dependency, then Slurm is to terminate it."
	  },
	  "licenses": {
	    "type": "string",
	    "description": "Specification of licenses (or other resources available on all nodes of the cluster) which must be allocated to this job."
	  },
	  "mail_type": {
	    "type": "string",
	    "description": "Notify user by email when certain event types occur."
	  },
	  "mail_user": {
	    "type": "string",
	    "description": "User to receive email notification of state changes as defined by mail_type."
	  },
	  "mcs_label": {
	    "type": "string",
	    "description": "This parameter is a group among the groups of the user."
	  },
	  "memory_binding": {
	    "type": "string",
	    "description": "Bind tasks to memory."
	  },
	  "memory_per_cpu": {
	    "type": "integer",
	    "description": "Minimum real memory per cpu (MB)."
	  },
	  "memory_per_gpu": {
	    "type": "integer",
	    "description": "Minimum memory required per allocated GPU."
	  },
	  "memory_per_node": {
	    "type": "integer",
	    "description": "Minimum real memory per node (MB)."
	  },
	  "minimum_cpus_per_node": {
	    "type": "integer",
	    "description": "Minimum number of CPUs per node."
	  },
	  "minimum_nodes": {
	    "type": "boolean",
	    "description": "If a range of node counts is given, prefer the smaller count."
	  },
	  "name": {
	    "type": "string",
	    "description": "Specify a name for the job allocation."
	  },
	  "nice": {
	    "type": "string",
	    "description": "Run the job with an adjusted scheduling priority within Slurm."
	  },
	  "no_kill": {
	    "type": "boolean",
	    "description": "Do not automatically terminate a job if one of the nodes it has been allocated fails."
	  },
	  "nodes": {
	    "oneOf": [
	      {
		"type": "integer",
		"description": "Request that a minimum of minnodes nodes be allocated to this job."
	      },
	      {
		"maxItems": 2,
		"minItems": 2,
		"type": "array",
		"description": "Request that a minimum of minnodes nodes and a maximum node count.",
		"items": {
		  "type": "integer"
		}
	      }
	    ]
	  },
	  "open_mode": {
	    "type": "string",
	    "description": "Open the output and error files using append or truncate mode as specified.",
	    "default": "append",
	    "enum": [
	      "append",
	      "truncate"
	    ]
	  },
	  "partition": {
	    "type": "string",
	    "description": "Request a specific partition for the resource allocation."
	  },
	  "priority": {
	    "type": "string",
	    "description": "Request a specific job priority."
	  },
	  "qos": {
	    "type": "string",
	    "description": "Request a quality of service for the job."
	  },
	  "requeue": {
	    "type": "boolean",
	    "description": "Specifies that the batch job should eligible to being requeue."
	  },
	  "reservation": {
	    "type": "string",
	    "description": "Allocate resources for the job from the named reservation."
	  },
	  "signal": {
	    "pattern": "[B:]<sig_num>[@<sig_time>]",
	    "type": "string",
	    "description": "When a job is within sig_time seconds of its end time, send it the signal sig_num."
	  },
	  "sockets_per_node": {
	    "type": "integer",
	    "description": "Restrict node selection to nodes with at least the specified number of sockets."
	  },
	  "spread_job": {
	    "type": "boolean",
	    "description": "Spread the job allocation over as many nodes as possible and attempt to evenly distribute tasks across the allocated nodes."
	  },
	  "standard_error": {
	    "type": "string",
	    "description": "Instruct Slurm to connect the batch script's standard error directly to the file name."
	  },
	  "standard_in": {
	    "type": "string",
	    "description": "Instruct Slurm to connect the batch script's standard input directly to the file name specified."
	  },
	  "standard_out": {
	    "type": "string",
	    "description": "Instruct Slurm to connect the batch script's standard output directly to the file name."
	  },
	  "tasks": {
	    "type": "integer",
	    "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."
	  },
	  "tasks_per_core": {
	    "type": "integer",
	    "description": "Request the maximum ntasks be invoked on each core."
	  },
	  "tasks_per_node": {
	    "type": "integer",
	    "description": "Request the maximum ntasks be invoked on each node."
	  },
	  "tasks_per_socket": {
	    "type": "integer",
	    "description": "Request the maximum ntasks be invoked on each socket."
	  },
	  "thread_specification": {
	    "type": "integer",
	    "description": "Count of specialized threads per node reserved by the job for system operations and not used by the application."
	  },
	  "threads_per_core": {
	    "type": "integer",
	    "description": "Restrict node selection to nodes with at least the specified number of threads per core."
	  },
	  "time_limit": {
	    "type": "integer",
	    "description": "Step time limit."
	  },
	  "time_minimum": {
	    "type": "integer",
	    "description": "Minimum run time in minutes."
	  },
	  "wait_all_nodes": {
	    "type": "boolean",
	    "description": "Do not begin execution until all nodes are ready for use."
	  },
	  "wckey": {
	    "type": "string",
	    "description": "Specify wckey to be used with job."
	  }
	}
      }
    }
  }
}
