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

For more instructions on this feature, see Data import .

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
Action String Yes test

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

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 attachment key of the imported data, you can call GetUserUploadFileJob The interface obtains this parameter (this parameter is the AttachmentKey parameter in the GetUserUploadFileJob interface).

DbItemList Array Yes

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

DbId Long Yes 1342353

Database ID, callable SearchDatabases Interface acquisition.

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 file
  • CSV : CSV file
FileEncoding String No AUTO

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

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

The destination table to which the data in the CSV format is imported.

Note When FileType Parameters are 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 When FileType Parameters are CSV this parameter is required.
CsvFirstRowIsColumnDef Boolean No true

The type of the CSV file. Valid values:

  • true : The first row of the CSV table is the field name.
  • false : The first row of the CSV table is data.
Note When FileType Parameters are 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 : Speed mode, which reads files in the execution phase and directly executes SQL statements to the specified target library. Compared with the security mode, this mode can be used to import data in a less secure but more efficient manner.
  • SAFE_MODE : Safe mode, in the precheck phase, the file will be parsed and SQL or CSV data will be cached into the warehouse, and then read out from the cache library for execution to the specified target library. 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 > When RollbackSqlType Parameters are TEXT this parameter is required.
RollbackAttachmentName String No rollback.sql

Roll back the SQL attachment key, you can call GetUserUploadFileJob The interface obtains this parameter (this parameter is the AttachmentKey parameter in the GetUserUploadFileJob interface).

Note When RollbackSqlType Parameters are 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 : Attachments
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 GetUserUploadFileJob The interface obtains the parameter.

Tid Long No 14325432

The ID of the tenant.

Note Take the tenant ID information displayed in the upper right corner of the system. For details, see View tenant information .
RegionId String No cn-hangzhou

Select the service region of DMS to call the interface. For the value, see RegionID parameter description .

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&public 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

Visit the Error Center View more error codes.