Imports data sources from your on-premises machine to a specific DataWorks workspace.
Operation description
You can import self-managed data sources or data sources that are exported from other DataWorks workspaces to a specific DataWorks workspace.
-
To import a self-managed data source to a DataWorks workspace, the data source type must be supported by DataWorks. For more information about the types of data sources supported by DataWorks, see Supported data stores.
-
For more information about how to export data sources from DataWorks workspaces to your on-premises machine, see ExportDataSources.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ProjectId |
integer |
Yes |
The DataWorks workspace ID. You can log on to the DataWorks console and go to the Workspace page to obtain the ID. |
10000 |
| DataSources |
string |
Yes |
The configurations of the data sources that you want to import. The Name, DataSourceType, SubType, Description, Content, and EnvType parameters are required. For more information about the parameters, see CreateDataSource. |
[{"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 was successful. Valid values:
|
true |
| RequestId |
string |
The request ID. You can locate logs and troubleshoot issues based on the ID. |
0bc1411515937635973**** |
| Data |
object |
The information about the imported data sources. |
|
| Status |
boolean |
Indicates whether the data sources were imported. Valid values:
|
true |
| Message |
string |
The reason why the data sources failed to be imported. If the data sources were 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. | |
| 500 | InternalError.DI.Parameter | A DI internal error occurred. | |
| 403 | Forbidden.DI.NoPrivilege | No access. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.