Skip to main content

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

FieldTypeRequiredDescription
userKeyStringYActivation code
modeStringYOnline: online / Offline: offline
dbTyeStringYDatabase type: mysql/postgresql/opengauss/oracle
hostStringNDatabase host
portStringNDatabase port
databaseStringNDatabase name
schemasStringNSchema list (required for pg/opengauss/oracle), separate multiple schemas with commas, case-sensitive
dbUserStringNDatabase username
dbPasswordStringNPassword for username
ddlTextStringNDDL 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

FieldTypeDescription
codeintStatus code
messageStringDescription
dataObjectData

Data structure of data

FieldTypeDescription
workspaceIdStringWorkspace ID

Response Example

  • Success
{  
"code": 200,
"message": "Success",
"data": {
"workspaceId": "1730508173442965506"
}
}
  • Failure
{  
"code": 400,
"message": "server.validate.failed",
"data": null
}