1. Create a Workspace
Description: Create a workspace and return the workspace ID (workspaceId).
1.1. Interface URL
Post http://${server-host}:${server-port}/api/v1/createWorkspace
1.2. Request Parameters
Field | Type | Required | Description |
---|---|---|---|
userKey | String | Y | Activation code |
mode | String | Y | Online: online / Offline: offline |
dbTye | String | Y | Database type: mysql/postgresql/opengauss/oracle |
host | String | N | Database host |
port | String | N | Database port |
database | String | N | Database name |
schemas | String | N | Schema list (required for pg/opengauss/oracle), separate multiple schemas with commas, case-sensitive |
dbUser | String | N | Database username |
dbPassword | String | N | Password for username |
ddlText | String | N | DDL text corresponding to the workspace (offline mode) |
Request Example
- Offline mode
{
"mode": "offline",
"userKey": "CB698418-88B25371-67F15F01-XXXXXXXX",
"dbType": "mysql",
"ddlText": "CREATE TABLE `organization` (`org_id` bigint(20) NOT NULL);"
}
- Online mode
{
"mode": "online",
"userKey": "CB698418-88B25371-67F15F01-XXXXXXXX",
"dbType": "mysql",
"host": "localhost",
"port": "3306",
"database": "pawsql",
"dbUser": "root",
"dbPassword": "password"
}
1.3. Response
Field | Type | Description |
---|---|---|
code | int | Status code |
message | String | Description |
data | Object | Data |
Data structure of data
Field | Type | Description |
---|---|---|
workspaceId | String | Workspace ID |
Response Example
- Success
{
"code": 200,
"message": "Success",
"data": {
"workspaceId": "1730508173442965506"
}
}
- Failure
{
"code": 400,
"message": "server.validate.failed",
"data": null
}