summaryrefslogtreecommitdiff
path: root/lisp/service/octopus-latest-deployments-service.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/service/octopus-latest-deployments-service.lisp')
-rw-r--r--lisp/service/octopus-latest-deployments-service.lisp41
1 files changed, 41 insertions, 0 deletions
diff --git a/lisp/service/octopus-latest-deployments-service.lisp b/lisp/service/octopus-latest-deployments-service.lisp
new file mode 100644
index 0000000..4b786bd
--- /dev/null
+++ b/lisp/service/octopus-latest-deployments-service.lisp
@@ -0,0 +1,41 @@
+;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
+(declaim (optimize (speed 0) (safety 3) (debug 3)))
+
+(in-package :snow)
+
+(defclass octopus-latest-deployments-service (rest-service)
+ ()
+ (:documentation ""))
+
+(defun octopus-latest-deployments-json ()
+ (with-noauth (instance octopus-latest-deployments-service)
+ t))
+
+(defclass octopus-latest-deployments/view-service (octopus-latest-deployments-service)
+ ((form :initarg :form
+ :initform nil
+ :accessor form)
+ (location-p :initform nil))
+ (:documentation ""))
+
+(defun octopus-latest-deployments-view-json ()
+ (with-noauth (instance octopus-latest-deployments/view-service)
+ (setf (form instance)
+ (make-form "octopus-latest-deployments-form"
+ nil
+ t
+ `((:name "ode_only_p" :label "ODE only?" :field-type "checkbox")
+ (:label "Find Latest Deployments" :field-type "button" :onclick "on_octopus_latest_deployments_results_clicked()"))))))
+
+(defclass octopus-latest-deployments/results-service (octopus-latest-deployments/view-service)
+ ((results :initarg :results
+ :initform nil
+ :accessor results)
+ (location-p :initform nil))
+ (:documentation ""))
+
+(defun octopus-latest-deployments-results-json (ode_only_p)
+ (with-noauth (instance octopus-latest-deployments/results-service)
+ (with-octopus (octopus)
+ (let ((deployments (get-octopus-latest-deployments octopus :ode-only-p (string= "true" ode_only_p))))
+ (setf (results instance) deployments)))))