 (ns digital.provider
    "Digital ocean provider"
    (:require  
+     [clojure.tools.trace :as tr]
+     [digital.validations :refer (provider-validation)]
      [clojure.core.strint :refer (<<)]
      [celestial.model :refer (translate vconstruct hypervisor*)]
-     [celestial.provider :refer (selections mappings transform os->template wait-for wait-for-ssh)]
+     [celestial.provider :refer (mappings transform selections os->template wait-for wait-for-ssh)]
      [celestial.persistency.systems :as s]
      [celestial.common :refer (import-logging get*)]
      [celestial.core :refer (Vm)]

     (run-action "power_off" (get-in spec [:digital-ocean :id]))
    )

  (status [this]))

(defmethod vconstruct :digital-ocean [{:keys [digital-ocean] :as spec}]
  (let [{:keys [token]} digital-ocean]
    ))


#_(clojure.pprint/pprint (map (juxt :id :slug) (:images (do/images (hypervisor* :digital-ocean :token)))))

(defrecord Droplet [token spec]
  Vm
  (create [this]
     (let [{:keys [droplet]} (do/create-droplet token nil spec) {:keys [id]} droplet]
       (s/partial-system (spec :system-id) {:digital-ocean {:id id}})))

  (delete [this])

