pyslurmutils.client.rest.api.slurm_access.slurm_request#

pyslurmutils.client.rest.api.slurm_access.slurm_request(method, base_url, path, headers=None, **kwargs)[source]#

Sends an HTTP request and JSON decode the request.

Parameters:
  • method (str) – HTTP method to use for the request (e.g., “GET”, “POST”).

  • base_url (str) – The base URL to which the path is appended.

  • path (str) – The specific API path for the request (e.g., “/openapi”).

  • headers (Optional[Dict]) – A dictionary to represent the header for the request.

  • kwargs – Additional parameters to be passed to the requests.request() call.

Return type:

Any

Returns:

JSON decoded result.

Raises:
  • ValueError – If header keys are missing or response decoding failed.

  • RemoteHttpError – The HTTP request status indicates an error.