调用ListConnections查询数据源列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | ListConnections |
要执行的操作。 |
Name | String | 是 | abc |
查询的数据源名称。 |
ProjectId | Long | 是 | 76086 |
数据源所在的工作空间名称。 |
RegionId | String | 是 | cn-shanghai |
数据源所在的地域ID。 |
ConnectionType | String | 否 | rds |
连接串的类型。 |
SubType | String | 否 | mysql |
连接串的子类型。 |
Status | String | 否 | 1 |
数据源的状态。 |
EnvType | Integer | 否 | 1 |
数据源所在工作空间的类型。 |
PageSize | Integer | 否 | 10 |
每页显示的条数,默认为10条,最大100条。 |
PageNumber | Integer | 否 | 1 |
分页查询页码。 |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Data | Struct |
连接串的分页查询结果。 |
|
Connections | Array of Connections |
连接串列表。 |
|
BindingCalcEngineId | Integer | 123 |
数据源关联的计算引擎ID。 |
ConnectStatus | Integer | 1 |
数据源的状态。 |
ConnectionType | String | mysql |
数据源的类型。 |
Content | String | {\"database\":\"xxx\",\"instanceName\":\"xxx\",\"password\":\"xxx\",\"rdsOwnerId\":\"xxx\",\"tag\":\"rds\",\"username\":\"xxx\"} |
数据源的详细信息。 |
DefaultEngine | Boolean | false |
数据源关联的引擎是否为同类型下的默认引擎。 |
Description | String | a connection |
描述数据源。 |
EnvType | Integer | 1 |
数据源所在的环境。 |
GmtCreate | String | Oct 10, 2019 3:42:53 PM |
创建数据源的时间。 |
GmtModified | String | Oct 10, 2019 3:42:53 PM |
修改数据源的时间。 |
Id | Integer | 1 |
数据源ID。 |
Name | String | abc |
数据源的名称。 |
Operator | String | 193543050**** |
数据源最后操作人的阿里云ID。 |
ProjectId | Integer | 123 |
数据源关联的工作空间ID。 |
Sequence | Integer | 300 |
排序字段。 |
Shared | Boolean | false |
是否为共享的数据源。 |
Status | Integer | 1 |
数据源的状态。 |
SubType | String | mysql |
数据源的子类型。 |
TenantId | Long | 1234567 |
租户ID。 |
PageNumber | Integer | 1 |
页码。 |
PageSize | Integer | 20 |
每页显示的条数,默认为10条,最大100条。 |
TotalCount | Integer | 3 |
数据源的总数。 |
HttpStatusCode | Integer | 200 |
HTTP状态码。 |
RequestId | String | 0bc14115159376359**** |
请求ID。 |
Success | Boolean | true |
请求是否成功。 |
示例
请求示例
http(s)://[Endpoint]/?Action=ListConnections
&Name=abc
&ProjectId=76086
&RegionId=cn-shanghai
&<公共请求参数>
正常返回示例
XML
格式
<RequestId>0bc14115159****</RequestId>
<HttpStatusCode>200</HttpStatusCode>
<Data>
<Connections>
<Operator>193543050****</Operator>
<Status>1</Status>
<ConnectStatus>1</ConnectStatus>
<Description>a connection</Description>
<SubType>mysql</SubType>
<BindingCalcEngineId>123</BindingCalcEngineId>
<ConnectionType>mysql</ConnectionType>
<GmtModified>Oct 10, 2019 3:42:53 PM</GmtModified>
<ProjectId>123</ProjectId>
<Sequence>300</Sequence>
<Shared>false</Shared>
<EnvType>1</EnvType>
<DefaultEngine>false</DefaultEngine>
<Name>abc</Name>
<GmtCreate>Oct 10, 2019 3:42:53 PM</GmtCreate>
<TenantId>1234567</TenantId>
<Content>{\"database\":\"xxx\",\"instanceName\":\"xxx\",\"password\":\"xxx\",\"rdsOwnerId\":\"xxx\",\"tag\":\"rds\",\"username\":\"xxx\"}</Content>
<Id>1</Id>
</Connections>
<TotalCount>3</TotalCount>
<PageSize>20</PageSize>
<PageNumber>1</PageNumber>
</Data>
<Success>true</Success>
JSON
格式
{
"RequestId": "0bc14115159****",
"HttpStatusCode": 200,
"Data": {
"Connections": {
"Operator": "193543050****",
"Status": 1,
"ConnectStatus": 1,
"Description": "a connection",
"SubType": "mysql",
"BindingCalcEngineId": 123,
"ConnectionType": "mysql",
"GmtModified": "Oct 10, 2019 3:42:53 PM",
"ProjectId": 123,
"Sequence": 300,
"Shared": false,
"EnvType": 1,
"DefaultEngine": false,
"Name": "abc",
"GmtCreate": "Oct 10, 2019 3:42:53 PM",
"TenantId": 1234567,
"Content": "{\\\"database\\\":\\\"xxx\\\",\\\"instanceName\\\":\\\"xxx\\\",\\\"password\\\":\\\"xxx\\\",\\\"rdsOwnerId\\\":\\\"xxx\\\",\\\"tag\\\":\\\"rds\\\",\\\"username\\\":\\\"xxx\\\"}",
"Id": 1
},
"TotalCount": 3,
"PageSize": 20,
"PageNumber": 1
},
"Success": true
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | Invalid.Tenant.ConnectionNotExists | The connection does not exist. | 数据源不存在。 |
400 | Invalid.Tenant.ProjectNotExists | The project does not exist. | 项目不存在。 |
403 | Invalid.Tenant.UserIsNotProjectOwnerOrAdmin | The user is not a project administrator or owner. | 用户不是项目负责人或者项目管理员。 |
400 | Invalid.Tenant.UserNotInProject | The user is not in the project. | 用户不在项目中。 |
403 | Invalid.Tenant.UserNotInTenant | The user is not in tenant. | 用户不在租户中。 |
访问错误中心查看更多错误码。
在文档使用中是否遇到以下问题
更多建议
匿名提交