aboutsummaryrefslogtreecommitdiff
path: root/scripts/guix-build-coordinator.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/guix-build-coordinator.in')
-rw-r--r--scripts/guix-build-coordinator.in26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/guix-build-coordinator.in b/scripts/guix-build-coordinator.in
index b3b20f4..1fbcad3 100644
--- a/scripts/guix-build-coordinator.in
+++ b/scripts/guix-build-coordinator.in
@@ -656,6 +656,32 @@ tags:
#:description (assq-ref opts 'description))))
(simple-format #t "agent created as as ~A\n"
(assoc-ref response "agent-id")))))
+ (("agent" agent-id "activate" rest ...)
+ (let ((opts (parse-options %base-options
+ (append %client-option-defaults
+ %base-option-defaults)
+ rest)))
+ (let ((response (send-agent-set-active-request
+ (assq-ref opts 'coordinator)
+ agent-id
+ #true)))
+ (if (string=? (assoc-ref response "result")
+ "success")
+ (display "successfully activated agent\n")
+ (display "error activating agent\n")))))
+ (("agent" agent-id "deactivate" rest ...)
+ (let ((opts (parse-options %base-options
+ (append %client-option-defaults
+ %base-option-defaults)
+ rest)))
+ (let ((response (send-agent-set-active-request
+ (assq-ref opts 'coordinator)
+ agent-id
+ #false)))
+ (if (string=? (assoc-ref response "result")
+ "success")
+ (display "successfully deactivated agent\n")
+ (display "error activating agent\n")))))
(("agent" agent-id "password" "new" rest ...)
(let ((opts (parse-options %base-options
(append %client-option-defaults