全部產品
Search
文件中心

DataWorks:ExportDataSources

更新時間:Jul 31, 2026

匯出資料來源清單。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

當前API暫無授權資訊透出。

請求參數

名稱

類型

必填

描述

樣本值

ProjectId

integer

目標資料來源所在的 DataWorks 工作空間 ID。您可以呼叫 ListProjects 介面取得工作空間 ID。

10000

Name

string

待匯出的目標資料來源名稱所包含的關鍵字。 目前僅支援設定一個關鍵字。例如,該參數設定為 test(即待匯出的目標資料來源名稱所包含的關鍵字為 test),則呼叫 ExportDataSources 介面會匯出目標工作空間中所有名稱包含 test 的資料來源。

test

DataSourceType

string

目標資料來源的類型。常用的類型如下:

  • odps

  • mysql

  • rds

  • oss

  • sqlserver

  • polardb

  • oracle

  • mongodb

  • emr

  • postgresql

  • analyticdb_for_mysql

  • hybriddb_for_postgresql

  • holo

rds

SubType

string

目標資料來源的子類型。僅當 DataSourceType 參數設定為 RDS 時,該參數生效。

當 DataSourceType 參數設定為 RDS 時,該參數可以設定為 mysql、sqlserver 或 postgresql。

mysql

EnvType

integer

目標資料來源所屬的環境。取值如下:

  • 0:開發環境。

  • 1:生產環境。

1

PageSize

integer

每頁顯示的筆數,預設為 10 筆,最大為 100 筆。

10

PageNumber

integer

分頁查詢的頁碼。取值為大於等於 1 的正整數。

1

返回參數

名稱

類型

描述

樣本值

object

HttpStatusCode

integer

此次呼叫的回傳結果狀態。取值如下:

  • 200:表示此次呼叫的回傳結果成功。

  • 其他值:表示此次呼叫的回傳結果異常。您可以根據對應錯誤碼處理相關異常。

200

RequestId

string

請求 ID。用於定位日誌,排查問題。

0bc14115159376359****

Success

boolean

請求是否成功。取值如下:

  • true:成功。

  • false:失敗。

true

Data

object

批次匯出資料來源的回傳結果。

PageNumber

integer

分頁查詢的頁碼。取值為大於等於 1 的正整數。

10

PageSize

integer

每頁顯示的資料筆數。

1

TotalCount

integer

回傳符合條件的資料來源總筆數。

100

DataSources

array<object>

批次匯出的資料來源的詳細資訊。 此次呼叫的回傳結果為匯出資料來源的詳細資訊陣列,如下資訊為陣列中的一個資料來源的詳細資訊範例。

object

Status

integer

Indicates whether the data source is available. Valid values:

  • 1: The data source is available.

  • 0: The data source is unavailable.

1

ProjectId

integer

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

123

SubType

string

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

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

mysql

GmtModified

string

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

Mar 17, 2021 4:09:32 PM

EnvType

integer

The environment in which the data source resides. Valid values:

  • 0: development environment

  • 1: production environment

1

ConnectStatus

integer

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.

1

Sequence

integer

The sequence number of the data source.

300

Description

string

The description of the data source.

a connection

DataSourceType

string

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

rds

GmtCreate

string

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

Mar 17, 2021 4:09:32 PM

DefaultEngine

boolean

Indicates whether the compute engine that is added as the data source 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.

false

Shared

boolean

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

  • true: The data source can be shared.

  • false: The data source cannot be shared.

false

Operator

string

The ID of the user who exported the data source.

193543050****

Name

string

The name of the data source.

abc

Content

string

The configuration of the data source.

{"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"}

Id

integer

The data source ID.

1

BindingCalcEngineId

integer

The ID of the compute engine that is added as the data source.

123

TenantId

integer

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

1234567

樣本

正常返回樣本

JSON格式

{
  "HttpStatusCode": 200,
  "RequestId": "0bc14115159376359****",
  "Success": true,
  "Data": {
    "PageNumber": 10,
    "PageSize": 1,
    "TotalCount": 100,
    "DataSources": [
      {
        "Status": 1,
        "ProjectId": 123,
        "SubType": "mysql",
        "GmtModified": "Mar 17, 2021 4:09:32 PM",
        "EnvType": 1,
        "ConnectStatus": 1,
        "Sequence": 300,
        "Description": "a connection",
        "DataSourceType": "rds",
        "GmtCreate": "Mar 17, 2021 4:09:32 PM",
        "DefaultEngine": false,
        "Shared": false,
        "Operator": "193543050****",
        "Name": "abc",
        "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\"}",
        "Id": 1,
        "BindingCalcEngineId": 123,
        "TenantId": 1234567
      }
    ]
  }
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

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

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情