Query Peering Connections

Last updated: 2020-06-04 17:30:17

    Note:

    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new VPC API 3.0 which is standardized and faster.

    1. API Description

    This API (DescribeVpcPeeringConnections) is used to query VPC peering connection.
    Domain for API request: vpc.api.qcloud.com

    2. Input Parameters

    The following request parameter list only provides API request parameters. Common request parameters need to be added when the API is called. For more information, refer to Common Request Parameters. The Action field for this API is DescribeVpcPeeringConnections.

    Parameter Name Required Type Description
    vpcId No String Initiator's VPC ID, which can be vpcId or unVpcId. unVpcId is recommended. It can be queried through API DescribeVpcEx.
    peeringConnectionId No string ID of VPC peering connection, e.g. pcx-dt8c7fa0.
    peeringConnectionName No String Peering connection name.
    state No Int Connection status
    0: Requesting; 1: Connected; 2: Expired; 3: Rejected; 4: Deleted.
    offset No Int Offset of initial line. Default is 0.
    limit No Int Number of lines per page. Default is 20. A maximum of 50 is allowed.
    orderField No String Sort by a certain field. No sorting by default.
    Available fields: peeringConnectionname, createTime.
    orderDirection No String Ascending order (asc) or descending order (desc). Default is desc.

    3. Output Parameters

    Parameter Name Type Description
    code Int Error code. 0: Succeeded; other values: Failed.
    message String Error message
    totalCount Int Returned number of peering connections
    data.n Array Peering connection information array
    data.n.vpcId String Initiator's VPC ID, e.g. gz_vpc_245
    data.n.unVpcId String Unified ID of initiator's VPC, e.g. vpc-8e0ypm3z
    data.n.peerVpcId String ID of receiver's VPC, e.g. gz_vpc_24
    data.n.unPeerVpcId String Unified ID of receiver's VPC, e.g. vpc-8e0ypm35
    data.n.appId String Initiator's appId
    data.n.peeringConnectionId String Peering connection ID, e.g. pcx-dt8c7fa0
    data.n.peeringConnectionName String Peering connection name
    data.n.state Int Connection status
    0: Requesting; 1: Connected; 2: Expired; 3: Rejected; 4: Deleted
    data.n.createTime String Creation time of peering connection
    data.n.uin String Your unique account ID on Tencent Cloud. You can check this on Tencent Cloud User Center. Learn more.
    data.n.peerUin String Receiver's unique account ID on Tencent Cloud. The receivers can check this by themselves on Tencent Cloud User Center. Learn more.

    4. Error Codes

    The following error code list only provides the business logic error codes for this API. For additional common error codes, refer to VPC Error Codes.

    Error Code Description
    InvalidVpc.NotFound VPC does not exist. Please check the information you entered.
    InvalidPeeringConnection.NotFound Peering connection does not exist. Please check the information you entered.

    5. Example

    Input

    https://vpc.api.qcloud.com/v2/index.php?Action=DescribeVpcPeeringConnections
    &>
    &peeringConnectionId=pcx-dt8c7fa0
    

    Output

    {
        "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":"Example 1",
                "state":"1",
                "createTime":"2016-01-06 20:56:07",
                "uin":"909619400",
                "peerUin":"909619400"
            }
        ]
    }

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help