有奖捉虫:云通信与企业服务文档专题,速来> HOT

1. 接口描述

本接口(DescribeVpcPeeringConnections)用于查询私有网络对等连接
接口请求域名:vpc.api.qcloud.com

2. 输入参数

以下请求参数列表仅列出了接口请求参数,正式调用时需要加上公共请求参数,详情请参见 公共请求参数 页面。其中,此接口的 Action 字段为 DescribeVpcPeeringConnections。

参数名称 必选 类型 描述
vpcId String 发起方私有网络 ID 值,可使用 vpcId 或 unVpcId,建议使用 unVpcId,可通过 DescribeVpcEx 接口查询
peeringConnectionId string 私有网络对等连接 ID,例如:pcx-dt8c7fa0
peeringConnectionName String 对等连接名称
state Int 连接状态
0:申请中
1:连接成功
2:已过期
3:对端已拒绝
4:对端已删除
offset Int 初始行的偏移量,默认为 0
limit Int 每页行数,默认为 20,最多支持 50
orderField String 按某个字段排序,默认不排序
支持字段:peeringConnectionname,createTime。
orderDirection String 升序(asc)或降序(desc),默认:desc

3. 输出参数

参数名称 类型 描述
code String 错误码。0:成功,其他值:失败
message String 错误信息
totalCount Int 返回的对等连接数
data.n Array 对等连接信息数组
data.n.vpcId String 发起方私有网络 ID,例如:gz_vpc_245
data.n.unVpcId String uniqVpcId 的别名
data.n.peerVpcId String 接收方私有网络 ID,例如:gz_vpc_24
data.n.unPeerVpcId String uniqPeerVpcId 的别名
data.n.appId String 发起方 appId
data.n.peeringConnectionId String 对等连接ID,例如:pcx-dt8c7fa0
data.n.peeringConnectionName String 对等连接名称
data.n.state Int 连接状态
0:申请中
1:连接成功
2:已过期
3:对端已拒绝
4:对端已删除
data.n.createTime String 对等连接创建时间
data.n.uin String 您在腾讯云唯一账号标识,您可以用户中心的个人信息中查看,详情请参见 操作指南
data.n.peerUin String 接收方腾讯云唯一账号标识,您可以联系接收方去用户中心的个人信息中查看,详情请参见 操作指南
data.n.uniqVpcId String 发起方私有网络统一 ID,例如:vpc-8e0ypm3z
data.n.uniqPeerVpcId String 接收方统一私有网络 ID,例如:vpc-8e0ypm35
data.n.region String 发起方地域,例如:cd
data.n.peerRegion String 接收方地域,例如:hk

4. 错误码表

以下错误码表仅列出了该接口的业务逻辑错误码,更多公共错误码详见 VPC 错误码

错误码 描述
InvalidVpc.NotFound 无效的 vpc,vpc 资源不存在。请再次核实您输入的资源信息是否正确
InvalidPeeringConnection.NotFound 无效的对等连接,对等连接资源不存在。请再次核实您输入的资源信息是否正确

5. 示例

输入示例

https://vpc.api.qcloud.com/v2/index.php?Action=DescribeVpcPeeringConnections
&<公共请求参数>
&peeringConnectionId=pcx-dt8c7fa0

输出示例

{
    "code":"0",
    "message":"",
    "totalCount":"8",
    "data":[
        {
            "vpcId":"gz_vpc_245",
            "unVpcId":"vpc-8e0ypm3z",
            "peerVpcId":"gz_vpc_20",
            "unPeerVpcId":"vpc-kx49lmyv",
            "appId":"1351000042",
            "peeringConnectionId":"pcx-dt8c7fa0",
            "peeringConnectionName":"示例1",
            "state":1,
            "createTime":"2016-01-06 20:56:07",
            "uin":"909619400",
            "peerUin":"909619400"
        }
    ]
}