POST /api/login
Parameter | Field type | Essential | Describe |
---|---|---|---|
username | String | Y | User name |
password | String | Y | User password |
curl -X GET http://localhost:8088/api/login
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
accessToken | String | Access credentials |
username | String | User name |
{ "success": true, "errorCode": 0, "errorMsg": null, "model": {"accessToken":"string","username":"string"} }
Note: accessToken is obtained. All subsequent requests need to carry this voucher in request headers: Access-Token: accessToken
GET /api/reg-center
curl -X GET http://localhost:8088/api/reg-center
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
name | String | Name of Registration Center |
registryCenterType | String | Registry type: “zookeeper” / “etcd” |
serverLists | String | Service address of Registration Center |
namespace | String | Namespace of the registry |
orchestrationName | String | Data governance instance name |
digest | String | Permission token to connect to the registry |
activated | Boolean | Is it active |
{ "success": true, "errorCode": 0, "errorMsg": null, "model": [ { "name": "string", "registryCenterType": "Zookeeper", "serverLists": "string", "namespace": "string", "orchestrationName": "string", "digest": "string", "activated": true }, { "name": "string", "registryCenterType": "Etcd", "serverLists": "string", "namespace": "string", "orchestrationName": "string", "digest": "string", "activated": false } ] }
POST /api/reg-center
curl -X POST http://localhost:8088/api/reg-center
Parameter | Field type | Essential | Describe |
---|---|---|---|
name | String | Y | Name of Registration Center |
registryCenterType | String | Y | Registry type: “zookeeper” / “etcd” |
serverLists | String | Y | Service address of Registration Center |
namespace | String | Y | Namespace of the registry |
orchestrationName | String | Y | Data governance instance name |
digest | String | N | Permission token to connect to the registry |
{ "name": "string", "namespace": "string", "orchestrationName": "string", "registryCenterType": "Zookeeper", "serverLists": "string" }
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
{ "success": true, "errorCode": 0, "errorMsg": null, "model": null }
DELETE /api/reg-center
Parameter | Field type | Essential | Describe |
---|---|---|---|
name | String | Y | Name of Registration Center |
{"name":"string"}
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
{"success":true,"errorCode":0,"errorMsg":null,"model":null}
POST /api/reg-center/connect
Parameter | Field type | Essential | Describe |
---|---|---|---|
name | String | Y | Name of Registration Center |
{"name":"string"}
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
{"success":true,"errorCode":0,"errorMsg":null,"model":null}
Note: after the registration center is activated successfully, subsequent configuration and governance operations can be performed. Only one active registry is allowed for the service.
GET /api/reg-center/activated
无
Parameter | Field type | 描述 |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
name | String | Name of Registration Center |
registryCenterType | String | Registry type: “zookeeper” / “etcd” |
serverLists | String | Service address of Registration Center |
namespace | String | Namespace of the registry |
orchestrationName | String | Data governance instance name |
digest | String | Permission token to connect to the registry |
activated | Boolean | Is it active |
{ "success": true, "errorCode": 0, "errorMsg": null, "model": { "name": "string", "registryCenterType": "Zookeeper", "serverLists": "string", "namespace": "string", "orchestrationName": "string", "digest": "string", "activated": true } }
GET /api/schema
无
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
model | Collection | schema name list |
{ "success": true, "errorCode": 0, "errorMsg": null, "model": ["sharding_order", "sharding_db", "master_slave_db"] }
GET /api/schema/rule/{schemaName}
Parameter | Field type | Essential | Describe |
---|---|---|---|
schemaName | String | Y | schema name |
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
model | String | yaml string |
{"success":true,"errorCode":0,"errorMsg":null,"model":"yaml string"}
PUT /api/schema/rule/{schemaName}
Parameter | Field type | Essential | Describe |
---|---|---|---|
schemaName | String | Y | schema name |
ruleConfig | String | Y | yaml string |
{"ruleConfig":"yaml string"}
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
{"success":true,"errorCode":0,"errorMsg":null,"model":null}
GET /api/schema/datasource/{schemaName}
Parameter | Field type | Essential | Describe |
---|---|---|---|
schemaName | String | Y | schema name |
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
model | String | yaml string |
{"success":true,"errorCode":0,"errorMsg":null,"model":"yaml string"}
PUT /api/schema/datasource/{schemaName}
Parameter | Field type | Essential | Describe |
---|---|---|---|
schemaName | String | Y | schema name |
Parameter | Field type | Essential | Describe |
---|---|---|---|
dataSourceConfig | String | Y | yaml string |
{"dataSourceConfig":"yaml string"}
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
{"success":true,"errorCode":0,"errorMsg":null,"model":null}
GET /api/authentication
无
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
username | String | Login user name |
password | String | Login password |
{ "success": true, "errorCode": 0, "errorMsg": null, "model": { "username": "string", "password": "string" } }
PUT /api/authentication
Parameter | Field type | Essential | Describe |
---|---|---|---|
username | String | Y | Login user name |
password | String | Y | Login password |
{"username":"string","password":"string"}
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
{"success":true,"errorCode":0,"errorMsg":null,"model":null}
GET /api/config-map
无
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
model | Map | config map |
{ "success": true, "errorCode": 0, "errorMsg": null, "model": { "sharding-key1": "sharding-value1", "sharding-key2": "sharding-value2", "master-slave-key0": "master-slave-value0", "master-slave-key1": "master-slave-value1" } }
PUT /api/config-map
ConfigMap
{ "sharding-key1": "sharding-value1", "sharding-key2": "sharding-value2", "master-slave-key0": "master-slave-value0", "master-slave-key1": "master-slave-value1" }
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
{"success":true,"errorCode":0,"errorMsg":null,"model":null}
GET /api/properties
无
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
model | String | yaml string |
{"success":true,"errorCode":0,"errorMsg":null,"model":"yaml string"}
PUT /api/properties
Parameter | Field type | Essential | Describe |
---|---|---|---|
properties | String | Y | yaml string |
{"properties":"yaml string"}
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
{"success":true,"errorCode":0,"errorMsg":null,"model":null}
GET /api/orchestration/instance
无
Response Body: (io.shardingsphere.shardingui.web.response.ResponseResult<java.util.Collection<io.shardingsphere.shardingui.common.dto.InstanceDTO>>
)
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
serverIp | String | IP |
instanceId | String | Instance ID |
enabled | Boolean | Instance ID enable status |
{ "success": true, "errorCode": 0, "errorMsg": null, "model": [{ "serverIp": "string", "instanceId": "string", "enabled": true }] }
PUT /api/orchestration/instance
Parameter | Field type | Essential | Describe |
---|---|---|---|
instanceId | String | Y | Running instance ID |
enabled | Boolean | Y | Instance ID enabling status, true: enabled, false: Disabled |
{"instanceId":"string","enabled":false}
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
{"success":true,"errorCode":0,"errorMsg":null,"model":null}
GET /api/orchestration/datasource
无
Response Body: (io.shardingsphere.shardingui.web.response.ResponseResult<java.util.Collection<io.shardingsphere.shardingui.common.dto.SlaveDataSourceDTO>>
)
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
schema | String | Schema name of the slave Library |
masterDataSourceName | String | The name of the master library corresponding to the slave Library |
slaveDataSourceName | String | Name from library |
enabled | Boolean | Enable status from library |
{ "success": true, "errorCode": 0, "errorMsg": null, "model": [ { "schema": "master_slave_db", "masterDataSourceName": "master_ds", "slaveDataSourceName": "slave_ds_0", "enabled": true }, { "schema": "master_slave_db", "masterDataSourceName": "master_ds", "slaveDataSourceName": "slave_ds_1", "enabled": true } ] }
PUT /api/orchestration/datasource
Parameter | Field type | Essential | Describe |
---|---|---|---|
schema | String | Schema name of the slave Library | |
masterDataSourceName | String | The name of the master library corresponding to the slave Library | |
slaveDataSourceName | String | Name from library | |
enabled | Boolean | Enable status from library |
{ "schema": "master_slave_db", "masterDataSourceName": "master_ds", "slaveDataSourceName": "slave_ds_0", "enabled": true }
Parameter | Field type | Describe |
---|---|---|
success | Boolean | Is the request successful |
errorCode | Integer | Error code |
errorMsg | String | Wrong description |
{"success":true,"errorCode":0,"errorMsg":null,"model":null}
GET /api/shardingscaling
curl -X GET http://localhost:8088/api/shardingscaling
{ "success": true, "errorCode": 0, "errorMsg": null, "model": { "serviceName": "scaling", "serviceType": "ShardingScaling", "serviceUrl": "localhost:8084" } } OR { "success": false, "errorCode": 0, "errorMsg": "No configured sharding scaling services", "model": null }
POST /api/shardingscaling
Parameter | Describe |
---|---|
serviceName | user defined name of service |
serviceType | Fixed value ShardingScaling |
serviceUrl | user defined url of service |
curl -X POST \ http://localhost:8088/api/shardingscaling \ -H 'content-type: application/json' \ -d '{ "serviceName": "scaling", "serviceType": "ShardingScaling", "serviceUrl": "localhost:8084" }'
{ "success": true, "errorCode": 0, "errorMsg": null, "model": null }
DELETE /api/shardingscaling
curl -X DELETE http://localhost:8088/api/shardingscaling
{ "success": true, "errorCode": 0, "errorMsg": null, "model": null }
POST /api/shardingscaling/job/start
Parameter | Describe |
---|---|
ruleConfiguration.sourceDatasource | source sharding proxy data source configuration |
ruleConfiguration.sourceRule | source sharding proxy table rule configuration |
ruleConfiguration.destinationDataSources.name | destination sharding proxy name |
ruleConfiguration.destinationDataSources.url | destination sharding proxy jdbc url |
ruleConfiguration.destinationDataSources.username | destination sharding proxy username |
ruleConfiguration.destinationDataSources.password | destination sharding proxy password |
jobConfiguration.concurrency | sync task proposed concurrency |
curl -X POST \ http://localhost:8088/api/shardingscaling/job/start \ -H 'content-type: application/json' \ -d '{ "ruleConfiguration": { "sourceDatasource": "ds*0: !!YamlDataSourceConfiguration\n dataSourceClassName: com.zaxxer.hikari.HikariDataSource\n props:\n jdbcUrl: jdbc:mysql://127.0.0.1:3306/test?serverTimezone=UTC&useSSL=false\n username: root\n password: '\''123456'\''\n connectionTimeout: 30000\n idleTimeout: 60000\n maxLifetime: 1800000\n maxPoolSize: 50\n minPoolSize: 1\n maintenanceIntervalMilliseconds: 30000\n readOnly: false\n", "sourceRule": "defaultDatabaseStrategy:\n inline:\n algorithmExpression: ds*\${user_id % 2}\n shardingColumn: user_id\ntables:\n t1:\n actualDataNodes: ds_0.t1\n keyGenerateStrategy:\n column: order_id\n type: SNOWFLAKE\n logicTable: t1\n tableStrategy:\n inline:\n algorithmExpression: t1\n shardingColumn: order_id\n t2:\n actualDataNodes: ds_0.t2\n keyGenerateStrategy:\n column: order_item_id\n type: SNOWFLAKE\n logicTable: t2\n tableStrategy:\n inline:\n algorithmExpression: t2\n shardingColumn: order_id\n", "destinationDataSources": { "name": "dt_0", "password": "123456", "url": "jdbc:mysql://127.0.0.1:3306/test2?serverTimezone=UTC&useSSL=false", "username": "root" } }, "jobConfiguration": { "concurrency": 3 } }'
{ "success": true, "errorCode": 0, "errorMsg": null, "model": null }
GET /api/shardingscaling/job/progress/{jobId}
curl -X GET \ http://localhost:8088/api/shardingscaling/job/progress/1
{ "success": true, "errorCode": 0, "errorMsg": null, "model": { "id": 1, "jobName": "Local Sharding Scaling Job", "status": "RUNNING/STOPPED" "syncTaskProgress": [{ "id": "127.0.0.1-3306-test", "status": "PREPARING/MIGRATE_HISTORY_DATA/SYNCHRONIZE_REALTIME_DATA/STOPPING/STOPPED", "historySyncTaskProgress": [{ "id": "history-test-t1#0", "estimatedRows": 41147, "syncedRows": 41147 }, { "id": "history-test-t1#1", "estimatedRows": 42917, "syncedRows": 42917 }, { "id": "history-test-t1#2", "estimatedRows": 43543, "syncedRows": 43543 }, { "id": "history-test-t2#0", "estimatedRows": 39679, "syncedRows": 39679 }, { "id": "history-test-t2#1", "estimatedRows": 41483, "syncedRows": 41483 }, { "id": "history-test-t2#2", "estimatedRows": 42107, "syncedRows": 42107 }], "realTimeSyncTaskProgress": { "id": "realtime-test", "delayMillisecond": 1576563771372, "logPosition": { "filename": "ON.000007", "position": 177532875, "serverId": 0 } } }] } }
GET /api/shardingscaling/job/list
curl -X GET \ http://localhost:8088/api/shardingscaling/job/list
{ "success": true, "errorCode": 0, "model": [ { "jobId": 1, "jobName": "Local Sharding Scaling Job", "status": "RUNNING" } ] }
POST /api/shardingscaling/job/stop
Parameter | Describe |
---|---|
jobId | job id |
curl -X POST \ http://localhost:8088/api/shardingscaling/job/stop \ -H 'content-type: application/json' \ -d '{ "jobId":1 }'
{ "success": true, "errorCode": 0, "errorMsg": null, "model": null }