All Products
Search
Document Center

Data Management:CreateDataImportOrder

Last Updated:Nov 28, 2024

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

Operation description

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

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
dms:CreateDataImportOrdercreate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
CommentstringYes

The purpose or objective of the data import. This parameter is used to help reduce unnecessary communication.

test
RelatedUserListarrayNo

The stakeholders of the data import. 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.

longNo
51****
ParamobjectYes

The parameters of the ticket.

ClassifystringNo

The reason for the data import.

test
AttachmentNamestringYes

The key of the attachment that contains the SQL statements used to import data. You can call the GetUserUploadFileJob operation to the attachment key from the value of the AttachmentKey parameter.

order_text
DbItemListarray<object>Yes

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

objectNo
DbIdlongYes

The ID of the database. The database can be a physical database or a logical database.

1860****
LogicbooleanYes

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

  • true: The database is a logical database.
  • false: The database is a physical database.
Note If you set this parameter to true, the database that you specify must be a logical database.
false
FileTypestringYes

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

  • SQL: an SQL file
  • CSV: a CSV file
CSV
FileEncodingstringNo

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
AUTO
TableNamestringNo

The destination table to which you want to import the data in the CSV format.

Note This parameter is required if you set the FileType parameter to CSV.
Table_text
InsertTypestringNo

The mode in which the data in the CSV format is to be written to the destination table. Valid values:

  • INSERT: The database checks the primary key when data is written. If a duplicate primary key value exists, an error message is returned.
  • INSERT_IGNORE: If the imported data contains data records that are the same as those in the destination table, the new data records are ignored.
  • REPLACE_INTO: If the imported data contains a row that has the same value for the primary key or unique index as one row in the destination table, the database deletes the existing row and inserts the new row into the destination table.
Note This parameter is required if you set the FileType parameter to CSV.
INSERT
CsvFirstRowIsColumnDefbooleanNo

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 This parameter is required if you set the FileType parameter to CSV.
true
IgnoreErrorbooleanNo

Specifies whether to skip an error that occurs. Valid values:

  • true: skips the error and continues to execute SQL statements.
  • false: stops executing SQL statements.
false
ImportModestringNo

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 security 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. This mode can be used to import data in a more secure but less efficient manner.
FAST_MODE
RollbackSQLstringNo

The SQL statements used to roll back the data import.

Note This parameter is required if you set the RollbackSqlType parameter to TEXT.
empty
RollbackAttachmentNamestringNo

The key of the attachment that contains the SQL statements used to roll back the data import. You can call the GetUserUploadFileJob operation to obtain the attachment key from the value of the AttachmentKey parameter.

Note This parameter is required if you set the RollbackSqlType parameter to ATTACHMENT.
rollback.sql
RollbackSqlTypestringNo

The format of the SQL statements used to roll back the data import. Valid values:

  • TEXT: text
  • ATTACHMENT: attachment
TEXT
AttachmentKeystringNo

The key of the attachment that provides more instructions for the ticket. You can call the GetUserUploadFileJob operation to obtain the attachment key from the value of the AttachmentKey parameter.

order_attachment.txt
TidlongNo

The ID of the tenant. You can call the GetUserActiveTenant or ListUserTenants operation to obtain the tenant ID.

3***

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The ID of the request.

0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931
Successboolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request fails.
true
ErrorMessagestring

The error message returned if the request fails.

UnknownError
ErrorCodestring

The error code returned if the request fails.

UnknownError
CreateOrderResultarray

The ID of the ticket.

OrderIdslong
1****

Examples

Sample success responses

JSONformat

{
  "RequestId": "0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931",
  "Success": true,
  "ErrorMessage": "UnknownError",
  "ErrorCode": "UnknownError",
  "CreateOrderResult": [
    0
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history