Project: SeaTunnel (App Definition and Development / Streaming & Messaging)
File: rest-api.md

sidebar_position: 7 SeaTunnel has a monitoring API that can be used to query status and statistics of running jobs, as well as recent completed jobs. The monitoring API is a REST-ful API that accepts HTTP requests and responds with JSON data. The monitoring API is backed by a web server that runs as part of the node, each node member can provide rest api capability. By default, this server listens at port 5801, which can be configured in hazelcast.yaml like : ```yaml network: rest-api: enabled: true endpoint-groups: CLUSTER_WRITE: enabled: true DATA: enabled: true join: tcp-ip: enabled: true member-list: localhost port: auto-increment: true port-count: 100 port: 5801 ``` <details> <summary><code>GET</code> <code><b>/hazelcast/rest/maps/running-jobs</b></code> <code>(Returns an overview over all jobs and their current state.)</code></summary> ```json [ { "jobId": "", "jobName": "", "jobStatus": "", "envOptions": { }, "createTime": "", "jobDag": { "vertices": [ ], "edges": [ ] }, "pluginJarsUrls": [ ], "isStartWithSavePoint": false, "metrics": { "sourceReceivedCount": "", "sinkWriteCount": "" } } ] ``` </details> <details> <summary><code>GET</code> <code><b>/hazelcast/rest/maps/job-info/:jobId</b></code> <code>(Return details of a job. )</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` 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> This API has been deprecated, please use /hazelcast/rest/maps/job-info/:jobId instead <details> <summary><code>GET</code> <code><b>/hazelcast/rest/maps/running-job/:jobId</b></code> <code>(Return details of a job. )</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` always be returned. `envOptions`, `pluginJarsUrls`, `isStartWithSavePoint` will return when job is running. `finishedTime`, `errorMsg` will return when job is

When we can't get the job info, the response will be: ```json { "jobId" : "" } ``` </details> <details> <summary><code>GET</code> <code><b>/hazelcast/rest/maps/finished-jobs/:state</b></code> <code>(Return all finished Jobs Info.)</code></summary> | name | type | data type | description | |-|-|--|| | state | optional | string | finished job status. `FINISHED`,`CANCELED`,`FAILED`,`UNKNOWABLE` | ```json [ { "jobId": "", "jobName": "", "jobStatus": "", "errorMsg": null, "createTime": "", "finishTime": "", "jobDag": "", "metrics": "" } ] ``` </details> <details> <summary><code>GET</code> <code><b>/hazelcast/rest/maps/system-monitoring-information</b></code> <code>(Returns system monitoring information.)</code></summary> ```json [ { "processors":"8", "physical.memory.total":"16.0G", "physical.memory.free":"16.3M", "swap.space.total":"0", "swap.space.free":"0", "heap.memory.used":"135.7M", "heap.memory.free":"440.8M", "heap.memory.total":"576.5M", "heap.memory.max":"3.6G", "heap.memory.used/total":"23.54%", "heap.memory.used/max":"3.73%", "minor.gc.count":"6", "minor.gc.time":"110ms", "major.gc.count":"2", "major.gc.time":"73ms", "load.process":"24.78%", "load.system":"60.00%", "load.systemAverage":"2.07", "thread.count":"117", "thread.peakCount":"118", "cluster.timeDiff":"0", "event.q.size":"0", "executor.q.async.size":"0", "executor.q.client.size":"0", "executor.q.client.query.size":"0", "executor.q.client.blocking.size":"0", "executor.q.query.size":"0", "executor.q.scheduled.size":"0", "executor.q.io.size":"0", "executor.q.system.size":"0", "executor.q.operations.size":"0", "executor.q.priorityOperation.size":"0", "operations.completed.count":"10", "executor.q.mapLoad.size":"0", "executor.q.mapLoadAllKeys.size":"0", "executor.q.cluster.size":"0", "executor.q.response.size":"0", "operations.running.count":"0", "operations.pending.invocations.percentage":"0.00%", "operations.pending.invocations.count":"0", "proxy.count":"8", "clientEndpoint.count":"0", "connection.active.count":"2", "client.connection.count":"0", "connection.count":"0" } ] ``` </details> <details> <summary><code>POST</code> <code><b>/hazelcast/rest/maps/submit-job</b></code> <code>(Returns jobId and jobName if job submitted successfully.)</code></summary> | name | type | data type | description | |-|-|--|--| | jobId | optional | string | job id | | jobName | optional | string | job name | | isStartWithSavePoint | optional | string | if job is started with save point | ```json { "env": { "job.mode": "batch" }, "source": [ { "plugin_name": "FakeSource", "resulttablename": "fake", "row.num": 100, "schema": { "fields": { "name": "string", "age": "int", "card": "int" } } } ], "transform": [ ], "sink": [ { "plugin_name": "Console", "sourcetablename": ["fake"] } ] } ``` ```json { "jobId": 733584788375666689, "jobName": "restapitest" } ``` </details> <details> <summary><code>POST</code> <code><b>/hazelcast/rest/maps/stop-job</b></code> <code>(Returns jobId if job stoped successfully.)</code></summary> ```json { "jobId": 733584788375666689, "isStopWithSavePoint": false # if job is stopped with save point } ``` ```json { "jobId": 733584788375666689 } ``` </details> <details> <summary><code>POST</code> <code><b>/hazelcast/rest/maps/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 . ```json { "env": { "parallelism": 1, "shade.identifier":"base64" }, "source": [ { "plugin_name": "MySQL-CDC", "schema" : { "fields": { "name": "string", "age": "int" } }, "resulttablename": "fake", "parallelism": 1, "hostname": "127.0.0.1", "username": "seatunnel", "password": "seatunnel_password", "table-name": "inventory_vwyw0n" } ], "transform": [ ], "sink": [ { "plugin_name": "Clickhouse", "host": "localhost:8123", "database": "default", "table": "fake_all", "username": "seatunnel", "password": "seatunnel_password" } ] } ``` ```json { "env": { "parallelism": 1, "shade.identifier": "base64" }, "source": [ { "plugin_name": "MySQL-CDC", "schema": { "fields": { "name": "string", "age": "int" } }, "resulttablename": "fake", "parallelism": 1, "hostname": "127.0.0.1", "username": "c2VhdHVubmVs", "password": "c2VhdHVubmVsX3Bhc3N3b3Jk", "table-name": "inventory_vwyw0n" } ], "transform": [], "sink": [ { "plugin_name": "Clickhouse", "host": "localhost:8123", "database": "default", "table": "fake_all", "username": "c2VhdHVubmVs", "password": "c2VhdHVubmVsX3Bhc3N3b3Jk" } ] } ``` </details>