From 8c3153b1161b2b6c74ff6316e7ada76128c7fefa Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Fri, 25 Oct 2024 15:57:04 +0100 Subject: slurm-api: Upgrade to API version 0.0.41. * ravanan/slurm-api.scm (submit-job, job-state): Upgrade to API version 0.0.41. (job-state): Handle job_state as a vector of strings. --- ravanan/slurm-api.scm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ravanan/slurm-api.scm b/ravanan/slurm-api.scm index fa5614e..880eadb 100644 --- a/ravanan/slurm-api.scm +++ b/ravanan/slurm-api.scm @@ -93,7 +93,7 @@ FAQ}) to request for the job." (let ((response (slurm-http-post api-endpoint jwt - "/slurm/v0.0.39/job/submit" + "/slurm/v0.0.41/job/submit" `(("jobs" . #(,job-spec)))))) (match (json-ref response "errors") (#() @@ -109,16 +109,16 @@ authenticating using @var{jwt}. Return value is one of the symbols ;; jobs too. (let ((response (slurm-http-get api-endpoint jwt - (string-append "/slurm/v0.0.39/job/" + (string-append "/slurm/v0.0.41/job/" (number->string job-id))))) (match (json-ref response "errors") (#() - (string->symbol - (string-downcase - (json-ref (find (lambda (job) - (= (json-ref job "job_id") - job-id)) - (vector->list (json-ref response "jobs"))) - "job_state")))) + (match (json-ref (find (lambda (job) + (= (json-ref job "job_id") + job-id)) + (vector->list (json-ref response "jobs"))) + "job_state") + (#(job-state) + (string->symbol (string-downcase job-state))))) (#(errors ...) (error "Slurm API error" errors))))) -- cgit v1.2.3