         (do
           (println "WARNING: Resource" rname "not found."))))))
 
+(defn get-connector-resources
+  []
+  (let [cs (-> (con/query-impl (sci/connector-as-request configuration-resource))
+               :body
+               :connectors)]
+    (map #(:id %) cs)))
+
+(defn get-configuration-resources
+  []
+  (let [cs (-> (cfg/query-impl (sci/configuration-as-request connector-resource))
+               :body
+               :configurations)]
+    (map #(:id %) cs)))
+
+(defn get-persisted-resources
+  [name]
+  (cond
+    (= name configuration-resource) (get-configuration-resources)
+    (= name connector-resource) (get-connector-resources)
+    :else (do (println "WARNING: Don't know how to get resources for" name))))
+
+(defn list-persisted-resources
+  [name]
+  (doseq [r (get-persisted-resources name)]
+    (println r)))
+
+(defn list-resources
+  []
+  (init-db-client)
+  (println "List of persisted resources.")
+  (doseq [r resource-types]
+    (println (format "- resources for '%s'" r))
+    (list-persisted-resources r)))
+
 ;;
 ;; Command line options processing.
 ;;

    (cond
      (:help options) (exit 0 (usage summary))
      errors (exit 1 (error-msg errors)))
    (init-namespaces)
    (when (not (empty? arguments))
      (run arguments)
      (System/exit 0))
    (when (seq (:resources options))

      (print-resources)
      (System/exit 0))
    (when (:list options)
      (init-namespaces)
      (list-tempates)
      (System/exit 0))
    (when (not (s/blank? (:template options)))
      (init-namespaces)
      (print-template (:template options)))
    (when (:persisted options)
      (list-resources))))