全部產品
Search
文件中心

DataWorks:ListConnections

更新時間:Jul 31, 2026

調用ListConnections查詢資料來源列表。

調試

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

調試

授權資訊

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

請求參數

名稱

類型

必填

描述

樣本值

ProjectId

integer

資料來源所在的工作空間 ID。您可以通過 ListProjects 介面取得工作空間 ID。

76086

Name

string

查詢的資料來源名稱。

abc

ConnectionType

string

連接串的類型。常用類型列舉如下:

  • odps

  • mysql

  • rds

  • oss

  • sqlserver

  • polardb

  • oracle

  • mongodb

  • emr

  • postgresql

  • analyticdb_for_mysql

  • hybriddb_for_postgresql

  • holo

rds

SubType

string

連接串的子類型,針對某些父類型 type 中包含子類型的場景。目前有以下組合:

  • 父類型:rds

  • 子類型:mysqlsqlserverpostgresql

mysql

Status

string

資料來源的狀態。

  • ENABLED 正常

  • DISABLED 禁用

1

EnvType

integer

資料來源所屬的環境,包括 0(開發環境)和 1(生產環境)。

1

PageSize

integer

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

10

PageNumber

integer

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

1

返回參數

名稱

類型

描述

樣本值

object

HttpStatusCode

integer

HTTP 狀態碼。

200

RequestId

string

請求 ID。

0bc14115159376359****

Success

boolean

請求是否成功。

true

Data

object

連接串的分頁查詢結果。

PageNumber

integer

頁碼。

1

PageSize

integer

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

20

TotalCount

integer

資料來源的總數。

3

Connections

array<object>

連接串列表。

object

Status

integer

The status of the data source. Valid values:

  • 1: The data source is normal.

  • 2: The data source is disabled.

1

ConnectionType

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

mysql

ProjectId

integer

The ID of the workspace with which the data source is associated.

123

SubType

string

The subtype of the data source. This parameter is used in scenarios where a type includes subtypes. The following type and subtypes are supported:

  • Type: rds

  • Subtypes: mysql, sqlserver, and 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 is used. Valid values:

  • 0: development environment

  • 1: production environment

1

ConnectStatus

integer

The status of the data source. Valid values:

  • 1: The data source is normal.

  • 2: The data source is disabled.

1

Sequence

integer

The field that is used to sort data sources. Data sources are sorted in descending order based on the value of this parameter.

300

Description

string

The description of the data source.

a connection

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 associated with the data source is the default compute engine used by data sources of the same type.

false

Shared

boolean

Indicates whether the data source is a shared data source.

false

Operator

string

The ID of the Alibaba Cloud account that is used to last modify the data source.

193543050****

Name

string

The name of the data source.

abc

Content

string

The details of the data source. Examples of details of some common data sources:

  • odps

{
  "accessId": "xssssss",
  "accessKey": "xsaxsaxsa",
  "authType": 2,
  "endpoint": "http://service.odps.aliyun.com/api",
  "project": "xsaxsax",
  "tag": "public"
}
  • mysql

{
  "database": "xsaxsa",
  "instanceName": "rm-xsaxsa",
  "password": "xsaxsa",
  "rdsOwnerId": "xasxsa",
  "regionId": "cn-shanghai",
  "tag": "rds",
  "username": "xsaxsa"
}
  • rds

{
  "configType": 1,
  "tag": "rds",
  "database": "xsaxsa",
  "username": "xsaxsa",
  "password": "xssaxsa$32050",
  "instanceName": "rm-xsaxs",
  "rdsOwnerId": "11111111"
}
  • oss

{
  "accessId": "sssssxx",
  "accessKey": "xsaxaxsaxs",
  "bucket": "xsa-xs-xs",
  "endpoint": "http://oss-cn-shanghai.aliyuncs.com",
  "tag": "public"
}
  • sqlserver

{
  "jdbcUrl": "jdbc:sqlserver://xsaxsa-xsaxsa.database.xxx.cn:123;DatabaseName=xsxs-xsxs",
  "password": "sdasda$fs",
  "tag": "public",
  "username": "sxaxacdacdd"
}
  • polardb

{
  "clusterId": "pc-sdadsadsa",
  "database": "dsadsadsa",
  "ownerId": "121212122",
  "password": "sdasdafssa",
  "region": "cn-shanghai",
  "tag": "polardb",
  "username": "asdadsads"
}
  • oracle

{
  "jdbcUrl": "jdbc:oracle:saaa:@xxxxx:1521:PROD",
  "password": "sxasaxsa",
  "tag": "public",
  "username": "sasfadfa"
}
  • mongodb

{
  "address": "[\"xsaxxsa.mongodb.rds.aliyuncs.com:3717\"]",
  "database": "admin",
  "password": "sadsda@",
  "tag": "public",
  "username": "dsadsadas"
}
  • emr

{
  "accessId": "xsaxsa",
  "emrClusterId": "C-dsads",
  "emrResourceQueueName": "default",
  "emrEndpoint": "emr.aliyuncs.com",
  "accessKey": "dsadsad",
  "emrUserId": "224833315798889783",
  "name": "sasdsadsa",
  "emrAccessMode": "simple",
  "region": "cn-shanghai",
  "authType": "2",
  "emrProjectId": "FP-sdadsad"
}
  • postgresql

{
  "jdbcUrl": "jdbc:postgresql://xxxx:1921/ssss",
  "password": "sdadsads",
  "tag": "public",
  "username": "sdsasda"
}
  • analyticdb_for_mysql

{
  "instanceId": "am-sadsada",
  "database": "xsxsx",
  "username": "xsxsa",
  "password": "asdadsa",
  "connectionString": "am-xssxsxs.ads.aliyuncs.com:3306"
}
  • hybriddb_for_postgresql

{
  "connectionString": "gp-xsaxsaxa-master.gpdbmaster.rds.aliyuncs.com",
  "database": "xsaxsaxas",
  "password": "xsaxsaxsa@11",
  "instanceId": "gp-xsaxsaxsa",
  "port": "541132",
  "ownerId": "xsaxsaxsas",
  "username": "sadsad"
}
  • holo

{
  "accessId": "xsaxsaxs",
  "accessKey": "xsaxsaxsa",
  "database": "xsaxsaxsa",
  "instanceId": "xsaxa",
  "tag": "aliyun"
}
  • kafka

{
  "instanceId": "xsax-cn-xsaxsa",
  "regionId": "cn-shanghai",
  "tag": "aliyun",
  "ownerId": "1212121212112"
}

{\"database\":\"xxx\",\"instanceName\":\"xxx\",\"password\":\"xxx\",\"rdsOwnerId\":\"xxx\",\"tag\":\"rds\",\"username\":\"xxx\"}

Id

integer

The data source ID.

1

BindingCalcEngineId

integer

The ID of the compute engine with which the data source is associated.

123

TenantId

integer

The tenant ID.

1234567

樣本

正常返回樣本

JSON格式

{
  "HttpStatusCode": 200,
  "RequestId": "0bc14115159376359****",
  "Success": true,
  "Data": {
    "PageNumber": 1,
    "PageSize": 20,
    "TotalCount": 3,
    "Connections": [
      {
        "Status": 1,
        "ConnectionType": "mysql",
        "ProjectId": 123,
        "SubType": "mysql",
        "GmtModified": "Mar 17, 2021 4:09:32 PM",
        "EnvType": 1,
        "ConnectStatus": 1,
        "Sequence": 300,
        "Description": "a connection",
        "GmtCreate": "Mar 17, 2021 4:09:32 PM",
        "DefaultEngine": false,
        "Shared": false,
        "Operator": "193543050****",
        "Name": "abc",
        "Content": "{\\\"database\\\":\\\"xxx\\\",\\\"instanceName\\\":\\\"xxx\\\",\\\"password\\\":\\\"xxx\\\",\\\"rdsOwnerId\\\":\\\"xxx\\\",\\\"tag\\\":\\\"rds\\\",\\\"username\\\":\\\"xxx\\\"}",
        "Id": 1,
        "BindingCalcEngineId": 123,
        "TenantId": 1234567
      }
    ]
  }
}

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 Invalid.Tenant.ConnectionNotExists The connection does not exist.
400 Invalid.Tenant.ProjectNotExists The project does not exist.
400 Invalid.Tenant.UserNotInProject The user is not in the project.
403 Invalid.Tenant.UserIsNotProjectOwnerOrAdmin The user is not a project administrator or owner.
403 Invalid.Tenant.UserNotInTenant The user is not in tenant.

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

變更歷史

更多資訊,參考變更詳情