     "/1.x/envs/:env-name" "Read and evaluate the environment configuration :env-name.clj from GIT repository :env-name, return the configuration in JSON"
     "/1.x/envs/:env-name/apply" "Apply the environment configuration"
     "/1.x/envs/:env-name/apps" "All available applications for the given environment"
+    "/1.x/envs/:env-name/schedule" "Shows the current shuppet schedule, if any"
     "/1.x/envs/:env-name/apps/apply" "Apply configuration for all applications listed in Onix"
     "/1.x/envs/:env-name/apps/:app-name" "Read the application configuration :app-name.clj from GIT repository :app-name and evaluate it with the environment configuration, return the configuration in JSON. Master branch is used for all environments except for production where prod branch is used instead."
     "/1.x/envs/:env-name/apps/:app-name/apply" "Apply the application configuration for the given environment")

    (response {:message "Succefully stopped the shuppet scheduler"})
    (do
      (let [interval (if interval (Integer/parseInt interval) default-interval)]
         (at-at/every (* interval 60 1000) #(apps-apply env) shuppet-pool)
        (response {:message (str "Succesfully started the shuppet scheduler. The scheduler will run in every " interval " minutes.") })))))

(def ^:private resources
  {:GET

  (core/clean-config env name)
  (response {:message (str "Succesfully cleaned the configuration for application " name)}))

(defn- configure-apps
  [env]
  (core/apply-config env)
  (core/update-configs env))

(defn- apply-apps-config
  [env]
  (configure-apps env)
  (response  {:message (str "Started applying the configuration for all applications in environment " env "."
                            "Please check the campfire room '" cf-error-room  "' for any error cases.")}))

