This is an automated email from the ASF dual-hosted git repository.
liugddx pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new 959e3053fc [Improve][RestApi] Update context-path to / as default path
(#7800)
959e3053fc is described below
commit 959e3053fce6521d2ce5fc8c75c653cc3368395e
Author: Guangdong Liu <[email protected]>
AuthorDate: Wed Oct 9 19:51:08 2024 +0800
[Improve][RestApi] Update context-path to / as default path (#7800)
---
config/seatunnel.yaml | 2 --
docs/en/seatunnel-engine/rest-api-v2.md | 38 ++++++++++++++--------
docs/zh/seatunnel-engine/rest-api-v2.md | 38 ++++++++++++++--------
.../engine/e2e/ClusterSeaTunnelContainer.java | 2 +-
.../src/test/resources/cluster/seatunnel.yaml | 1 -
5 files changed, 49 insertions(+), 32 deletions(-)
diff --git a/config/seatunnel.yaml b/config/seatunnel.yaml
index 141363ab03..c383239423 100644
--- a/config/seatunnel.yaml
+++ b/config/seatunnel.yaml
@@ -40,5 +40,3 @@ seatunnel:
http:
enable-http: true
port: 8080
- context-path: /seatunnel
-
diff --git a/docs/en/seatunnel-engine/rest-api-v2.md
b/docs/en/seatunnel-engine/rest-api-v2.md
index 9f98ea0dda..643b4e51d8 100644
--- a/docs/en/seatunnel-engine/rest-api-v2.md
+++ b/docs/en/seatunnel-engine/rest-api-v2.md
@@ -18,7 +18,17 @@ The v2 version of the api uses jetty support. It is the same
as the interface sp
seatunnel:
engine:
enable-http: true
- jetty-port: 8080
+ port: 8080
+```
+
+Context-path can also be configured as follows:
+
+```yaml
+
+seatunnel:
+ engine:
+ enable-http: true
+ port: 8080
context-path: /seatunnel
```
@@ -27,7 +37,7 @@ seatunnel:
### Returns an overview over the Zeta engine cluster.
<details>
- <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>
+ <summary><code>GET</code>
<code><b>/overview?tag1=value1&tag2=value2</b></code> <code>(Returns an
overview over the Zeta engine cluster.)</code></summary>
#### Parameters
@@ -62,7 +72,7 @@ seatunnel:
### Returns An Overview And State Of All Jobs
<details>
- <summary><code>GET</code> <code><b>/seatunnel/running-jobs</b></code>
<code>(Returns an overview over all jobs and their current
state.)</code></summary>
+ <summary><code>GET</code> <code><b>/running-jobs</b></code> <code>(Returns an
overview over all jobs and their current state.)</code></summary>
#### Parameters
@@ -101,7 +111,7 @@ seatunnel:
### Return Details Of A Job
<details>
- <summary><code>GET</code> <code><b>/seatunnel/job-info/:jobId</b></code>
<code>(Return details of a job. )</code></summary>
+ <summary><code>GET</code> <code><b>/job-info/:jobId</b></code> <code>(Return
details of a job. )</code></summary>
#### Parameters
@@ -155,10 +165,10 @@ When we can't get the job info, the response will be:
### Return Details Of A Job
-This API has been deprecated, please use /seatunnel/job-info/:jobId instead
+This API has been deprecated, please use /job-info/:jobId instead
<details>
- <summary><code>GET</code> <code><b>/seatunnel/running-job/:jobId</b></code>
<code>(Return details of a job. )</code></summary>
+ <summary><code>GET</code> <code><b>/running-job/:jobId</b></code>
<code>(Return details of a job. )</code></summary>
#### Parameters
@@ -227,7 +237,7 @@ When we can't get the job info, the response will be:
### Return All Finished Jobs Info
<details>
- <summary><code>GET</code> <code><b>/seatunnel/finished-jobs/:state</b></code>
<code>(Return all finished Jobs Info.)</code></summary>
+ <summary><code>GET</code> <code><b>/finished-jobs/:state</b></code>
<code>(Return all finished Jobs Info.)</code></summary>
#### Parameters
@@ -259,7 +269,7 @@ When we can't get the job info, the response will be:
### Returns System Monitoring Information
<details>
- <summary><code>GET</code>
<code><b>/seatunnel/system-monitoring-information</b></code> <code>(Returns
system monitoring information.)</code></summary>
+ <summary><code>GET</code> <code><b>/system-monitoring-information</b></code>
<code>(Returns system monitoring information.)</code></summary>
#### Parameters
@@ -324,7 +334,7 @@ When we can't get the job info, the response will be:
### Submit A Job
<details>
-<summary><code>POST</code> <code><b>/seatunnel/submit-job</b></code>
<code>(Returns jobId and jobName if job submitted
successfully.)</code></summary>
+<summary><code>POST</code> <code><b>/submit-job</b></code> <code>(Returns
jobId and jobName if job submitted successfully.)</code></summary>
#### Parameters
@@ -382,7 +392,7 @@ When we can't get the job info, the response will be:
### Batch Submit Jobs
<details>
-<summary><code>POST</code> <code><b>/seatunnel/submit-jobs</b></code>
<code>(Returns jobId and jobName if the job is successfully
submitted.)</code></summary>
+<summary><code>POST</code> <code><b>/submit-jobs</b></code> <code>(Returns
jobId and jobName if the job is successfully submitted.)</code></summary>
#### Parameters (add in the `params` field in the request body)
@@ -482,7 +492,7 @@ When we can't get the job info, the response will be:
### Stop A Job
<details>
-<summary><code>POST</code> <code><b>/seatunnel/stop-job</b></code>
<code>(Returns jobId if job stoped successfully.)</code></summary>
+<summary><code>POST</code> <code><b>/stop-job</b></code> <code>(Returns jobId
if job stoped successfully.)</code></summary>
#### Body
@@ -507,7 +517,7 @@ When we can't get the job info, the response will be:
### Batch Stop Jobs
<details>
-<summary><code>POST</code> <code><b>/seatunnel/stop-jobs</b></code>
<code>(Returns jobId if the job is successfully stopped.)</code></summary>
+<summary><code>POST</code> <code><b>/stop-jobs</b></code> <code>(Returns jobId
if the job is successfully stopped.)</code></summary>
#### Request Body
@@ -543,7 +553,7 @@ When we can't get the job info, the response will be:
### Encrypt Config
<details>
-<summary><code>POST</code> <code><b>/seatunnel/encrypt-config</b></code>
<code>(Returns the encrypted config if config is encrypted
successfully.)</code></summary>
+<summary><code>POST</code> <code><b>/encrypt-config</b></code> <code>(Returns
the encrypted config if config is encrypted successfully.)</code></summary>
For more information about customize encryption, please refer to the
documentation
[config-encryption-decryption](../connector-v2/Config-Encryption-Decryption.md).
#### Body
@@ -632,7 +642,7 @@ For more information about customize encryption, please
refer to the documentati
### Update the tags of running node
-<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>
+<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>
#### update node tags
diff --git a/docs/zh/seatunnel-engine/rest-api-v2.md
b/docs/zh/seatunnel-engine/rest-api-v2.md
index dbfb2152ba..cdd27595bf 100644
--- a/docs/zh/seatunnel-engine/rest-api-v2.md
+++ b/docs/zh/seatunnel-engine/rest-api-v2.md
@@ -14,7 +14,17 @@ v2版本的api使用jetty支持,与v1版本的接口规范相同 ,可以通过
seatunnel:
engine:
enable-http: true
- jetty-port: 8080
+ port: 8080
+```
+
+同时也可以配置context-path,配置如下:
+
+```yaml
+
+seatunnel:
+ engine:
+ enable-http: true
+ port: 8080
context-path: /seatunnel
```
@@ -23,7 +33,7 @@ seatunnel:
### 返回Zeta集群的概览
<details>
- <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>
+ <summary><code>GET</code>
<code><b>/overview?tag1=value1&tag2=value2</b></code> <code>(Returns an
overview over the Zeta engine cluster.)</code></summary>
#### 参数
@@ -58,7 +68,7 @@ seatunnel:
### 返回所有作业及其当前状态的概览
<details>
- <summary><code>GET</code> <code><b>/seatunnel/running-jobs</b></code>
<code>(返回所有作业及其当前状态的概览。)</code></summary>
+ <summary><code>GET</code> <code><b>/running-jobs</b></code>
<code>(返回所有作业及其当前状态的概览。)</code></summary>
#### 参数
@@ -97,7 +107,7 @@ seatunnel:
### 返回作业的详细信息
<details>
- <summary><code>GET</code> <code><b>/seatunnel/job-info/:jobId</b></code>
<code>(返回作业的详细信息。)</code></summary>
+ <summary><code>GET</code> <code><b>/job-info/:jobId</b></code>
<code>(返回作业的详细信息。)</code></summary>
#### 参数
@@ -165,10 +175,10 @@ seatunnel:
### 返回作业的详细信息
-此API已经弃用,请使用/seatunnel/job-info/:jobId替代。
+此API已经弃用,请使用/job-info/:jobId替代。
<details>
- <summary><code>GET</code> <code><b>/seatunnel/running-job/:jobId</b></code>
<code>(返回作业的详细信息。)</code></summary>
+ <summary><code>GET</code> <code><b>/running-job/:jobId</b></code>
<code>(返回作业的详细信息。)</code></summary>
#### 参数
@@ -223,7 +233,7 @@ seatunnel:
### 返回所有已完成的作业信息
<details>
- <summary><code>GET</code> <code><b>/seatunnel/finished-jobs/:state</b></code>
<code>(返回所有已完成的作业信息。)</code></summary>
+ <summary><code>GET</code> <code><b>/finished-jobs/:state</b></code>
<code>(返回所有已完成的作业信息。)</code></summary>
#### 参数
@@ -255,7 +265,7 @@ seatunnel:
### 返回系统监控信息
<details>
- <summary><code>GET</code>
<code><b>/seatunnel/system-monitoring-information</b></code>
<code>(返回系统监控信息。)</code></summary>
+ <summary><code>GET</code> <code><b>/system-monitoring-information</b></code>
<code>(返回系统监控信息。)</code></summary>
#### 参数
@@ -320,7 +330,7 @@ seatunnel:
### 提交作业
<details>
-<summary><code>POST</code> <code><b>/seatunnel/submit-job</b></code>
<code>(如果作业提交成功,返回jobId和jobName。)</code></summary>
+<summary><code>POST</code> <code><b>/submit-job</b></code>
<code>(如果作业提交成功,返回jobId和jobName。)</code></summary>
#### 参数
@@ -379,7 +389,7 @@ seatunnel:
### 批量提交作业
<details>
-<summary><code>POST</code> <code><b>/seatunnel/submit-jobs</b></code>
<code>(如果作业提交成功,返回jobId和jobName。)</code></summary>
+<summary><code>POST</code> <code><b>/submit-jobs</b></code>
<code>(如果作业提交成功,返回jobId和jobName。)</code></summary>
#### 参数(在请求体中params字段中添加)
@@ -481,7 +491,7 @@ seatunnel:
### 停止作业
<details>
-<summary><code>POST</code> <code><b>/seatunnel/stop-job</b></code>
<code>(如果作业成功停止,返回jobId。)</code></summary>
+<summary><code>POST</code> <code><b>/stop-job</b></code>
<code>(如果作业成功停止,返回jobId。)</code></summary>
#### 请求体
@@ -508,7 +518,7 @@ seatunnel:
### 批量停止作业
<details>
-<summary><code>POST</code> <code><b>/seatunnel/stop-jobs</b></code>
<code>(如果作业成功停止,返回jobId。)</code></summary>
+<summary><code>POST</code> <code><b>/stop-jobs</b></code>
<code>(如果作业成功停止,返回jobId。)</code></summary>
#### 请求体
@@ -545,7 +555,7 @@ seatunnel:
### 加密配置
<details>
-<summary><code>POST</code> <code><b>/seatunnel/encrypt-config</b></code>
<code>(如果配置加密成功,则返回加密后的配置。)</code></summary>
+<summary><code>POST</code> <code><b>/encrypt-config</b></code>
<code>(如果配置加密成功,则返回加密后的配置。)</code></summary>
有关自定义加密的更多信息,请参阅文档[配置-加密-解密](../connector-v2/Config-Encryption-Decryption.md).
#### 请求体
@@ -634,7 +644,7 @@ seatunnel:
### 更新运行节点的tags
<details>
-<summary><code>POST</code><code><b>/seatunnel/update-tags</b></code><code>因为更新只能针对于某个节点,因此需要用当前节点ip:port用于更新</code><code>(如果更新成功,则返回"success"信息)</code></summary>
+<summary><code>POST</code><code><b>/update-tags</b></code><code>因为更新只能针对于某个节点,因此需要用当前节点ip:port用于更新</code><code>(如果更新成功,则返回"success"信息)</code></summary>
#### 更新节点tags
diff --git
a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/ClusterSeaTunnelContainer.java
b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/ClusterSeaTunnelContainer.java
index 9c46d6711c..804c77f340 100644
---
a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/ClusterSeaTunnelContainer.java
+++
b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/java/org/apache/seatunnel/engine/e2e/ClusterSeaTunnelContainer.java
@@ -107,7 +107,7 @@ public class ClusterSeaTunnelContainer extends
SeaTunnelContainer {
tasks.add(
new Tuple3<>(
server.getMappedPort(5801), RestConstant.CONTEXT_PATH,
CUSTOM_JOB_ID_1));
- tasks.add(new Tuple3<>(server.getMappedPort(8080), "/seatunnel",
CUSTOM_JOB_ID_2));
+ tasks.add(new Tuple3<>(server.getMappedPort(8080), "",
CUSTOM_JOB_ID_2));
}
@Override
diff --git
a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/resources/cluster/seatunnel.yaml
b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/resources/cluster/seatunnel.yaml
index 4df400d08c..0720832a67 100644
---
a/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/resources/cluster/seatunnel.yaml
+++
b/seatunnel-e2e/seatunnel-engine-e2e/connector-seatunnel-e2e-base/src/test/resources/cluster/seatunnel.yaml
@@ -34,4 +34,3 @@ seatunnel:
http:
enable-http: true
port: 8080
- context-path: /seatunnel
\ No newline at end of file