diff options
author | Christopher Baines <mail@cbaines.net> | 2020-12-21 14:36:27 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2020-12-21 14:36:27 +0000 |
commit | fd3eea0dc17084cd210e0d0ae25f98f65a0cc66e (patch) | |
tree | 0baff65ac0c300e0c75d23d7e05ed46062ff9f90 /guix-build-coordinator/client-communication.scm | |
parent | daadc63d05913f33c5f74874c437b40c80c88a40 (diff) | |
download | build-coordinator-fd3eea0dc17084cd210e0d0ae25f98f65a0cc66e.tar build-coordinator-fd3eea0dc17084cd210e0d0ae25f98f65a0cc66e.tar.gz |
Make it possible to list builds via the command line interface
Diffstat (limited to 'guix-build-coordinator/client-communication.scm')
-rw-r--r-- | guix-build-coordinator/client-communication.scm | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/guix-build-coordinator/client-communication.scm b/guix-build-coordinator/client-communication.scm index 088ee34..b471c22 100644 --- a/guix-build-coordinator/client-communication.scm +++ b/guix-build-coordinator/client-communication.scm @@ -43,6 +43,7 @@ send-submit-build-request send-cancel-build-request request-build-details + request-builds-list request-output-details request-agents-list request-failed-builds-with-blocking-count-list @@ -438,6 +439,53 @@ 'GET (string-append "/build/" uuid))) +(define* (request-builds-list coordinator-uri + #:key + (tags '()) + (not-tags '()) + (processed 'unset) + (canceled 'unset) + (after-id #f) + (limit 1000)) + (let ((query-parameters + `(,@(if (null? tags) + '() + (map (match-lambda + ((key . value) + (simple-format #f "tag=~A:~A" key value))) + tags)) + ,@(if (null? not-tags) + '() + (map (match-lambda + ((key . value) + (simple-format #f "not_tag=~A:~A" key value))) + not-tags)) + ,@(if (boolean? processed) + (if processed + '("processed=true") + '("processed=false")) + '()) + ,@(if (boolean? canceled) + (if canceled + '("canceled=true") + '("canceled=false")) + '()) + ,@(if after-id + (list (string-append "after_id=" after-id)) + '()) + ,@(if limit + (list (simple-format #f "limit=~A" limit)) + '())))) + (send-request coordinator-uri + 'GET + (string-append + "/builds" + (if (null? query-parameters) + "" + (string-append + "?" + (string-join query-parameters "&"))))))) + (define (request-output-details coordinator-uri output) (send-request coordinator-uri |