Add DDL statements to a virtual data source instance in your current workspace. Alibaba Cloud GBI parses these DDL statements to extract and maintain table schema information.
Try it now
You can directly run this API in OpenAPI Explorer without worrying about signature calculation. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
Try it now
RAM authorization
The following table describes the authorization information for this API. You can use it in the Action element of a RAM policy statement to grant RAM users or RAM roles permission to call this API. Details are as follows:
- Action: the specific permission point.
- Access level: the access level of each operation. Valid values: Write, Read, or List.
-
Resource type: the resource types that support authorization in the operation. Details are as follows:
- Required resource types are marked with a leading asterisk (*).
- For operations that do not support resource-level authorization,
All resourcesis used.
- Condition key: the condition keys defined by the cloud service itself.
- Dependent action: other permissions required to successfully perform the operation. The caller must also have the permissions of the dependent actions for the operation to succeed.
| Action | Access level | Resource type | Condition key | Dependent action |
|---|---|---|---|---|
| dataanalysisgbi:SaveVirtualDatasourceDdl | none | *All resources * |
| None |
Request syntax
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| workspaceId | string | Yes | The ID of the Alibaba Cloud Model Studio workspace for the current request. | llm-2v3934xtp49esw64 |
| body | object | No | The parameters of the request body. | |
| vdbId | string | Yes | The ID of the virtual data source instance. | vdb-E0F693C8-9F72-5830-B81A-696C9D8EBBD1 |
| ddl | string | Yes | The create-type database DDL statement. You can pass multiple statements, separated by line feeds (\n). | CREATE TABLE user (id int NOT NULL AUTO_INCREMENT comment 'ID',name varchar(10) NOT NULL comment 'Name', dept_id int NOT NULL comment 'Department ID', salary bigint NULL DEFAULT 0 comment 'Salary', PRIMARY KEY (`id`), KEY `idx_name` (`name`), KEY `d_id` (`dept_id`), CONSTRAINT `d_id` FOREIGN KEY (`dept_id`) REFERENCES `department` (`id`)) COMMENT='This is my table' ENGINE=InnoDB AUTO_INCREMENT=20094 DEFAULT CHARSET=utf8 ; |
Response elements
| Element | Type | Description | Example |
|---|---|---|---|
| object | Result | ||
| data | any | The response information. | true |
| errorMsg | string | The error message. | NoAuth |
| code | string | The error code. | NoAuth |
| success | boolean | true indicates that the API call was successful. false indicates that the API call failed. | true |
| requestId | string | The request ID. Each request has a unique ID, which is used for troubleshooting. | 72ABCA5B-1E93-55D3-8A61-6D8A03CC5C8B |
Examples
Success response
JSON format
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 401 | NoAuth | Bad Request: Workspace.Illegal.Auth. | The current account does not have permission on the specified business space. |
| 401 | Internal.Error | Bad Request: Internal Error. | Internal error. Contact customer service personnel for troubleshooting. |