Exports one or more specified data sources from a DataWorks workspace to an on-premises device.

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 ExportDataSources

The operation that you want to perform.

Name String Yes test

The keyword contained in the names of the data sources to be exported.

You can specify only one keyword. For example, if you set this parameter to test, all the data sources whose names contain test in the specified workspace are exported.

ProjectId Long Yes 10000

The ID of the DataWorks workspace to which the data sources belong. You can call the ListProjects operation to query the ID of the workspace.

RegionId String Yes cn-shanghai

The ID of the region in which the data sources reside. For example, the ID of the China (Shanghai) region is cn-shanghai, and that of the China (Zhangjiakou) region is cn-zhangjiakou. The system automatically determines the value of this parameter based on the endpoint used to call the operation.

DataSourceType String No rds

The data source type. Valid values:

  • odps
  • mysql
  • rds
  • oss
  • sqlserver
  • polardb
  • oracle
  • mongodb
  • emr
  • postgresql
  • analyticdb_for_mysql
  • hybriddb_for_postgresql
  • holo
SubType String No mysql

The data source subtype. This parameter takes effect only if the DataSourceType parameter is set to rds.

If the DataSourceType parameter is set to rds, this parameter can be set to mysql, sqlserver, or postgresql.

EnvType Integer No 1

The environment to which the data sources belong. Valid values:

  • 0: development environment
  • 1: production environment
PageSize Integer No 10

The number of entries to return on each page. Default value: 10. Maximum value: 100.

PageNumber Integer No 1

The number of the page to return. The value of this parameter must be a positive integer greater than or equal to 1.

Response parameters

Parameter Type Example Description
Data Struct

The information about the export operation.

DataSources Array of DataSources

The details of the exported data sources.

The value is an array. The following parameters are the elements in the array. The sample values of these parameters show the details of a sample data source.

BindingCalcEngineId Integer 123

The ID of the compute engine to which the data source is bound.

ConnectStatus Integer 1

Indicates whether the data source is connected to an exclusive resource group. Valid values:

  • 1: The data source is connected to at least one exclusive resource group.
  • 0: The data source is not connected to any exclusive resource group.
Content String {"pubEndpoint":"http://service.cn.maxcompute.aliyun.com/api","accessId":"TMP.3KecGjvzy3i8MYfn2BGHgF7EHGyBFZcHm7GgngrABVRyvvKQrfF5kskR36xP361C3dqwbGo7SGYptAeGyiTwHXqLaBUvYC","securityToken":null,"endpoint":"http://service.cn.maxcompute.aliyun-inc.com/api","accessKey":"***","name":"PRE_PROJECT_A_engine","project":"PRE_PROJECT_A","vpcEndpoint":"http://service.cn.maxcompute.aliyun-inc.com/api","region":"cn-shanghai","authType":"2"}

The configuration of the data source.

DataSourceType String rds

The type of the data source. Valid values:

  • odps
  • mysql
  • rds
  • oss
  • sqlserver
  • polardb
  • oracle
  • mongodb
  • emr
  • postgresql
  • analyticdb_for_mysql
  • hybriddb_for_postgresql
  • holo
DefaultEngine Boolean false

Indicates whether the compute engine to which the data source is bound is the default compute engine. Valid values:

  • true: The compute engine is the default compute engine.
  • false: The compute engine is not the default compute engine.
Description String a connection

The description of the data source.

EnvType Integer 1

The environment to which the data source belongs. Valid values:

  • 0: development environment
  • 1: production environment
GmtCreate String Mar 17, 2021 4:09:32 PM

The time when the data source was created. Example: Mar 17, 2021 4:09:32 PM.

GmtModified String Mar 17, 2021 4:09:32 PM

The time when the data source was last modified. Example: Mar 17, 2021 4:09:32 PM.

Id Integer 1

The ID of the data source.

Name String abc

The name of the data source.

Operator String 193543050****

The ID of the user who exported the data source.

ProjectId Integer 123

The ID of the DataWorks workspace to which the data source belongs.

Sequence Integer 300

The sequence number of the data source.

Shared Boolean false

Indicates whether the data source can be shared. Valid values:

  • true: The data source can be shared.
  • false: The data source cannot be shared.
Status Integer 1

Indicates whether the data source is available. Valid values:

  • 1: The data source is available.
  • 0: The data source is unavailable.
SubType String mysql

The subtype of the data source. This parameter is returned only if the value of the DataSourceType parameter is rds.

If the value of the DataSourceType parameter is rds, the value of this parameter can be mysql, sqlserver, or postgresql.

TenantId Long 1234567

The ID of the Alibaba Cloud account to which the data source belongs.

PageNumber Integer 10

The page number of the returned page. The value of this parameter is a positive integer greater than or equal to 1.

PageSize Integer 1

The number of entries returned on each page.

TotalCount Integer 100

The total number of entries returned.

HttpStatusCode Integer 200

The HTTP status code returned. Valid values:

  • 200: The request was successful.
  • Other values: The request failed. You can troubleshoot issues based on the HTTP status code returned.
RequestId String 0bc14115159376359****

The ID of the request. You can locate logs and troubleshoot issues based on the ID.

Success Boolean true

Indicates whether the request was successful. Valid values:

  • true: The request was successful.
  • false: The request failed.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ExportDataSources
&Name=test
&ProjectId=10000
&RegionId=cn-shanghai
&<Common request parameters>

Sample success responses

XML format

<RequestId>0bc14115159376359****</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>
    <TotalCount>100</TotalCount>
    <PageSize>1</PageSize>
    <PageNumber>10</PageNumber>
    <DataSources>
        <Status>1</Status>
        <Operator>193543050****</Operator>
        <ConnectStatus>1</ConnectStatus>
        <SubType>mysql</SubType>
        <Description>a connection</Description>
        <BindingCalcEngineId>123</BindingCalcEngineId>
        <ProjectId>123</ProjectId>
        <GmtModified>Mar 17, 2021 4:09:32 PM</GmtModified>
        <Sequence>300</Sequence>
        <Shared>false</Shared>
        <EnvType>1</EnvType>
        <Name>abc</Name>
        <DefaultEngine>false</DefaultEngine>
        <TenantId>1234567</TenantId>
        <GmtCreate>Mar 17, 2021 4:09:32 PM</GmtCreate>
        <Content>{"pubEndpoint":"http://service.cn.maxcompute.aliyun.com/api","accessId":"TMP.3KecGjvzy3i8MYfn2BGHgF7EHGyBFZcHm7GgngrABVRyvvKQrfF5kskR36xP361C3dqwbGo7SGYptAeGyiTwHXqLaBUvYC","securityToken":null,"endpoint":"http://service.cn.maxcompute.aliyun-inc.com/api","accessKey":"***","name":"PRE_PROJECT_A_engine","project":"PRE_PROJECT_A","vpcEndpoint":"http://service.cn.maxcompute.aliyun-inc.com/api","region":"cn-shanghai","authType":"2"}</Content>
        <DataSourceType>rds</DataSourceType>
        <Id>1</Id>
    </DataSources>
</Data>
<Success>true</Success>

JSON format

{
    "RequestId": "0bc14115159376359****",
    "HttpStatusCode": 200,
    "Data": {
        "TotalCount": 100,
        "PageSize": 1,
        "PageNumber": 10,
        "DataSources": {
            "Status": 1,
            "Operator": "193543050****",
            "ConnectStatus": 1,
            "SubType": "mysql",
            "Description": "a connection",
            "BindingCalcEngineId": 123,
            "ProjectId": 123,
            "GmtModified": "Mar 17, 2021 4:09:32 PM",
            "Sequence": 300,
            "Shared": false,
            "EnvType": 1,
            "Name": "abc",
            "DefaultEngine": false,
            "TenantId": 1234567,
            "GmtCreate": "Mar 17, 2021 4:09:32 PM",
            "Content": "{\"pubEndpoint\":\"http://service.cn.maxcompute.aliyun.com/api\",\"accessId\":\"TMP.3KecGjvzy3i8MYfn2BGHgF7EHGyBFZcHm7GgngrABVRyvvKQrfF5kskR36xP361C3dqwbGo7SGYptAeGyiTwHXqLaBUvYC\",\"securityToken\":null,\"endpoint\":\"http://service.cn.maxcompute.aliyun-inc.com/api\",\"accessKey\":\"***\",\"name\":\"PRE_PROJECT_A_engine\",\"project\":\"PRE_PROJECT_A\",\"vpcEndpoint\":\"http://service.cn.maxcompute.aliyun-inc.com/api\",\"region\":\"cn-shanghai\",\"authType\":\"2\"}",
            "DataSourceType": "rds",
            "Id": 1
        }
    },
    "Success": true
}

Error codes

Http status code Error code Error message Description
403 Forbidden.DI.NoPrivilege No access. The error message returned because you do not have the required permissions.
500 InternalError.DI.Parameter A DI internal error occurred. The error message returned because an internal error in Data Integration occurred.
400 Invalid.DI.Parameter The parameter is invalid. The error code returned because one or more parameters are invalid.

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