Provider Scaling out Interface
Sequence diagram
Feature
- [x] Create/Start Scaling job interface
- [x] Query Scaling job interface
- [x] List all Scaling job interface
- [x] Show scaling progress and detail #3617
- [x] Stop/Delete Scaling job interface
Reference #3077.
In my opinion, Here are the http request apis:
POST http://127.0.0.1:8080/shardingscaling/startfor starting jobs;GET http://127.0.0.1:8080/shardingscaling/progress/{job_id}for query job progresses;DELETE http://127.0.0.1:8080/shardingscaling/stop/{job_Id}for stopping jobs.
In my opinion, the stop interface should not use DELETE method, because this interface only stop the scaling job.
What's more all interface can add /job/ prefix like
/shardingscaling/job/start [POST]
/shardingscaling/job/progress/${jobId} [GET]
/shardingscaling/job/stop [POST]
In my opinion, the
stopinterface should not use DELETE method, because this interface only stop the scaling job.What's more all interface can add
/job/prefix like/shardingscaling/job/start [POST] /shardingscaling/job/progress/${jobId} [GET] /shardingscaling/job/stop [POST]
Agree. The apis will be these.
Talk about the response body:
- Start action's reponse body:
{
"message":"Start job success!",
"content":{
"jobId":"0"
}
}
- Query progress's response body:
{
"message": "Get progress of the job success!",
"content": {
"jobId": "0",
"job_name": "",
"data_node_progress": [
{
"id": "{host}-{port}-{schema}",
"stage": "prepare/history_data/realtime_data/stopped",
"history_data_progress": [
{
"id": "{schema}-{table}-split#0",
"expected_rows": 0,
"sycned_rows": 0
}
],
"realtime_data_progress": {
"id": "{schema}-realtime",
"log_positon": 0,
"delay_second": 0
}
}
]
}
}
- Stop action's response body:
{
"message":"Stop job success!",
"content":""
}
In order to keep the interface data format unified, the following structure is recommended
{
errorCode: 0,
errorMsg: null,
model: {} // Main data
success: true
}
add interface for list all jobs:
/shardingscaling/job/list [GET]
UI hand drawing
