ImportDataSources

Updated at:

Imports local data sources to a destination DataWorks workspace in batches.

Operation description

You can import self-managed local data sources or data sources exported from other workspaces to a destination DataWorks workspace.

  • The type of your self-managed local data sources must be supported by DataWorks. For more information about the data source types supported by DataWorks, see Data sources supported by DataWorks.

  • For more information about how to export data sources from other workspaces to your local machine, see the ExportDataSources operation.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

ProjectId

integer

Yes

The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Management page to obtain the workspace ID.

10000

DataSources

string

Yes

The array of data source configurations to be imported. The Name, DataSourceType, SubType, Description, Content, and EnvType parameters are required. For more information about the parameters, see the CreateDataSource operation.

[{"SubType":"","DataSourceType":"mysql","EnvType":1,"Name":"mysql_dms2","Description":"aaa","Content":"{\"database\":\"mysql_chengdu_old\",\"password\":\"***\",\"instanceName\":\"rm-2vcrckb37163g7l3w\",\"regionId\":\"cn-chengdu\",\"tag\":\"rds\",\"rdsOwnerId\":\"333\",\"username\":\"mysql_chengdu2\"}"},{"SubType":"","DataSourceType":"mysql","EnvType":1,"Name":"mysql_dms2","Description":"aaa","Content":"{\"database\":\"mysql_chengdu_old\",\"password\":\"***\",\"instanceName\":\"rm-2vcrckb37163g7l3w\",\"regionId\":\"cn-chengdu\",\"tag\":\"rds\",\"rdsOwnerId\":\"143\",\"username\":\"mysql_chengdu2\"}"}]

Response elements

Element

Type

Description

Example

object

Success

boolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.

  • false: The request fails.

true

RequestId

string

The ID of the request. You can use the ID to locate logs and troubleshoot issues.

0bc1411515937635973****

Data

object

The result of importing data sources in batches.

Status

boolean

Indicates whether all data sources are successfully imported. Valid values:

  • true: All data sources are successfully imported.

  • false: Some data sources fail to be imported. You can check the Message parameter to locate the cause of the failure.

true

Message

string

The description of the cause for the failure to import data sources in batches. If the data sources are successfully imported, this parameter is left empty.

Data source DEV XXX already exists

Examples

Success response

JSON format

{
  "Success": true,
  "RequestId": "0bc1411515937635973****",
  "Data": {
    "Status": true,
    "Message": " Data source DEV XXX already exists"
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 Invalid.DI.Parameter The parameter is invalid. The parameter is invalid.
500 InternalError.DI.Parameter A DI internal error occurred. A Data Integration internal business error occurred.
403 Forbidden.DI.NoPrivilege No access. Access denied.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.