Skip to content

Commit 959e305

Browse files
authored
[Improve][RestApi] Update context-path to / as default path (#7800)
1 parent 3078d78 commit 959e305

File tree

5 files changed

+49
-32
lines changed

5 files changed

+49
-32
lines changed

config/seatunnel.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,3 @@ seatunnel:
4040
http:
4141
enable-http: true
4242
port: 8080
43-
context-path: /seatunnel
44-

docs/en/seatunnel-engine/rest-api-v2.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,17 @@ The v2 version of the api uses jetty support. It is the same as the interface sp
1818
seatunnel:
1919
engine:
2020
enable-http: true
21-
jetty-port: 8080
21+
port: 8080
22+
```
23+
24+
Context-path can also be configured as follows:
25+
26+
```yaml
27+
28+
seatunnel:
29+
engine:
30+
enable-http: true
31+
port: 8080
2232
context-path: /seatunnel
2333
```
2434
@@ -27,7 +37,7 @@ seatunnel:
2737
### Returns an overview over the Zeta engine cluster.
2838
2939
<details>
30-
<summary><code>GET</code> <code><b>/seatunnel/overview?tag1=value1&tag2=value2</b></code> <code>(Returns an overview over the Zeta engine cluster.)</code></summary>
40+
<summary><code>GET</code> <code><b>/overview?tag1=value1&tag2=value2</b></code> <code>(Returns an overview over the Zeta engine cluster.)</code></summary>
3141
3242
#### Parameters
3343
@@ -62,7 +72,7 @@ seatunnel:
6272
### Returns An Overview And State Of All Jobs
6373

6474
<details>
65-
<summary><code>GET</code> <code><b>/seatunnel/running-jobs</b></code> <code>(Returns an overview over all jobs and their current state.)</code></summary>
75+
<summary><code>GET</code> <code><b>/running-jobs</b></code> <code>(Returns an overview over all jobs and their current state.)</code></summary>
6676

6777
#### Parameters
6878

@@ -101,7 +111,7 @@ seatunnel:
101111
### Return Details Of A Job
102112

103113
<details>
104-
<summary><code>GET</code> <code><b>/seatunnel/job-info/:jobId</b></code> <code>(Return details of a job. )</code></summary>
114+
<summary><code>GET</code> <code><b>/job-info/:jobId</b></code> <code>(Return details of a job. )</code></summary>
105115

106116
#### Parameters
107117

@@ -155,10 +165,10 @@ When we can't get the job info, the response will be:
155165

156166
### Return Details Of A Job
157167

158-
This API has been deprecated, please use /seatunnel/job-info/:jobId instead
168+
This API has been deprecated, please use /job-info/:jobId instead
159169

160170
<details>
161-
<summary><code>GET</code> <code><b>/seatunnel/running-job/:jobId</b></code> <code>(Return details of a job. )</code></summary>
171+
<summary><code>GET</code> <code><b>/running-job/:jobId</b></code> <code>(Return details of a job. )</code></summary>
162172

163173
#### Parameters
164174

@@ -227,7 +237,7 @@ When we can't get the job info, the response will be:
227237
### Return All Finished Jobs Info
228238

229239
<details>
230-
<summary><code>GET</code> <code><b>/seatunnel/finished-jobs/:state</b></code> <code>(Return all finished Jobs Info.)</code></summary>
240+
<summary><code>GET</code> <code><b>/finished-jobs/:state</b></code> <code>(Return all finished Jobs Info.)</code></summary>
231241

232242
#### Parameters
233243

@@ -259,7 +269,7 @@ When we can't get the job info, the response will be:
259269
### Returns System Monitoring Information
260270

261271
<details>
262-
<summary><code>GET</code> <code><b>/seatunnel/system-monitoring-information</b></code> <code>(Returns system monitoring information.)</code></summary>
272+
<summary><code>GET</code> <code><b>/system-monitoring-information</b></code> <code>(Returns system monitoring information.)</code></summary>
263273

264274
#### Parameters
265275

@@ -324,7 +334,7 @@ When we can't get the job info, the response will be:
324334
### Submit A Job
325335

326336
<details>
327-
<summary><code>POST</code> <code><b>/seatunnel/submit-job</b></code> <code>(Returns jobId and jobName if job submitted successfully.)</code></summary>
337+
<summary><code>POST</code> <code><b>/submit-job</b></code> <code>(Returns jobId and jobName if job submitted successfully.)</code></summary>
328338

329339
#### Parameters
330340

@@ -382,7 +392,7 @@ When we can't get the job info, the response will be:
382392
### Batch Submit Jobs
383393

384394
<details>
385-
<summary><code>POST</code> <code><b>/seatunnel/submit-jobs</b></code> <code>(Returns jobId and jobName if the job is successfully submitted.)</code></summary>
395+
<summary><code>POST</code> <code><b>/submit-jobs</b></code> <code>(Returns jobId and jobName if the job is successfully submitted.)</code></summary>
386396

387397
#### Parameters (add in the `params` field in the request body)
388398

@@ -482,7 +492,7 @@ When we can't get the job info, the response will be:
482492
### Stop A Job
483493

484494
<details>
485-
<summary><code>POST</code> <code><b>/seatunnel/stop-job</b></code> <code>(Returns jobId if job stoped successfully.)</code></summary>
495+
<summary><code>POST</code> <code><b>/stop-job</b></code> <code>(Returns jobId if job stoped successfully.)</code></summary>
486496

487497
#### Body
488498

@@ -507,7 +517,7 @@ When we can't get the job info, the response will be:
507517
### Batch Stop Jobs
508518

509519
<details>
510-
<summary><code>POST</code> <code><b>/seatunnel/stop-jobs</b></code> <code>(Returns jobId if the job is successfully stopped.)</code></summary>
520+
<summary><code>POST</code> <code><b>/stop-jobs</b></code> <code>(Returns jobId if the job is successfully stopped.)</code></summary>
511521

512522
#### Request Body
513523

@@ -543,7 +553,7 @@ When we can't get the job info, the response will be:
543553
### Encrypt Config
544554

545555
<details>
546-
<summary><code>POST</code> <code><b>/seatunnel/encrypt-config</b></code> <code>(Returns the encrypted config if config is encrypted successfully.)</code></summary>
556+
<summary><code>POST</code> <code><b>/encrypt-config</b></code> <code>(Returns the encrypted config if config is encrypted successfully.)</code></summary>
547557
For more information about customize encryption, please refer to the documentation [config-encryption-decryption](../connector-v2/Config-Encryption-Decryption.md).
548558

549559
#### Body
@@ -632,7 +642,7 @@ For more information about customize encryption, please refer to the documentati
632642

633643
### Update the tags of running node
634644

635-
<details><summary><code>POST</code><code><b>/seatunnel/update-tags</b></code><code>Because the update can only target a specific node, the current node's `ip:port` needs to be used for the update</code><code>(If the update is successful, return a success message)</code></summary>
645+
<details><summary><code>POST</code><code><b>/update-tags</b></code><code>Because the update can only target a specific node, the current node's `ip:port` needs to be used for the update</code><code>(If the update is successful, return a success message)</code></summary>
636646

637647

638648
#### update node tags

docs/zh/seatunnel-engine/rest-api-v2.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@ v2版本的api使用jetty支持,与v1版本的接口规范相同 ,可以通过
1414
seatunnel:
1515
engine:
1616
enable-http: true
17-
jetty-port: 8080
17+
port: 8080
18+
```
19+
20+
同时也可以配置context-path,配置如下:
21+
22+
```yaml
23+
24+
seatunnel:
25+
engine:
26+
enable-http: true
27+
port: 8080
1828
context-path: /seatunnel
1929
```
2030
@@ -23,7 +33,7 @@ seatunnel:
2333
### 返回Zeta集群的概览
2434
2535
<details>
26-
<summary><code>GET</code> <code><b>/seatunnel/overview?tag1=value1&tag2=value2</b></code> <code>(Returns an overview over the Zeta engine cluster.)</code></summary>
36+
<summary><code>GET</code> <code><b>/overview?tag1=value1&tag2=value2</b></code> <code>(Returns an overview over the Zeta engine cluster.)</code></summary>
2737
2838
#### 参数
2939
@@ -58,7 +68,7 @@ seatunnel:
5868
### 返回所有作业及其当前状态的概览
5969

6070
<details>
61-
<summary><code>GET</code> <code><b>/seatunnel/running-jobs</b></code> <code>(返回所有作业及其当前状态的概览。)</code></summary>
71+
<summary><code>GET</code> <code><b>/running-jobs</b></code> <code>(返回所有作业及其当前状态的概览。)</code></summary>
6272

6373
#### 参数
6474

@@ -97,7 +107,7 @@ seatunnel:
97107
### 返回作业的详细信息
98108

99109
<details>
100-
<summary><code>GET</code> <code><b>/seatunnel/job-info/:jobId</b></code> <code>(返回作业的详细信息。)</code></summary>
110+
<summary><code>GET</code> <code><b>/job-info/:jobId</b></code> <code>(返回作业的详细信息。)</code></summary>
101111

102112
#### 参数
103113

@@ -165,10 +175,10 @@ seatunnel:
165175

166176
### 返回作业的详细信息
167177

168-
此API已经弃用,请使用/seatunnel/job-info/:jobId替代。
178+
此API已经弃用,请使用/job-info/:jobId替代。
169179

170180
<details>
171-
<summary><code>GET</code> <code><b>/seatunnel/running-job/:jobId</b></code> <code>(返回作业的详细信息。)</code></summary>
181+
<summary><code>GET</code> <code><b>/running-job/:jobId</b></code> <code>(返回作业的详细信息。)</code></summary>
172182

173183
#### 参数
174184

@@ -223,7 +233,7 @@ seatunnel:
223233
### 返回所有已完成的作业信息
224234

225235
<details>
226-
<summary><code>GET</code> <code><b>/seatunnel/finished-jobs/:state</b></code> <code>(返回所有已完成的作业信息。)</code></summary>
236+
<summary><code>GET</code> <code><b>/finished-jobs/:state</b></code> <code>(返回所有已完成的作业信息。)</code></summary>
227237

228238
#### 参数
229239

@@ -255,7 +265,7 @@ seatunnel:
255265
### 返回系统监控信息
256266

257267
<details>
258-
<summary><code>GET</code> <code><b>/seatunnel/system-monitoring-information</b></code> <code>(返回系统监控信息。)</code></summary>
268+
<summary><code>GET</code> <code><b>/system-monitoring-information</b></code> <code>(返回系统监控信息。)</code></summary>
259269

260270
#### 参数
261271

@@ -320,7 +330,7 @@ seatunnel:
320330
### 提交作业
321331

322332
<details>
323-
<summary><code>POST</code> <code><b>/seatunnel/submit-job</b></code> <code>(如果作业提交成功,返回jobId和jobName。)</code></summary>
333+
<summary><code>POST</code> <code><b>/submit-job</b></code> <code>(如果作业提交成功,返回jobId和jobName。)</code></summary>
324334

325335
#### 参数
326336

@@ -379,7 +389,7 @@ seatunnel:
379389
### 批量提交作业
380390

381391
<details>
382-
<summary><code>POST</code> <code><b>/seatunnel/submit-jobs</b></code> <code>(如果作业提交成功,返回jobId和jobName。)</code></summary>
392+
<summary><code>POST</code> <code><b>/submit-jobs</b></code> <code>(如果作业提交成功,返回jobId和jobName。)</code></summary>
383393

384394
#### 参数(在请求体中params字段中添加)
385395

@@ -481,7 +491,7 @@ seatunnel:
481491
### 停止作业
482492

483493
<details>
484-
<summary><code>POST</code> <code><b>/seatunnel/stop-job</b></code> <code>(如果作业成功停止,返回jobId。)</code></summary>
494+
<summary><code>POST</code> <code><b>/stop-job</b></code> <code>(如果作业成功停止,返回jobId。)</code></summary>
485495

486496
#### 请求体
487497

@@ -508,7 +518,7 @@ seatunnel:
508518
### 批量停止作业
509519

510520
<details>
511-
<summary><code>POST</code> <code><b>/seatunnel/stop-jobs</b></code> <code>(如果作业成功停止,返回jobId。)</code></summary>
521+
<summary><code>POST</code> <code><b>/stop-jobs</b></code> <code>(如果作业成功停止,返回jobId。)</code></summary>
512522

513523
#### 请求体
514524

@@ -545,7 +555,7 @@ seatunnel:
545555
### 加密配置
546556

547557
<details>
548-
<summary><code>POST</code> <code><b>/seatunnel/encrypt-config</b></code> <code>(如果配置加密成功,则返回加密后的配置。)</code></summary>
558+
<summary><code>POST</code> <code><b>/encrypt-config</b></code> <code>(如果配置加密成功,则返回加密后的配置。)</code></summary>
549559
有关自定义加密的更多信息,请参阅文档[配置-加密-解密](../connector-v2/Config-Encryption-Decryption.md).
550560

551561
#### 请求体
@@ -634,7 +644,7 @@ seatunnel:
634644
### 更新运行节点的tags
635645

636646
<details>
637-
<summary><code>POST</code><code><b>/seatunnel/update-tags</b></code><code>因为更新只能针对于某个节点,因此需要用当前节点ip:port用于更新</code><code>(如果更新成功,则返回"success"信息)</code></summary>
647+
<summary><code>POST</code><code><b>/update-tags</b></code><code>因为更新只能针对于某个节点,因此需要用当前节点ip:port用于更新</code><code>(如果更新成功,则返回"success"信息)</code></summary>
638648

639649

640650
#### 更新节点tags

seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/ClusterSeaTunnelContainer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public void startUp() throws Exception {
107107
tasks.add(
108108
new Tuple3<>(
109109
server.getMappedPort(5801), RestConstant.CONTEXT_PATH, CUSTOM_JOB_ID_1));
110-
tasks.add(new Tuple3<>(server.getMappedPort(8080), "/seatunnel", CUSTOM_JOB_ID_2));
110+
tasks.add(new Tuple3<>(server.getMappedPort(8080), "", CUSTOM_JOB_ID_2));
111111
}
112112

113113
@Override

seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/resources/cluster/seatunnel.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ seatunnel:
3434
http:
3535
enable-http: true
3636
port: 8080
37-
context-path: /seatunnel

0 commit comments

Comments
 (0)