Skip to content

Commit

Permalink
[Improve][RestApi] Update context-path to / as default path (#7800)
Browse files Browse the repository at this point in the history
  • Loading branch information
liugddx authored Oct 9, 2024
1 parent 3078d78 commit 959e305
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 32 deletions.
2 changes: 0 additions & 2 deletions config/seatunnel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,3 @@ seatunnel:
http:
enable-http: true
port: 8080
context-path: /seatunnel

38 changes: 24 additions & 14 deletions docs/en/seatunnel-engine/rest-api-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
38 changes: 24 additions & 14 deletions docs/zh/seatunnel-engine/rest-api-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand All @@ -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>
#### 参数
Expand Down Expand Up @@ -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>

#### 参数

Expand Down Expand Up @@ -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>

#### 参数

Expand Down Expand Up @@ -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>

#### 参数

Expand Down Expand Up @@ -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>

#### 参数

Expand Down Expand Up @@ -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>

#### 参数

Expand Down Expand Up @@ -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>

#### 参数

Expand Down Expand Up @@ -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字段中添加)

Expand Down Expand Up @@ -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>

#### 请求体

Expand All @@ -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>

#### 请求体

Expand Down Expand Up @@ -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).

#### 请求体
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void startUp() throws Exception {
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ seatunnel:
http:
enable-http: true
port: 8080
context-path: /seatunnel

0 comments on commit 959e305

Please sign in to comment.