Skip to content

Instantly share code, notes, and snippets.

@AdamSaleh
Created October 4, 2013 14:20
Show Gist options
  • Save AdamSaleh/6826698 to your computer and use it in GitHub Desktop.
Save AdamSaleh/6826698 to your computer and use it in GitHub Desktop.
(defn rest-publish
"Publishes a Content View Definition"
[{:keys [cv published-name description]} & [timeout-ms]]
(let [resolv-id #(-> % rest/read rest/id)
id-org-publish-uri (partial rest/url-maker [["api/organizations/%s/content_view_definitions/%s/publish" [:org identity]]])]
(rest/http-put (id-org-publish-uri cv)
{:body {:name published-name
:id (-> cv resolv-id)
:description description}})))
;but when i try to use it
(katello.content-view-definitions/rest-publish #katello.ContentViewDefinition{:id nil, :name "content-view-1004-160813-432",
:description nil, :composite nil, :composite-name nil,
:org #katello.Organization{:id nil, :name "env-org-1004-153842-546", :label nil, :description nil, :initial-env nil},
:published-name "publish-name-1004-160813-432"} "publish-name-1004-160813-432" "desc")
ExceptionInfo throw+: {:type :katello.rest/incomplete-context, :msg "[:org #<core$identity clojure.core$identity@c8ce36f>] are required for entity null"} katello.rest/url-maker (rest.clj:130)
=> (use 'clojure.repl)
nil
=> (pst 100)
ExceptionInfo throw+: {:type :katello.rest/incomplete-context, :msg "[:org #<core$identity clojure.core$identity@c8ce36f>] are required for entity null"} {:object {:type :katello.rest/incomplete-context, :msg "[:org #<core$identity clojure.core$identity@c8ce36f>] are required for entity null"}, :environment {coll [["api/organizations/%s/content_view_definitions/%s/publish" [:org #<core$identity clojure.core$identity@c8ce36f>]]], ent nil, or__3943__auto__ nil}}
katello.rest/url-maker (rest.clj:130)
clojure.core/apply (core.clj:619)
clojure.core/partial/fn--4190 (core.clj:2396)
katello.content-view-definitions/rest-publish (content_view_definitions.clj:368)
katello.tests.content-search/eval25752 (NO_SOURCE_FILE:1)
clojure.lang.Compiler.eval (Compiler.java:6619)
clojure.lang.Compiler.eval (Compiler.java:6582)
clojure.core/eval (core.clj:2852)
clojure.main/repl/read-eval-print--6588/fn--6591 (main.clj:259)
clojure.main/repl/read-eval-print--6588 (main.clj:259)
clojure.main/repl/fn--6597 (main.clj:277)
clojure.main/repl (main.clj:277)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn--1267 (interruptible_eval.clj:56)
clojure.core/apply (core.clj:617)
clojure.core/with-bindings* (core.clj:1788)
clojure.tools.nrepl.middleware.interruptible-eval/evaluate (interruptible_eval.clj:41)
clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn--1308/fn--1311 (interruptible_eval.clj:171)
clojure.core/comp/fn--4154 (core.clj:2330)
clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn--1301 (interruptible_eval.clj:138)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1145)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:615)
java.lang.Thread.run (Thread.java:724)
nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment