You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by al...@apache.org on 2022/03/09 09:22:35 UTC

[incubator-linkis] 08/09: Unified RequestMethod #1641

This is an automated email from the ASF dual-hosted git repository.

alexkun pushed a commit to branch dev-1.1.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git

commit a9c1ba44f3ce0e77d325bed45143446c67e33fba
Author: peacewong <wp...@gmail.com>
AuthorDate: Wed Mar 9 16:18:25 2022 +0800

    Unified RequestMethod #1641
---
 .../apache/linkis/entrance/restful/EntranceRestfulApi.java   | 12 ++++++++++--
 .../linkis/entrance/restful/EntranceRestfulRemote.scala      | 12 ++++++------
 2 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java
index 9b3ae4e..56b6dd5 100644
--- a/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java
+++ b/linkis-computation-governance/linkis-entrance/src/main/java/org/apache/linkis/entrance/restful/EntranceRestfulApi.java
@@ -73,6 +73,7 @@ public class EntranceRestfulApi implements EntranceRestfulRemote {
      * execution ID is returned to the user. execute函数处理的是用户提交执行任务的请求,返回给用户的是执行ID json Incoming
      * key-value pair(传入的键值对) Repsonse
      */
+    @Override
     @RequestMapping(path = "/execute", method = RequestMethod.POST)
     public Message execute(HttpServletRequest req, @RequestBody Map<String, Object> json) {
         Message message = null;
@@ -125,6 +126,7 @@ public class EntranceRestfulApi implements EntranceRestfulRemote {
         return message;
     }
 
+    @Override
     @RequestMapping(path = "/submit", method = RequestMethod.POST)
     public Message submit(HttpServletRequest req, @RequestBody Map<String, Object> json) {
         Message message = null;
@@ -180,6 +182,7 @@ public class EntranceRestfulApi implements EntranceRestfulRemote {
         entranceServer.getEntranceContext().getOrCreateLogManager().onLogUpdate(job, log);
     }
 
+    @Override
     @RequestMapping(path = "/{id}/status", method = RequestMethod.GET)
     public Message status(
             @PathVariable("id") String id,
@@ -213,6 +216,7 @@ public class EntranceRestfulApi implements EntranceRestfulRemote {
         return message;
     }
 
+    @Override
     @RequestMapping(path = "/{id}/progress", method = RequestMethod.GET)
     public Message progress(@PathVariable("id") String id) {
         Message message = null;
@@ -253,6 +257,7 @@ public class EntranceRestfulApi implements EntranceRestfulRemote {
         return message;
     }
 
+    @Override
     @RequestMapping(path = "/{id}/progressWithResource", method = RequestMethod.GET)
     public Message progressWithResource(@PathVariable("id") String id) {
         Message message = null;
@@ -353,6 +358,7 @@ public class EntranceRestfulApi implements EntranceRestfulRemote {
         list.add(map);
     }
 
+    @Override
     @RequestMapping(path = "/{id}/log", method = RequestMethod.GET)
     public Message log(HttpServletRequest req, @PathVariable("id") String id) {
         String realId = ZuulEntranceUtils.parseExecID(id)[3];
@@ -455,8 +461,9 @@ public class EntranceRestfulApi implements EntranceRestfulRemote {
         return message;
     }
 
+    @Override
     @RequestMapping(path = "/killJobs", method = RequestMethod.POST)
-    public Message killJobs(HttpServletRequest req, @RequestBody JsonNode jsonNode) {
+    public Message killJobs(HttpServletRequest req, @RequestBody JsonNode jsonNode, @PathVariable("id") String strongExecId) {
         JsonNode idNode = jsonNode.get("idList");
         JsonNode taskIDNode = jsonNode.get("taskIDList");
         ArrayList<Long> waitToForceKill = new ArrayList<>();
@@ -544,7 +551,7 @@ public class EntranceRestfulApi implements EntranceRestfulRemote {
         return Message.ok("success").data("messages", messages);
     }
 
-    // todo confirm long or Long
+    @Override
     @RequestMapping(path = "/{id}/kill", method = RequestMethod.GET)
     public Message kill(
             @PathVariable("id") String id,
@@ -603,6 +610,7 @@ public class EntranceRestfulApi implements EntranceRestfulRemote {
         return message;
     }
 
+    @Override
     @RequestMapping(path = "/{id}/pause", method = RequestMethod.GET)
     public Message pause(@PathVariable("id") String id) {
         String realId = ZuulEntranceUtils.parseExecID(id)[3];
diff --git a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/restful/EntranceRestfulRemote.scala b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/restful/EntranceRestfulRemote.scala
index 9bb90fa..62bb25b 100644
--- a/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/restful/EntranceRestfulRemote.scala
+++ b/linkis-computation-governance/linkis-entrance/src/main/scala/org/apache/linkis/entrance/restful/EntranceRestfulRemote.scala
@@ -36,22 +36,22 @@ trait EntranceRestfulRemote {
   @RequestMapping(value = Array("/entrance/{id}/status"), method = Array(RequestMethod.GET))
   def status(@PathVariable("id") id : String, @RequestParam(value = "taskID", required = false) taskID: String): Message
 
-  @RequestMapping(value = Array("/entrance/{id}/progress"), method = Array(RequestMethod.POST))
+  @RequestMapping(value = Array("/entrance/{id}/progress"), method = Array(RequestMethod.GET))
   def progress(@PathVariable("id") id: String): Message
 
-  @RequestMapping(value = Array("/entrance/{id}/progressWithResource"), method = Array(RequestMethod.POST))
+  @RequestMapping(value = Array("/entrance/{id}/progressWithResource"), method = Array(RequestMethod.GET))
   def progressWithResource(@PathVariable("id") id: String): Message
 
-  @RequestMapping(value = Array("/entrance/{id}/log"), method = Array(RequestMethod.POST))
+  @RequestMapping(value = Array("/entrance/{id}/log"), method = Array(RequestMethod.GET))
   def log(req: HttpServletRequest, @PathVariable("id") id: String): Message
 
   @RequestMapping(value = Array("/entrance/killJobs"), method = Array(RequestMethod.POST))
-  def killJobs(req: HttpServletRequest, @RequestBody jsonNode: JsonNode): Message
+  def killJobs(req: HttpServletRequest, @RequestBody jsonNode: JsonNode, @PathVariable("id") strongExecId: String): Message
 
-  @RequestMapping(value = Array("/entrance/{id}/kill"), method = Array(RequestMethod.POST))
+  @RequestMapping(value = Array("/entrance/{id}/kill"), method = Array(RequestMethod.GET))
   def kill(@PathVariable("id") id: String, @RequestParam("taskID") taskID: java.lang.Long): Message
 
-  @RequestMapping(value = Array("/entrance/{id}/pause"), method = Array(RequestMethod.POST))
+  @RequestMapping(value = Array("/entrance/{id}/pause"), method = Array(RequestMethod.GET))
   def pause(@PathVariable("id") id: String): Message
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org