 
 (defc "/systems" [:env] (keyword v))
  
+(defc "/templates" [:machine :os] (keyword v))
+
+(defc "/templates" [:proxmox :type] (keyword v))
+
 (defn working-username  []
    (let [{:keys [username]} (current-user)] username))
 

        (success (t/get-type (:type (s/get-system id))))))

(defroutes- systems-admin {:path "/systems" :description "Operations on Systems"}

  (POST- "/systems/reindex" [] 
    {:nickname "reindexSystems" :summary "Trigger search re-index of all systems available for user" }
      (wrap-errors (success (s/re-index (working-username)))))

  )

(defroutes- environments {:path "/environments" :description "Operations on environments"}


(import-logging)

(defmodel template
  :type :string
  :machine {:type "Machine"} 
  :aws {:type "Aws" :description "An EC2 based system"}
  :physical {:type "Physical" :description "A physical machine"}
  :openstack {:type "Openstack" :description "An openstack based instance"}
  :proxmox {:type "Proxmox" :description "A Proxmox based system"}
  :vcenter {:type "Vcenter" :description "A vCenter based system"})

(defmodel system 
  :env :string
  :type :string
  :owner :string
  :machine {:type "Machine"} 
  :aws {:type "Aws" :description "An EC2 based system"}
  :physical {:type "Physical" :description "A physical machine"}
