• 文档
  • 控制台
  • 登录
  • 立即注册
    目前不支持用户自主注册,如需注册账号,请联系400-080-1100
专有网络VPC API参考手册
最近更新时间:2023-04-16 17:00:00

8 对等连接

8.1 CreatePeer

调用 CreatePeering 接口创建一个对等连接。

8.1.1 使用说明

POST http://{endpoint}/vpc/v1.0/peerings

同租户下,新创建的对等连接处于已接受状态。

跨租户下,新创建的对等连接处于待接受状态。

8.1.2 请求参数

1.png

8.1.3 返回数据

1.png

2.png

8.1.4 示例

1. 请求示例

POST http://{endpoint}/vpc/v1.0/peerings

    “AcceptTenantId":"220008021600300",

            "PeerName":"ppppppp",

         "RequestVpcID":"vpc-6w4wvsluu4",

         "AcceptVpcID":"vpc-k9gfx47rtv",

         "Description":"not https",

         "RegionId":"123 "

}

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

        "RequestId": "7b2852f1ec9bb6d567c9b18d6bfdc547",

             "PeerId": "peer-sltxtpgb9j",

             "PeerStatus": 1,

             "RequestName": "pppp",

             "AcceptName": "pppp",

             "RequestDescription": "",

             "AcceptDescription": "",

             "RequestTenantId": "220008042500400",

             "AcceptTenantId": "220008021600300",

             132

             "RequestVpcId": "vpc-6w4wvsluu4",

             "AcceptVpcId": "vpc-k9gfx47rtv",

             "RequestVpcName": "cecloud-vpc-22264",

             "AcceptVpcName": "cecloud-vpc-0922",

             "RequestVpcCidr": "172.16.0.0/12",

             "AcceptVpcCidr": "10.0.0.0/8",

             "RequestRegion": "hanmei03",

             "AcceptRegion": "hanmei03",

             "ConfirmTime": "0001-01-01 00:00:00",

             "CreatedAt": "2022-10-18 14:43:31",

             "UpdatedAt": "2022-10-18 14:43:31" 

}


8.2 DeletePeering

调用 DeletePeering 接口删除一个对等连接。

8.2.1 使用说明

DELETE http://{endpoint}/vpc/v1.0/peerings/{peerId}

8.2.2 请求参数

1.png

8.2.3 返回数据

2.png

8.2.4 示例

1. 请求示例

DELETE http://{endpoint}/vpc/v1.0/peerings/{peerId}

133

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

    "RequestId": "7b2852f1ec9bb6d567c9b18d6bfdc547"

}


8.3 ModifyPeering

调用 ModifyPeering 接口修改对等连接名称或者描述。

8.3.1 使用说明

PUT http://{endpoint}/vpc/v1.0/peerings/{peerId}

只有已被接受的对等连接才能修改。


8.3.2 请求参数

1.png

8.3.3 返回数据

1.png

2.png

3.png

8.3.4 示例

1. 请求示例

PUT http://{endpoint}/vpc/v1.0/peerings/{peerId}

{

    "PeerName":"~~~~(~~",

        "Remark":"httpss://"

}

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

    "RequestId": "625441e37aab4f718aba58ad904ac843",

         "PeerId": "peer-2zuyjf1q9b",

         "PeerStatus": 2,

         "RequestName": "~~~~(~~",

         "AcceptName": "~~~~(~~",

         "RequestDescription": "httpss://",

         "AcceptDescription": "httpss://",

         "RequestTenantId": "220008021600300",

         "AcceptTenantId": "220008021600300",

         "RequestVpcId": "vpc-l64e8r8ovg",

         "AcceptVpcId": "vpc-42wlbvi1oz",

         "RequestVpcName": "cecloud-vpc-123",

         "AcceptVpcName": "cecloud-vpc-456",

         "RequestVpcCidr": "192.168.0.0/16",

         "AcceptVpcCidr": "10.0.0.0/8",

         "RequestRegion": "hanmei03",

         "AcceptRegion": "hanmei03",

         "ConfirmTime": "2022-08-19 09:23:57",

         "CreatedAt": "2022-08-19 09:23:57",

         "UpdatedAt": "2022-10-18 15:06:39"

}

8.4 GetPeeringDetail

调用 GetPeeringDetail 接口查看对等连接详情。

8.4.1 使用说明

GET http://{endpoint}/vpc/v1.0/peerings/{peerId}

8.4.2 请求参数

1.png

8.4.3 返回数据

2.png

3.png

8.4.4 示例

1. 请求示例

GET http://{endpoint}/vpc/v1.0/peerings/{peerId}

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

     "RequestId": "5518da990f7dc8887e8724a628162be1",

         "IsRequest": false,

         "PeerId": "peer-t23ct6xbyi",

         "PeerStatus": 2,

         "RequestName": "ppppppp",

         "AcceptName": "ppppppp",

         "RequestDescription": "",

         "AcceptDescription": "",

         "RequestTenantId": "220008042500400",

         "AcceptTenantId": "220008021600300",

         "RequestVpcId": "vpc-sw022cpllh",

         "AcceptVpcId": "vpc-yopg5ux5mb",

         "RequestVpcName": "cecloud-vpc-98796",

         "AcceptVpcName": "vpc",

         "RequestVpcCidr": "192.168.0.0/16",

         "AcceptVpcCidr": "10.0.0.0/8",

         "RequestRegion": "hanmei03",

         "AcceptRegion": "hanmei03",

         "ConfirmTime": "2022-10-17 16:47:10",

         "CreatedAt": "2022-10-13 16:44:41",

         "UpdatedAt": "2022-10-17 16:47:10"

}

8.5 GetPeeringList

调用 GetPeeringList 接口查看对等连接列表详情。

8.5.1 使用说明

GET http://{endpoint}/vpc/v1.0/peerings

8.5.2 请求参数

1.png

2.png

8.5.3 返回数据

1.png

表8-1 Peer Object 表

1.png

2.png

3.png

4.png

8.5.4 示例

1. 请求示例

GET http://{endpoint}/vpc/v1.0/peerings

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

"RequestId": "f99ea01b42f06758a937c5e61e8af3c4",

         "TotalCount": 1,

         "PageSize": 10,

         "PageNumber": 1,

         "Peers": [

            {

                     "IsRequest": true,

                     "PeerId": "peer-2zuyjf1q9b",

                     "PeerStatus": 2, 

                     "RequestName": "~~~~(~~",

                     "AcceptName": "~~~~(~~",

                     "RequestDescription": "httpss://",

                     "AcceptDescription": "httpss://",

                     "RequestTenantId": "220008021600300",

                     "AcceptTenantId": "220008021600300",

                     "RequestVpcId": "vpc-l64e8r8ovg",

                     "AcceptVpcId": "vpc-42wlbvi1oz",

                     "RequestVpcName": "vpc-192",

                     "AcceptVpcName": "vpc-172",

                     "RequestVpcCidr": "192.168.0.0/16",

                     "AcceptVpcCidr": "172.16.0.0/12",

                     "RequestRegion": "hanmei03",

                     "AcceptRegion": "hanmei03",

         "ConfirmTime": "2022-08-19 09:23:57",

         "CreatedAt": "2022-08-19 09:23:57",

         "UpdatedAt": "2022-10-18 15:06:40"

    }

]}

8.6 PreReceiveList

调用 PreReceiveList 接口查看对等连接待接受列表详情。

8.6.1 使用说明

GET http://{endpoint}/vpc/v1.0/peerings/preReceiveList

8.6.2 请求参数

1.png

8.6.3 返回数据

1.png

表8-2 Peer Object 表

1.png

8.6.4 示例

1. 请求示例

GET http://{endpoint}/vpc/v1.0/peerings/preReceiveList

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

    "RequestId": "f99ea01b42f06758a937c5e61e8af3c4",

         "TotalCount": 1,

         "PageSize": 10,

         "PageNumber": 1,

         "Peers": [

              {

                     "PeerId": "peer-2zuyjf1q9b",

                     "RequestName": "~~~~(~~",

                     "AcceptName": "~~~~(~~",

                     "RequestDescription": "httpss://",

                     "AcceptDescription": "httpss://",

                     "RequestTenantId": "220008021600300",

                     "AcceptTenantId": "220008021600300",

                     "RequestVpcId": "vpc-l64e8r8ovg",

                     "AcceptVpcId": "vpc-42wlbvi1oz",

                     "RequestVpcName": "vpc-192",

                     "AcceptVpcName": "vpc-172",

                     "RequestVpcCidr": "192.168.0.0/16",

                     "AcceptVpcCidr": "172.16.0.0/12",

                     "RequestRegion": "hanmei03",

                     "AcceptRegion": "hanmei03",

                     "ConfirmTime": "2022-08-19 09:23:57",

                     "CreatedAt": "2022-08-19 09:23:57",

                     "UpdatedAt": "2022-10-18 15:06:40"

               }

         ]}

8.7 RouterList

调用 RouterList 接口查看对等连接路由列表详情。

8.7.1 使用说明

GET http://{endpoint}/vpc/v1.0/peerings/{peerId}

8.7.2 请求参数

1.png

8.7.3 返回数据

1.png

表8-3 Router Object 表

2.png

8.7.4 示例

1. 请求示例

GET http://{endpoint}/vpc/v1.0/peerings/{peerId}?RouterType=other

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

    "RequestId": "bd139ab67fe98e54305a453b46dc5a52",

     "TotalCount": 1,

     "PageSize": 10,

     "PageNumber": 1,

     "Routers": [

        {

                 "Destination": "192.168.1.0/24",

                 "NexthopType": "PeerConnet",

                 "Nexthop": "0.0.0.11",

                 "RouterId": "rtb-gqox2gxqyc",

                 "Description": "",

                 "PeerId": "peer-2zuyjf1q9b",

                 "RuleId": "rtbr-fju2cw2wf4"

         }

     ]

}

8.8 RejectPeering

调用 RejectPeering 接口拒绝对等连接。

8.8.1 使用说明

PUT http://{endpoint}/vpc/v1.0/peerings/rejectPeering/{peerId}

直有接受方才能拒绝待接受状态的对等连接。

8.8.2 请求参数

1.png

8.8.3 返回数据

2.png

8.8.4 示例

1. 请求示例

PUT http://{endpoint}/vpc/v1.0/peerings/rejectPeering/{peerId}

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

     "RequestId": "bd139ab67fe98e54305a453b46dc5a52"

}

8.9 AcceptPeering

调用 RejectPeering 接口接受对等连接。

8.9.1 使用说明

PUT http://{endpoint}/vpc/v1.0/peerings/acceptPeering/{peerId}

只有接受方才能接受待接受状态的对等连接。

8.9.2 请求参数

1.png

8.9.3 返回数据

2.png

8.9.4 示例

1. 请求示例

PUT http://{endpoint}/vpc/v1.0/peerings/acceptPeering/{peerId}

2. 正常返回示例

HTTP/1.1 200 OK

Content-Type:application/json 

{

    "RequestId": "bd139ab67fe98e54305a453b46dc5a52"

}

意见反馈

文档内容是否对您有帮助?

如您有其他疑问,您也可以通过在线客服来与我们联系探讨 在线客服

联系我们
回到顶部