Skip to main content

SaveVirtualDatasourceDdl

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 resources is 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.
ActionAccess levelResource typeCondition keyDependent action
dataanalysisgbi:SaveVirtualDatasourceDdlnone
*All resources
*
    None
None

Request syntax

POST /gbi/virtualDatasource/addDdl2VirtualInstance HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
workspaceIdstringYes

The ID of the Alibaba Cloud Model Studio workspace for the current request.

llm-2v3934xtp49esw64
bodyobjectNo

The parameters of the request body.

vdbIdstringYes

The ID of the virtual data source instance.

vdb-E0F693C8-9F72-5830-B81A-696C9D8EBBD1
ddlstringYes

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

ElementTypeDescriptionExample
object

Result

dataany

The response information.

true
errorMsgstring

The error message.

NoAuth
codestring

The error code.

NoAuth
successboolean

true indicates that the API call was successful. false indicates that the API call failed.

true
requestIdstring

The request ID. Each request has a unique ID, which is used for troubleshooting.

72ABCA5B-1E93-55D3-8A61-6D8A03CC5C8B

Examples

Success response JSON format
{
  "data": true,
  "errorMsg": "NoAuth",
  "code": "NoAuth",
  "success": true,
  "requestId": "72ABCA5B-1E93-55D3-8A61-6D8A03CC5C8B"
}

Error codes

HTTP status codeError codeError messageDescription
401NoAuthBad Request: Workspace.Illegal.Auth.The current account does not have permission on the specified business space.
401Internal.ErrorBad Request: Internal Error.Internal error. Contact customer service personnel for troubleshooting.
See the Error Center for more error codes.