diff options
Diffstat (limited to 'lisp/service')
| -rw-r--r-- | lisp/service/menu-service.lisp | 1 | ||||
| -rw-r--r-- | lisp/service/octopus-projects-with-roles-service.lisp | 4 | ||||
| -rw-r--r-- | lisp/service/unhealthy-targetgroups-service.lisp | 50 |
3 files changed, 54 insertions, 1 deletions
diff --git a/lisp/service/menu-service.lisp b/lisp/service/menu-service.lisp index 7911e32..1c50f3d 100644 --- a/lisp/service/menu-service.lisp +++ b/lisp/service/menu-service.lisp @@ -6,6 +6,7 @@ (defparameter *menu-config* '((:id "a_menu_home" :label "Home" :handler "/home" :permissions "t") (:id "a_menu_git_update" :label "Git Update" :handler "/git-update" :permissions "t") (:id "a_menu_asg_recycle" :label "ASG Recycle" :handler "/asg-recycle" :permissions "t") + (:id "a_menu_unhealthy_targetgroups" :label "Find Unhealthy Targetgroups" :handler "/unhealthy-targetgroups" :permissions "t") (:id "a_menu_tfcloud_apply" :label "TFCloud Apply" :handler "/tfcloud-apply" :permissions "t") (:id "a_menu_octopus_machines_with_roles" :label "Octo Machines With Roles" :handler "/octopus-machines-with-roles" :permissions "t") (:id "a_menu_octopus_environments_with_roles" :label "Octo Envs With Roles" :handler "/octopus-environments-with-roles" :permissions "t") diff --git a/lisp/service/octopus-projects-with-roles-service.lisp b/lisp/service/octopus-projects-with-roles-service.lisp index c3d9a67..627f346 100644 --- a/lisp/service/octopus-projects-with-roles-service.lisp +++ b/lisp/service/octopus-projects-with-roles-service.lisp @@ -38,7 +38,9 @@ (with-noauth (instance octopus-projects-with-roles/results-service) (cl-fad:with-output-to-temporary-file (f :template "/tmp/snow/temp-%") (get-octopus-projects-with-roles (make-instance 'octopus-process-step - :target-roles (remove-if (lambda (x) (org-ckons-core::null-or-empty-p x)) (cl-ppcre:split "[, ]" roles)) + :target-roles (remove-if (lambda (x) + (org-ckons-core::null-or-empty-p x)) + (cl-ppcre:split "[, ]" roles)) :stdout (pathname f))) (setf (stdout instance) (uiop:native-namestring (pathname f)))) (setf (session-value :octopus-roles) roles))) diff --git a/lisp/service/unhealthy-targetgroups-service.lisp b/lisp/service/unhealthy-targetgroups-service.lisp new file mode 100644 index 0000000..578fe9c --- /dev/null +++ b/lisp/service/unhealthy-targetgroups-service.lisp @@ -0,0 +1,50 @@ +;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- +(declaim (optimize (speed 0) (safety 3) (debug 3))) + +(in-package :snow) + +(defclass unhealthy-targetgroups-service (rest-service) + () + (:documentation "")) + +(defun unhealthy-targetgroups-json () + (with-noauth (instance unhealthy-targetgroups-service) + t)) + +(defclass unhealthy-targetgroups/view-service (unhealthy-targetgroups-service) + ((form :initarg :form + :initform nil + :accessor form) + (location-p :initform nil)) + (:documentation "")) + +(defun unhealthy-targetgroups-view-json () + (with-noauth (instance unhealthy-targetgroups/view-service) + (setf (form instance) + (make-form "unhealthy-targetgroups-form" + nil + t + `((:name "profile" :label "Profile" :field-type "text" :required "required" :value ,(or (session-value :profile) "")) + (:name "region" :label "Region" :field-type "text" :required "required" :value ,(or (session-value :region) (region *webapp*))) + (:name "filter" :label "Filter" :field-type "text" :required "required" :value ,(or (session-value :unhealthy-targetgroup-filter) "")) + (:label "Find Unhealthy Targetgroups" :field-type "button" :onclick "on_unhealthy_targetgroups_results_clicked()")))))) + +(defclass unhealthy-targetgroups/results-service (unhealthy-targetgroups/view-service) + ((stdout :initarg :stdout + :initform nil + :accessor stdout) + (location-p :initform nil)) + (:documentation "")) + +(defun unhealthy-targetgroups-results-json (profile region filter) + (with-noauth (instance unhealthy-targetgroups/results-service) + (cl-fad:with-output-to-temporary-file (f :template "/tmp/snow/temp-%") + (get-aws-unhealthy-targetgroups (make-instance 'aws-targetgroup + :profile profile + :region region + :filter filter + :stdout (pathname f))) + (setf (stdout instance) (uiop:native-namestring (pathname f)))) + (setf (session-value :profile) profile) + (setf (session-value :region) region) + (setf (session-value :unhealthy-targetgroup-filter) filter))) |
