You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by pt...@apache.org on 2015/06/19 23:13:24 UTC

[3/5] storm git commit: Remove Storm UI uploadTopology API

Remove Storm UI uploadTopology API

Signed-off-by: P. Taylor Goetz <pt...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/a37f3311
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/a37f3311
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/a37f3311

Branch: refs/heads/0.10.x-branch
Commit: a37f33115073449985e4c7bce58078d800f34267
Parents: cfcc964
Author: Sriharsha Chintalapani <ha...@hortonworks.com>
Authored: Thu Jun 18 19:30:24 2015 -0700
Committer: P. Taylor Goetz <pt...@gmail.com>
Committed: Fri Jun 19 16:46:39 2015 -0400

----------------------------------------------------------------------
 STORM-UI-REST-API.md                          | 30 ----------------------
 storm-core/src/clj/backtype/storm/ui/core.clj | 19 --------------
 2 files changed, 49 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/storm/blob/a37f3311/STORM-UI-REST-API.md
----------------------------------------------------------------------
diff --git a/STORM-UI-REST-API.md b/STORM-UI-REST-API.md
index e663136..2836105 100644
--- a/STORM-UI-REST-API.md
+++ b/STORM-UI-REST-API.md
@@ -575,36 +575,6 @@ Sample response:
 
 ## POST Operations
 
-### /api/v1/uploadTopology (POST)
-
-uploads a topology.
-
-
-|Parameter |Value   |Description  |
-|----------|--------|-------------|
-|topologyConfig |String (required)| topology json config  |
-|topologyJar |String (required)| topology jar file |
-
-Sample topologyConfig json:
-```json
-{"topologyMainClass": "storm.starter.WordCountTopology", "topologyMainClassArgs": ["wordcount1"]}
-```
-
-Examples:
-
-```no-highlight
-curl  -i -b ~/cookiejar.txt -c ~/cookiejar.txt -X POST  
--F topologyConfig='{"topologyMainClass": "storm.starter.WordCountTopology", "topologyMainClassArgs": ["wordcount1"]}' 
--F topologyJar=@examples/storm-starter/storm-starter-topologies-0.10.0-SNAPSHOT.jar 
-http://localhost:8080/api/v1/uploadTopology
-```
-
-Sample Response:
-
-```json
-{"status":"success"}
-```
-
 ### /api/v1/topology/:id/activate (POST)
 
 Activates a topology.

http://git-wip-us.apache.org/repos/asf/storm/blob/a37f3311/storm-core/src/clj/backtype/storm/ui/core.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/ui/core.clj b/storm-core/src/clj/backtype/storm/ui/core.clj
index eee90f1..bd17959 100644
--- a/storm-core/src/clj/backtype/storm/ui/core.clj
+++ b/storm-core/src/clj/backtype/storm/ui/core.clj
@@ -1016,25 +1016,6 @@
         (.killTopologyWithOpts nimbus name options)
         (log-message "Killing topology '" name "' with wait time: " wait-time " secs")))
     (json-response (topology-op-response id "kill") (m "callback")))
-  (POST "/api/v1/uploadTopology" [:as {:keys [cookies servlet-request]} id & params]
-        (assert-authorized-user servlet-request "submitTopology")
-        (let [valid-tplg (validate-tplg-submit-params params)
-              valid (valid-tplg :valid)
-              context (ReqContext/context)]
-          (if http-creds-handler (.populateContext http-creds-handler context servlet-request))
-          (if (= valid true)
-            (let [tplg-file-data (params :topologyJar)
-                  tplg-temp-file (tplg-file-data :tempfile)
-                  tplg-file-name (tplg-file-data :filename)
-                  tplg-jar-file (clojure.string/join [(.getParent tplg-temp-file) file-path-separator tplg-file-name])
-                  tplg-config (if (not-nil? (params :topologyConfig)) (from-json (params :topologyConfig)))
-                  principal (if (.isImpersonating context) (.realPrincipal context) (.principal context))
-                  user (if principal (.getName principal) "unknown")]
-              (.renameTo tplg-temp-file (File. tplg-jar-file))
-              (let [ret (run-tplg-submit-cmd tplg-jar-file tplg-config user)]
-                (json-response ret (params "callback"))))
-            (json-response {"status" "failed" "error" (valid-tplg :error)} (params "callback"))
-            )))
   (GET "/" [:as {cookies :cookies}]
        (resp/redirect "/index.html"))
   (route/resources "/")