Hisoka-X commented on code in PR #6813:
URL: https://github.com/apache/seatunnel/pull/6813#discussion_r1594932545


##########
docs/en/seatunnel-engine/rest-api.md:
##########
@@ -77,7 +77,62 @@ network:
 ### Return details of a job.
 
 <details>
- <summary><code>GET</code> 
<code><b>/hazelcast/rest/maps/running-job/:jobId</b></code> <code>(Return 
details of a job.)</code></summary>
+ <summary><code>GET</code> 
<code><b>/hazelcast/rest/maps/job-info/:jobId</b></code> <code>(Return details 
of a job. )</code></summary>
+
+#### Parameters
+
+> | name  |   type   | data type | description |
+> |-------|----------|-----------|-------------|
+> | jobId | required | long      | job id      |
+
+#### Responses
+
+```json
+{
+  "jobId": "",
+  "jobName": "",
+  "jobStatus": "",
+  "createTime": "",
+  "jobDag": {
+    "vertices": [
+    ],
+    "edges": [
+    ]
+  },
+  "metrics": {
+    "sourceReceivedCount": "",
+    "sinkWriteCount": ""
+  },
+  "finishedTime": "",
+  "errorMsg": null,
+  "envOptions": {
+  },
+  "pluginJarsUrls": [
+  ],
+  "isStartWithSavePoint": false
+}
+```
+
+`jobId`, `jobName`, `jobStatus`, `createTime`, `jobDag`, `metrics` always be 
returned.
+`envOptions`, `pluginJarsUrls`, `isStartWithSavePoint` will return when job is 
running.
+`finishedTime`, `errorMsg` will return when job is finished.
+
+When we can't get the job info, the response will be:
+
+```json
+{
+  "jobId" : ""
+}
+```
+
+</details>
+
+------------------------------------------------------------------------------------------
+
+### Return details of a job @Deprecated.

Review Comment:
   ```suggestion
   ### Return details of a job. This API has been deprecated, please use 
/hazelcast/rest/maps/job-info/:jobId instead
   ```



##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpGetCommandProcessor.java:
##########
@@ -62,13 +62,8 @@
 import java.util.concurrent.ExecutionException;
 
 import static com.hazelcast.internal.ascii.rest.HttpStatusCode.SC_500;
-import static 
org.apache.seatunnel.engine.server.rest.RestConstant.FINISHED_JOBS_INFO;
-import static 
org.apache.seatunnel.engine.server.rest.RestConstant.RUNNING_JOBS_URL;
-import static 
org.apache.seatunnel.engine.server.rest.RestConstant.RUNNING_JOB_URL;
-import static 
org.apache.seatunnel.engine.server.rest.RestConstant.RUNNING_THREADS;
-import static 
org.apache.seatunnel.engine.server.rest.RestConstant.SYSTEM_MONITORING_INFORMATION;
 
-public class RestHttpGetCommandProcessor extends 
HttpCommandProcessor<HttpGetCommand> {
+public static class RestHttpGetCommandProcessor extends 
HttpCommandProcessor<HttpGetCommand> {

Review Comment:
   Why change this?



##########
seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/rest/RestHttpGetCommandProcessor.java:
##########
@@ -300,6 +296,54 @@ private void handleJobInfoById(HttpGetCommand command, 
String uri) {
         }
     }
 
+    private void handleJobInfoByJobId(HttpGetCommand command, String uri) {

Review Comment:
   I think we can reuse `handleJobInfoById` method, not create new one.



##########
docs/zh/seatunnel-engine/rest-api.md:
##########
@@ -75,6 +75,61 @@ network:
 
 ### 返回作业的详细信息。
 
+<details>
+ <summary><code>GET</code> 
<code><b>/hazelcast/rest/maps/job-info/:jobId</b></code> 
<code>(返回作业的详细信息。)</code></summary>
+
+#### 参数
+
+> | name  |   type   | data type | description |
+> |-------|----------|-----------|-------------|
+> | jobId | required | long      | job id      |
+
+#### 响应
+
+```json
+{
+  "jobId": "",
+  "jobName": "",
+  "jobStatus": "",
+  "createTime": "",
+  "jobDag": {
+    "vertices": [
+    ],
+    "edges": [
+    ]
+  },
+  "metrics": {
+    "sourceReceivedCount": "",
+    "sinkWriteCount": ""
+  },
+  "finishedTime": "",
+  "errorMsg": null,
+  "envOptions": {
+  },
+  "pluginJarsUrls": [
+  ],
+  "isStartWithSavePoint": false
+}
+```
+
+`jobId`, `jobName`, `jobStatus`, `createTime`, `jobDag`, `metrics` 字段总会返回.
+`envOptions`, `pluginJarsUrls`, `isStartWithSavePoint` 字段在Job在RUNNING状态时会返回
+`finishedTime`, `errorMsg` 字段在Job结束时会返回,结束状态为不为RUNNING,可能为FINISHED,可能为CANCEL
+
+当我们查询不到这个Job时,返回结果为:
+
+```json
+{
+  "jobId" : ""
+}
+```
+
+</details>
+
+------------------------------------------------------------------------------------------
+
+### 返回作业的详细信息(已弃用)。

Review Comment:
   ```suggestion
   ### 返回作业的详细信息。此API已经启用,请使用/hazelcast/rest/maps/job-info/:jobId替代
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to