Creates a ticket for importing data to Data Management (DMS).

For more information about the Large Data Import feature, see Import data.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Comment String Yes test

The purpose or objective of the data change. This reduces unnecessary communication.

RelatedUserList Array of Long No 24325

The stakeholders of this operation. All stakeholders can view the ticket details and assist in the approval process. Irrelevant users other than DMS administrators and database administrators (DBAs) are not allowed to view the ticket details.

Param Object Yes

The parameters of the ticket.

Classify String No test

The reason for the data import.

AttachmentName String Yes test

The key of the attachment for the data import. You can call the GetUserUploadFileJob operation to obtain the attachment key from the value of the AttachmentKey parameter.

DbItemList Array Yes

The database to which you want to import data. You can specify only one database.

DbId Long Yes 1342353

The ID of the database. You can call the SearchDatabases operation to query the ID of the database.

Logic Boolean Yes false

Specifies whether the database is a logical database. Valid values:

  • true: yes
  • false: no
FileType String Yes CSV

The format of the file for the data import. Valid values:

  • SQL: SQL script
  • CSV: CSV file
FileEncoding String No AUTO

The encoding algorithm to be used by the destination database. Valid values:

  • AUTO: automatic identification
  • UTF-8: UTF-8 encoding
  • GBK: GBK encoding
  • ISO-8859-1: ISO-8859-1 encoding
TableName String No t1

The name of the table to which you want to import data.

Note If the FileType parameter is set to CSV, this parameter is required.
InsertType String No INSERT

The mode that is used to write the data in the CSV format to the destination table. Valid values:

  • INSERT
  • INSERT_IGNORE
  • REPLACE_INTO
Note If the FileType parameter is set to CSV, this parameter is required.
CsvFirstRowIsColumnDef Boolean No true

The type of the CSV file. Valid values:

  • true: The first row in the CSV file contains field names.
  • false: The first row in the CSV file contains data.
Note If the FileType parameter is set to CSV, this parameter is required.
IgnoreError Boolean No false

Specifies whether to skip errors. Valid values:

  • true: If an error occurs, DMS skips the error and continues to execute SQL statements.
  • false: If an error occurs, DMS stops executing SQL statements.
ImportMode String No FAST_MODE

The import mode. Valid values:

  • FAST_MODE: In the Execute step, the uploaded file is read and SQL statements are executed to import data to the specified destination database. Compared with the SAFE_MODE mode, this mode can be used to import data in a less secure but more efficient manner.
  • SAFE_MODE: In the Precheck step, the uploaded file is parsed and SQL statements or CSV file data is cached. In the Execute step, the cached SQL statements are read and executed to import data or the cached CSV file data is read and imported to the specified destination database. Compared with the FAST_MODE mode, this mode can be used to import data in a more secure but slower manner.
RollbackSQL String No empty

The SQL statements for rolling back the data change.

Note If the RollbackSqlType parameter is set to TEXT, this parameter is required.
RollbackAttachmentName String No rollback.sql

The key of the attachment that contains the SQL statements for rolling back the data change. You can call the GetUserUploadFileJob operation to obtain the attachment key from the value of the AttachmentKey parameter.

Note If the RollbackSqlType parameter is set to ATTACHMENT, this parameter is required.
RollbackSqlType String No TEXT

The format of the SQL statements for rolling back the data change. Valid values:

  • TEXT: text
  • ATTACHMENT: attachment
AttachmentKey String No order_attachment.txt

The key of the attachment for the ticket. The attachment provides more instructions for this operation.

You can call the GetUserUploadFileJob operation to query the key of the attachment.

Tid Long No 14325432

The ID of the tenant.

Note The ID of the tenant is displayed when you move the pointer over the profile picture in the upper-right corner of the DMS console. For more information, see Tenant information.
RegionId String No cn-hangzhou

The ID of the region where the DMS service resides. For more information about the valid values of this parameter, see RegionID parameter.

Note Set this parameter to the ID of the region that is close to your services.

Response parameters

Parameter Type Example Description
RequestId String 0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931

The ID of the request.

Success Boolean true

Indicates whether the call was successful.

ErrorMessage String UnknownError

The error message that is returned.

ErrorCode String UnknownError

The error code that is returned.

CreateOrderResult Array of Long 13453

The ID of the ticket.

Examples

Sample requests

http(s)://[Endpoint]/?Comment=test
&RelatedUserList=[24325]
&Param={"Classify":"test","AttachmentName":"test.csv","DbItemList":[{"DbId":1342353,"Logic":false}],"FileType":"CSV","FileEncoding":"AUTO","TableName":"t1","InsertType":"INSERT","CsvFirstRowIsColumnDef":true,"IgnoreError":false,"ImportMode":"FAST_MODE","RollbackSQL":"empty","RollbackAttachmentName":"rollback.sql","RollbackSqlType":"TEXT"}
&AttachmentKey=order_attachment.txt
&Tid=14325432
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateDataImportOrderResponse>
    <RequestId>0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931</RequestId>
    <Success>false</Success>
    <CreateOrderResult>13453</CreateOrderResult>
</CreateDataImportOrderResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931",
  "Success" : false,
  "CreateOrderResult" : [ 13453 ]
}

Error codes

For a list of error codes, visit the API Error Center.