Peering Connections

VPC VPC

  • API Reference
    • ACL-Related Interfaces
      • Add ACL rule
      • Delete ACL rules
      • Query ACL rules
      • Query ACL
      • Update ACL rules
    • API function release records
    • API Overview
    • Appendix
    • Common Headers and Error Responses
    • Dedicated Gateway-Related Interfaces
      • Bind physical dedicated line
      • Create dedicated gateway
      • Create health check for dedicated gateway
      • Query dedicated gateway details
      • Query dedicated gateway list
      • Release dedicated gateway
      • Unbind physical dedicated line
      • Update dedicated gateway
    • Elastic Network Interface-Related Interfaces
      • Add intranet IP to elastic network interface in batches
      • Add Secondary IP Address of Elastic Network Interface
      • Create elastic network interface
      • Delete elastic network interface
      • Delete Intranet IP from elastic network interface in batches
      • Delete Secondary IP Address of Elastic Network Interface
      • Elastic network interface binds to EIP
      • Elastic Network Interface Mounts Cloud Product Instance
      • Elastic network interface unbinds from EIP
      • Elastic Network Interface Unmounts Cloud Product Instance
      • Query elastic network interface list
      • Query elastic network interface status
      • Query the specified elastic network interface
      • Update elastic network interface with enterprise security group
      • Update elastic network interface with regular security group
      • Update elastic network interface
    • Gateway Bandwidth Limiting Rule Related Interfaces
      • Create gateway bandwidth limiting rules
      • Delete Gateway Bandwidth Limiting Rule
      • Modify Gateway Bandwidth Limiting Rule
      • View Gateway Bandwidth Limiting Rule
    • General Description
    • High-Availability Virtual IP Address(HAVIP) Related Interfaces
      • Bind EIP to high-availability virtual IP address
      • Bind instance to high-availability virtual IP address
      • Create high-availability virtual IP address
      • Delete high-availability virtual IP address
      • Query high-availability virtual IP address list
      • Query the specified high-availability virtual IP address
      • Unbind EIP from high-availability virtual IP address
      • Unbind instance from high-availability virtual IP address
      • Update high-availability virtual IP address
    • Interface Overview
    • IPv6 Gateway-Related Interfaces
      • Add IPv6 egress-only policy
      • Bandwidth resizing for IPv6 gateway
      • Create IPv6 gateway bandwidth limiting policy
      • Create IPv6 gateway
      • Delete IPv6 gateway bandwidth limiting policy
      • Delete IPv6 Gateway
      • Delete the IPv6 egress-only policy
      • Query IPv6 gateway bandwidth limiting policy list
      • Query IPv6 gateway
      • Query the IPv6 egress-only policy list
      • Update IPv6 gateway bandwidth limiting policy
      • Update the IPv6 gateway release protection switch
    • NAT Gateway-Related Interfaces
      • Bind DNAT EIP to the NAT gateway
      • Bind SNAT EIP to the NAT gateway
      • Create DNAT rules in batches
      • Create DNAT rules
      • Create NAT gateway
      • Create SNAT rules in batches
      • Create SNAT rules
      • Delete DNAT rules
      • Delete SNAT rules
      • NAT Gateway Binds EIP
      • NAT gateway renewal
      • NAT Gateway Resize
      • NAT Gateway Unbinds EIP
      • Query DNAT rules
      • Query NAT gateway details
      • Query NAT gateway list
      • Query SNAT rules
      • Release NAT gateway
      • Unbind DNAT EIP from the NAT gateway
      • Unbind SNAT EIP from the NAT gateway
      • Update DNAT rules
      • Update NAT Delete Protection Switch
      • Update NAT gateway name
      • Update SNAT rules
    • Network Detection Related Interfaces
      • Create Network Probe
      • Delete network probe
      • Query network probe details
      • Query network probe list.
      • Update probe
    • Parameter Template-Related Interfaces
      • Add IP addresses to the IP address family
      • Add IP addresses to the IP address group
      • Create IP address family
      • Create IP address set
      • Delete IP address family
      • Delete IP address from IP address group
      • Delete IP address set
      • Query IP address family list
      • Query IP address group list
      • Query specified IP address family
      • Query specified IP address group
      • Remove IP address group from IP address family
      • Update IP address family
      • Update IP address set
    • Peering Connections-Related Interfaces
      • Application to process the peering connection
      • Bandwidth resizing for peering connections
      • Create peering connections
      • Disable DNS synchronization for the peering connections.
      • Enable DNS synchronization for the peering connections
      • List of peering connections to be queried.
      • Peering connection renewal
      • Release peering connections
      • Update the local API name and remarks for peering connections
      • Update the peering connection release protection switch
      • View details of peering connection
    • Route Table Related Interfaces
      • Create route rules
      • Delete route rules
      • Primary-standby switch
      • Query route table
      • Query routing rules
      • Update route rules
    • Security Group Related Interfaces
      • Enterprise security group
        • Authorize enterprise security group rules
        • Create enterprise security group
        • Delete enterprise security group rules
        • Delete enterprise security group
        • Query enterprise security group list
        • Update enterprise security group rules
      • Regular security group
        • Authorize regular security group rules
        • Create regular security group
        • Delete regular security group rules
        • Delete regular security group
        • Query regular security group list
        • Revoke regular security group rules
        • Update regular security group rules
        • View security group details
    • Service domain
    • Service Network Interface Card (SNIC)-Related Interfaces
      • Create service network interface card
      • Delete service network interface card
      • Query mountable public services
      • Query service network interface card details
      • Query service network interface card list
      • Update regular security group for service network interface card
      • Update service network interface card with enterprise security group
      • Update the service network interface card
    • Subnet-Related Interfaces
      • Create reserved network segment
      • Create subnet
      • Delete reserved network segment
      • Delete subnet
      • Query specified subnet
      • Query subnet list
      • Query the reserved network segment list
      • Update subnet
    • VPC-Related Interfaces
      • Create VPC
      • Delete VPC
      • Open VPC relay
      • Query IP Usage by Products in VPC
      • Query specified VPC
      • Query VPC intranet IP
      • Query VPC list
      • Shut down VPC relay
      • Update VPC
    • VPN-Related Interfaces
      • Bind EIP
      • Create SSL VPN server
      • Create SSL VPN users in batches
      • Create VPN tunnel
      • Create VPN
      • Delete SSL VPN server
      • Delete SSL VPN user
      • Delete VPN tunnel
      • Query SSL-VPN server
      • Query SSL-VPN user
      • Query VPN details
      • Query VPN List
      • Query VPN tunnels
      • Release VPN
      • Unbind EIP
      • Update SSL VPN server
      • Update SSL VPN user
      • Update VPN release protection switch
      • Update VPN tunnel
      • Update VPN
      • VPN gateway renewal
    • High-Availability Virtual IP Address (HAVIP) Related Interfaces
      • Bind EIP to high-availability virtual IP address
      • Bind instance to high-availability virtual IP address
      • Create high-availability virtual IP address
      • Delete high-availability virtual IP address
      • Query high-availability virtual IP address list
      • Query the specified high-availability virtual IP address
      • Unbind EIP from high-availability virtual IP address
      • Unbind instance from high-availability virtual IP address
      • Update high-availability virtual IP address
  • FAQs
    • Common Questions Overview
    • NAT FAQs
    • Route Table FAQs
    • Service Network Interface Card(SNIC) Common Questions
    • VPC FAQs
    • VPN FAQs
    • Service Network Interface Card (SNIC) Common Questions
  • Function Release Records
  • Operation guide
    • Access control
      • ACL
      • Parameter Template
      • Security group
    • Identity and access management
    • Monitor and Operations
      • NAT Gateway Instance Diagnosis
    • Network Connection
      • Dedicated gateway
      • IPv6 gateway
      • Layer 2 Gateway
      • NAT Gateway
        • Private Network NAT(Network Address Translation) Gateway
        • Public Network NAT(Network Address Translation) Gateway
        • Private Network NAT (Network Address Translation) Gateway
        • Public Network NAT (Network Address Translation) Gateway
      • Peering Connections
      • VPN Gateway
        • GRE VPN Gateway
        • IPsec VPN Gateway
        • SSL VPN Gateway
    • Network Diagnostics
      • Flow log
      • Gateway bandwidth limiting
      • Network probe
      • Path analysis
      • Port verification
      • Traffic monitor
    • Network interface card
      • Elastic network interface
      • High-availability virtual IP address (HAVIP)
      • Service network interface card
    • Network topology
    • Route table
    • Subnet
    • Tag Management
    • Using IPv6
    • VPC
  • Product Description
    • Application scenarios
    • Product advantages
    • Product features
    • Product Introduction
    • Related concepts
    • Usage restrictions
  • Product pricing
  • SDK
    • Go-SDK
      • ACL
      • Dedicated gateway
      • Elastic network interface
      • Exception handling
      • High-availability virtual IP address (HAVIP)
      • Initialization
      • Install the SDK Package
      • IPv6Gateway
      • NAT
      • Network probe
      • Overview
      • Peering Connections
      • Route
      • Security group
        • Enterprise security group
        • Regular security group
      • Service network interface card
      • Subnet
      • VPC
      • VPN
    • Java-SDK
      • ACL
      • Dedicated gateway
      • Elastic network interface
      • Enterprise security group
      • High-availability virtual IP address (HAVIP)
      • Install the SDK Package
      • IPv6 gateway
      • NAT
      • Network probe
      • Overview
      • Parameter Template
      • Peering Connections
      • Regular security group
      • Route
      • Service network interface card
      • Subnet
      • Version history
      • vpc
      • VPN
    • PHP-SDK
      • ACL
      • Install the SDK Package
      • NAT
      • Overview
      • Peering Connections
      • Route
      • Security group
      • Subnet
      • Version history
      • vpc
    • Python-SDK
      • ACL
      • Dedicated gateway
      • Elastic network interface
      • Enterprise security group
      • High-availability virtual IP address (HAVIP)
      • Install the SDK Package
      • IPv6Gateway
      • NAT
      • Network probe
      • Overview
      • Peering Connections
      • Route
      • Security group
      • Service network interface card
      • Subnet
      • Version history
      • VPC
      • VPN
  • Service Level Agreement (SLA)
    • IPv6 Gateway Service Level Agreement SLA
    • NAT(Network Address Translation) Gateway Service Level Agreement SLA
    • Peering Connections Service Level Agreement SLA
    • Service Network Interface Card(SNIC) Service Level Agreement SLA
    • VPN Gateway Service Level Agreement SLA
    • NAT (Network Address Translation) Gateway Service Level Agreement SLA
    • Service Network Interface Card (SNIC) Service Level Agreement SLA
  • Typical Practices
    • Configure Custom Service and Use Service Network Interface Card(SNIC) to Provide Service for Other VPCs
    • HAVIP Combined with Keepalived to Achieve Master-Backup Multi-Machine High Availability
    • Layer 2 Gateway Combined with Dedicated Line Access ET to Build Large Layer 2 Network Between IDC and Cloud VPC
    • Network Layer Security Description
    • Peering Connections Typical Practice
    • Security Group Configuration Practice (Advanced Level)
    • Security Group Configuration Practice (Beginner Level)
    • Typical Practice of Managing Elastic Network Interface Using Terraform
    • Typical Practice of Managing IPsec VPN Gateway Using Terraform
    • Using Keepalived in VPC to Achieve High-Availability Architecture
    • VPC Custom Route Table to Achieve Secure Traffic Mutual Access
    • Windows Using HAVIP to Configure Master-Backup Multi-Machine
    • Configure Custom Service and Use Service Network Interface Card (SNIC) to Provide Service for Other VPCs
  • VPC CLI
    • Configure BCE-CLI
    • Install BCE-CLI
    • Route Table Related Operations
    • Subnet Related Operations
    • Using VPC Service via CLI
    • Version Change Records
    • VPC Related Operations
All documents
menu
No results found, please re-enter

VPC VPC

  • API Reference
    • ACL-Related Interfaces
      • Add ACL rule
      • Delete ACL rules
      • Query ACL rules
      • Query ACL
      • Update ACL rules
    • API function release records
    • API Overview
    • Appendix
    • Common Headers and Error Responses
    • Dedicated Gateway-Related Interfaces
      • Bind physical dedicated line
      • Create dedicated gateway
      • Create health check for dedicated gateway
      • Query dedicated gateway details
      • Query dedicated gateway list
      • Release dedicated gateway
      • Unbind physical dedicated line
      • Update dedicated gateway
    • Elastic Network Interface-Related Interfaces
      • Add intranet IP to elastic network interface in batches
      • Add Secondary IP Address of Elastic Network Interface
      • Create elastic network interface
      • Delete elastic network interface
      • Delete Intranet IP from elastic network interface in batches
      • Delete Secondary IP Address of Elastic Network Interface
      • Elastic network interface binds to EIP
      • Elastic Network Interface Mounts Cloud Product Instance
      • Elastic network interface unbinds from EIP
      • Elastic Network Interface Unmounts Cloud Product Instance
      • Query elastic network interface list
      • Query elastic network interface status
      • Query the specified elastic network interface
      • Update elastic network interface with enterprise security group
      • Update elastic network interface with regular security group
      • Update elastic network interface
    • Gateway Bandwidth Limiting Rule Related Interfaces
      • Create gateway bandwidth limiting rules
      • Delete Gateway Bandwidth Limiting Rule
      • Modify Gateway Bandwidth Limiting Rule
      • View Gateway Bandwidth Limiting Rule
    • General Description
    • High-Availability Virtual IP Address(HAVIP) Related Interfaces
      • Bind EIP to high-availability virtual IP address
      • Bind instance to high-availability virtual IP address
      • Create high-availability virtual IP address
      • Delete high-availability virtual IP address
      • Query high-availability virtual IP address list
      • Query the specified high-availability virtual IP address
      • Unbind EIP from high-availability virtual IP address
      • Unbind instance from high-availability virtual IP address
      • Update high-availability virtual IP address
    • Interface Overview
    • IPv6 Gateway-Related Interfaces
      • Add IPv6 egress-only policy
      • Bandwidth resizing for IPv6 gateway
      • Create IPv6 gateway bandwidth limiting policy
      • Create IPv6 gateway
      • Delete IPv6 gateway bandwidth limiting policy
      • Delete IPv6 Gateway
      • Delete the IPv6 egress-only policy
      • Query IPv6 gateway bandwidth limiting policy list
      • Query IPv6 gateway
      • Query the IPv6 egress-only policy list
      • Update IPv6 gateway bandwidth limiting policy
      • Update the IPv6 gateway release protection switch
    • NAT Gateway-Related Interfaces
      • Bind DNAT EIP to the NAT gateway
      • Bind SNAT EIP to the NAT gateway
      • Create DNAT rules in batches
      • Create DNAT rules
      • Create NAT gateway
      • Create SNAT rules in batches
      • Create SNAT rules
      • Delete DNAT rules
      • Delete SNAT rules
      • NAT Gateway Binds EIP
      • NAT gateway renewal
      • NAT Gateway Resize
      • NAT Gateway Unbinds EIP
      • Query DNAT rules
      • Query NAT gateway details
      • Query NAT gateway list
      • Query SNAT rules
      • Release NAT gateway
      • Unbind DNAT EIP from the NAT gateway
      • Unbind SNAT EIP from the NAT gateway
      • Update DNAT rules
      • Update NAT Delete Protection Switch
      • Update NAT gateway name
      • Update SNAT rules
    • Network Detection Related Interfaces
      • Create Network Probe
      • Delete network probe
      • Query network probe details
      • Query network probe list.
      • Update probe
    • Parameter Template-Related Interfaces
      • Add IP addresses to the IP address family
      • Add IP addresses to the IP address group
      • Create IP address family
      • Create IP address set
      • Delete IP address family
      • Delete IP address from IP address group
      • Delete IP address set
      • Query IP address family list
      • Query IP address group list
      • Query specified IP address family
      • Query specified IP address group
      • Remove IP address group from IP address family
      • Update IP address family
      • Update IP address set
    • Peering Connections-Related Interfaces
      • Application to process the peering connection
      • Bandwidth resizing for peering connections
      • Create peering connections
      • Disable DNS synchronization for the peering connections.
      • Enable DNS synchronization for the peering connections
      • List of peering connections to be queried.
      • Peering connection renewal
      • Release peering connections
      • Update the local API name and remarks for peering connections
      • Update the peering connection release protection switch
      • View details of peering connection
    • Route Table Related Interfaces
      • Create route rules
      • Delete route rules
      • Primary-standby switch
      • Query route table
      • Query routing rules
      • Update route rules
    • Security Group Related Interfaces
      • Enterprise security group
        • Authorize enterprise security group rules
        • Create enterprise security group
        • Delete enterprise security group rules
        • Delete enterprise security group
        • Query enterprise security group list
        • Update enterprise security group rules
      • Regular security group
        • Authorize regular security group rules
        • Create regular security group
        • Delete regular security group rules
        • Delete regular security group
        • Query regular security group list
        • Revoke regular security group rules
        • Update regular security group rules
        • View security group details
    • Service domain
    • Service Network Interface Card (SNIC)-Related Interfaces
      • Create service network interface card
      • Delete service network interface card
      • Query mountable public services
      • Query service network interface card details
      • Query service network interface card list
      • Update regular security group for service network interface card
      • Update service network interface card with enterprise security group
      • Update the service network interface card
    • Subnet-Related Interfaces
      • Create reserved network segment
      • Create subnet
      • Delete reserved network segment
      • Delete subnet
      • Query specified subnet
      • Query subnet list
      • Query the reserved network segment list
      • Update subnet
    • VPC-Related Interfaces
      • Create VPC
      • Delete VPC
      • Open VPC relay
      • Query IP Usage by Products in VPC
      • Query specified VPC
      • Query VPC intranet IP
      • Query VPC list
      • Shut down VPC relay
      • Update VPC
    • VPN-Related Interfaces
      • Bind EIP
      • Create SSL VPN server
      • Create SSL VPN users in batches
      • Create VPN tunnel
      • Create VPN
      • Delete SSL VPN server
      • Delete SSL VPN user
      • Delete VPN tunnel
      • Query SSL-VPN server
      • Query SSL-VPN user
      • Query VPN details
      • Query VPN List
      • Query VPN tunnels
      • Release VPN
      • Unbind EIP
      • Update SSL VPN server
      • Update SSL VPN user
      • Update VPN release protection switch
      • Update VPN tunnel
      • Update VPN
      • VPN gateway renewal
    • High-Availability Virtual IP Address (HAVIP) Related Interfaces
      • Bind EIP to high-availability virtual IP address
      • Bind instance to high-availability virtual IP address
      • Create high-availability virtual IP address
      • Delete high-availability virtual IP address
      • Query high-availability virtual IP address list
      • Query the specified high-availability virtual IP address
      • Unbind EIP from high-availability virtual IP address
      • Unbind instance from high-availability virtual IP address
      • Update high-availability virtual IP address
  • FAQs
    • Common Questions Overview
    • NAT FAQs
    • Route Table FAQs
    • Service Network Interface Card(SNIC) Common Questions
    • VPC FAQs
    • VPN FAQs
    • Service Network Interface Card (SNIC) Common Questions
  • Function Release Records
  • Operation guide
    • Access control
      • ACL
      • Parameter Template
      • Security group
    • Identity and access management
    • Monitor and Operations
      • NAT Gateway Instance Diagnosis
    • Network Connection
      • Dedicated gateway
      • IPv6 gateway
      • Layer 2 Gateway
      • NAT Gateway
        • Private Network NAT(Network Address Translation) Gateway
        • Public Network NAT(Network Address Translation) Gateway
        • Private Network NAT (Network Address Translation) Gateway
        • Public Network NAT (Network Address Translation) Gateway
      • Peering Connections
      • VPN Gateway
        • GRE VPN Gateway
        • IPsec VPN Gateway
        • SSL VPN Gateway
    • Network Diagnostics
      • Flow log
      • Gateway bandwidth limiting
      • Network probe
      • Path analysis
      • Port verification
      • Traffic monitor
    • Network interface card
      • Elastic network interface
      • High-availability virtual IP address (HAVIP)
      • Service network interface card
    • Network topology
    • Route table
    • Subnet
    • Tag Management
    • Using IPv6
    • VPC
  • Product Description
    • Application scenarios
    • Product advantages
    • Product features
    • Product Introduction
    • Related concepts
    • Usage restrictions
  • Product pricing
  • SDK
    • Go-SDK
      • ACL
      • Dedicated gateway
      • Elastic network interface
      • Exception handling
      • High-availability virtual IP address (HAVIP)
      • Initialization
      • Install the SDK Package
      • IPv6Gateway
      • NAT
      • Network probe
      • Overview
      • Peering Connections
      • Route
      • Security group
        • Enterprise security group
        • Regular security group
      • Service network interface card
      • Subnet
      • VPC
      • VPN
    • Java-SDK
      • ACL
      • Dedicated gateway
      • Elastic network interface
      • Enterprise security group
      • High-availability virtual IP address (HAVIP)
      • Install the SDK Package
      • IPv6 gateway
      • NAT
      • Network probe
      • Overview
      • Parameter Template
      • Peering Connections
      • Regular security group
      • Route
      • Service network interface card
      • Subnet
      • Version history
      • vpc
      • VPN
    • PHP-SDK
      • ACL
      • Install the SDK Package
      • NAT
      • Overview
      • Peering Connections
      • Route
      • Security group
      • Subnet
      • Version history
      • vpc
    • Python-SDK
      • ACL
      • Dedicated gateway
      • Elastic network interface
      • Enterprise security group
      • High-availability virtual IP address (HAVIP)
      • Install the SDK Package
      • IPv6Gateway
      • NAT
      • Network probe
      • Overview
      • Peering Connections
      • Route
      • Security group
      • Service network interface card
      • Subnet
      • Version history
      • VPC
      • VPN
  • Service Level Agreement (SLA)
    • IPv6 Gateway Service Level Agreement SLA
    • NAT(Network Address Translation) Gateway Service Level Agreement SLA
    • Peering Connections Service Level Agreement SLA
    • Service Network Interface Card(SNIC) Service Level Agreement SLA
    • VPN Gateway Service Level Agreement SLA
    • NAT (Network Address Translation) Gateway Service Level Agreement SLA
    • Service Network Interface Card (SNIC) Service Level Agreement SLA
  • Typical Practices
    • Configure Custom Service and Use Service Network Interface Card(SNIC) to Provide Service for Other VPCs
    • HAVIP Combined with Keepalived to Achieve Master-Backup Multi-Machine High Availability
    • Layer 2 Gateway Combined with Dedicated Line Access ET to Build Large Layer 2 Network Between IDC and Cloud VPC
    • Network Layer Security Description
    • Peering Connections Typical Practice
    • Security Group Configuration Practice (Advanced Level)
    • Security Group Configuration Practice (Beginner Level)
    • Typical Practice of Managing Elastic Network Interface Using Terraform
    • Typical Practice of Managing IPsec VPN Gateway Using Terraform
    • Using Keepalived in VPC to Achieve High-Availability Architecture
    • VPC Custom Route Table to Achieve Secure Traffic Mutual Access
    • Windows Using HAVIP to Configure Master-Backup Multi-Machine
    • Configure Custom Service and Use Service Network Interface Card (SNIC) to Provide Service for Other VPCs
  • VPC CLI
    • Configure BCE-CLI
    • Install BCE-CLI
    • Route Table Related Operations
    • Subnet Related Operations
    • Using VPC Service via CLI
    • Version Change Records
    • VPC Related Operations
  • Document center
  • arrow
  • VPCVPC
  • arrow
  • SDK
  • arrow
  • Python-SDK
  • arrow
  • Peering Connections
Table of contents on this page
  • Retrieve Endpoint
  • Retrieve access key
  • peerconn_client
  • Create peerconn_client
  • Create peering connections
  • List of peering connections to be queried.
  • Query peering connections details
  • Update the local API name and remarks for peering connections
  • Application to process the peering connection
  • Release peering connections
  • Bandwidth resizing for peering connections
  • Peering connection renewal
  • Enable DNS synchronization for the peering connections
  • Disable DNS synchronization for the peering connections.
  • Update the peering connection release protection switch

Peering Connections

Updated at:2025-10-16

Peering connections SDK documentation

Retrieve Endpoint

Before configuring the endpoint for SDK usage, please refer to the developer guide section on VPC Service Domain Name to understand endpoint-related concepts. Baidu AI Cloud currently supports multiple regions. Please refer to the VPC section in the Region Selection Guide. The peering connection service is part of the VPC service and adopts the VPC service domain name.

Retrieve access key

To use the Baidu AI Cloud products, you need a Baidu AI Cloud account, a valid AK (Access Key ID) and SK (Secret Access Key) for signature certification. Your AK/SK information can be obtained and understood through the following steps:

  1. Register a Baidu AI Cloud account
  2. Create AK/SK

peerconn_client

The peerconn_client encapsulates the peering connections Service API, thereby simplifying developer interaction. Users can call methods in peerconn_client to configure peering connections. The return parameters of peerconn_client methods are consistent with API Methods.

Create peerconn_client

When creating a peerconn_client, first configure a BceClientConfiguration-type config instance using endpoint, AK and SK, and then use the config instance to configure the peerconn_client. The specific configuration method is as follows:

Plain Text
1HOST = b''
2 AK = b''
3 SK = b''
4 config = BceClientConfiguration(
5     credentials=BceCredentials(AK, SK), endpoint=HOST)
6 self.client = peerconn_client.PeerConnClient(config)

Create peering connections

When creating peering connections, note the following:

  • For peering connections within the same account, the system automatically accepts them on behalf of the peer.
  • Cross-account peering connections require acceptance by the receiving end before becoming available.
  • For peering connections within the same region, the billing parameter only supports the postpaid option (the billing parameter must be provided, though the billing amount will be 0).
  • Only one peering connection is allowed between any two VPCs.
  • The initiator's VPC and the acceptor's VPC must not be the same.
  • A peering connection cannot be established if both the local and peer VPCs are relay VPCs.

The create_peerconn function can be used to create peering connections between specified VPCs. The function is defined as follows:

Plain Text
1@required(bandwidth_in_mbps=int,
2           local_vpc_id=(bytes, str),
3           peer_vpc_id=(bytes, str),
4           peer_region=(bytes, str))
5def create_peerconn(self, bandwidth_in_mbps, local_vpc_id,
6                    peer_vpc_id, peer_region, description=None,
7                    local_if_name=None, peer_account_id=None,
8                    peer_if_name=None, client_token=None,
9                    billing=None, config=None, tags=None,
10                    resourceGroupId=None, deleteProtect=False):

Parameter meaning

Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/VPC/s/bjwvyue8y

Response Value

Operation succeeded:

JSON
1{
2    "peerConnId": "peerconn-9td54fmx143e"
3}

Operation failed:

Throw an exception. For the exception list, refer to Peering Connection Exception List

Code example For specific code examples, refer to example_create_peerconn.py

List of peering connections to be queried.

The list_peerconns function can be used to query the peering connections list. The function is defined as follows:

Plain Text
1@required(vpc_id=(bytes, str))
2def list_peerconns(self, vpc_id, marker=None,
3                   max_keys=None, config=None)

Parameter meaning

Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/VPC/s/Fjwvyuemr

Response value

Operation succeeded:

JSON
1{
2	 "peerConns":[
3        {
4            "peerConnId":"peerconn-9td54fmx143e",
5            "role":"initiator",
6            "status":"active",
7            "bandwithInMbp":500,
8            "description":"peer_diff_account",
9            "localIfId":"qpif-ken2yc9j8x56",
10            "localIfName":"int-SpLVk25R",
11            "localVpcId":"vpc-13vuxu016dew",
12            "localRegion":"bj",
13            "peerVpcId":"vpc-jcvmhw9h1a35",
14            "peerRegion":"bj",
15            "peerAccountId":"75c14a239bb24b9e88b695e8e9e47952",
16			"dnsStatus":"close",
17            "paymentTiming":"Postpaid",
18			"createdTime" :"2018-08-07 19:46:55",
19            "expiredTime":expiredTime
20        }
21    ]
22    "marker":"peerconn-9td54fmx143e",
23    "isTruncated": true,
24    "nextMarker": "peerconn-srbvvxmjn7ux",
25    "maxKeys": 1
26}

Operation failed:

Throw an exception. For the exception list, refer to Peering Connection Exception List

Code example

For specific code examples, refer to example_list_peerconn.py

Query peering connections details

The get_peerconn function can be used to query the peering connection details. The function is defined as follows:

Plain Text
1@required(peer_conn_id=(bytes, str))
2def get_peerconn(self, peer_conn_id, config=None)

Parameter meaning

Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/VPC/s/Sjwvyudwm

Response Value

Operation succeeded:

JSON
1{
2    "peerConnId":"peerconn-cbp4xrtzk3fb",
3    "role":"initiator",
4    "status":"active",
5    "bandwithInMbp":1000,
6    "description":"mypeerconn",
7    "localIfId":"qpif-qz9a61ujsizt",
8    "localIfName":"dsds",
9    "localVpcId":"20fada00-f66e-40de-bed4-954af13dc0b2",
10    "localRegion":"bj",
11    "peerVpcId":"1aa1427d-92cf-45d0-bc31-ab4d9fe71425",
12    "peerRegion":"bj",
13    "peerAccountId":"75c14a239bb24b9e88b695e8e9e47952",
14    "createdTime":"2018-08-03 20:38:43"
15    "expiredTime":null,
16    "dnsStatus":"close",
17    "paymentTiming":"Postpaid",
18    "tags":[
19        {
20          "tagKey":"tagKey",
21          "tagValue":"tagValue"
22        }
23    ],
24    "deleteProtect":true
25}

Operation failed:

Throw an exception. For the exception list, refer to Peering Connection Exception List

Code example

For specific code examples, refer to example_get_peerconn.py

Update the local API name and remarks for peering connections

The update_peerconn function can be used to update peering connections. The function is defined as follows:

Plain Text
1@required(peer_conn_id=(bytes, str), local_if_id=(bytes, str))
2def update_peerconn(self, peer_conn_id, local_if_id, description=None,
3                    local_if_name=None, client_token=None, config=None)

Parameter Meaning

Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/VPC/s/1jwvyufpd

Response value

Operation succeeded:

There are no special response parameters

Operation failed:

Throw an exception. For the exception list, refer to Peering Connection Exception List

Code example

For specific code examples, refer to example_update_peerconn.py

Application to process the peering connection

  • The timeout period for a connection request initiated by the initiator is 7 days. Once the timeout occurs, the status of the peering connection changes to "negotiation failure."
  • If the acceptor rejects, the initiator's peering connection status changes to "negotiation failure."

The handle_peerconn function can be used to process peering connection requests. The function is defined as follows:

Plain Text
1@required(peer_conn_id=(bytes, str), action=(bytes, str))
2def handle_peerconn(self, peer_conn_id, action, client_token=None,
3                    config=None)

Parameter Meaning

Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/VPC/s/wjwvyud6p

Response value

Operation succeeded:

There are no special response parameters

Operation failed:

Throw an exception. For the exception list, refer to Peering Connection Exception List

Code example

For specific code examples, refer to example_handle_peerconn.py

Release peering connections

The delete_peerconn function can be used to release peering connections. The function is defined as follows:

Plain Text
1@required(peer_conn_id=(bytes, str))
2def delete_peerconn(self, peer_conn_id, client_token=None,
3                    config=None)

Parameter meaning

Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/VPC/s/0jwvyucfy

Response value

Operation succeeded:

There are no special response parameters

Operation failed:

Throw an exception. For the exception list, refer to Peering Connection Exception List

Code example

For specific code examples, refer to example_delete_peerconn.py

Bandwidth resizing for peering connections

The resize_peerconn function can be used for bandwidth resizing of peering connections. The function is defined as follows:

Plain Text
1@required(peer_conn_id=(bytes, str), new_bandwidth_in_mbps=int)
2def resize_peerconn(self, peer_conn_id, new_bandwidth_in_mbps,
3                    client_token=None, config=None)

Parameter Meaning

Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/VPC/s/Wjwvyufcb

Response Value

Operation succeeded:

There are no special response parameters

Operation failed:

Throw an exception. For the exception list, refer to Peering Connection Exception List

Code example

For specific code examples, refer to example_resize_peerconn.py

Peering connection renewal

  • Postpay peering connections cannot be renewed.
  • In cross-account scenarios, only the initiator can perform renewal operations.

The purchase_reserved_peerconn function can be used to renew peering connections. The function is defined as follows:

Plain Text
1@required(peer_conn_id=(bytes, str))
2def purchase_reserved_peerconn(self, peer_conn_id, client_token=None,
3                               billing=None, config=None)

Parameter Meaning

Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/VPC/s/9jwvyudie

Response value

Operation succeeded:

There are no special response parameters

Operation failed:

Throw an exception. For the exception list, refer to Peering Connection Exception List

Code example

For specific code examples, refer to example_purchase_reserved_peerconn.py

Enable DNS synchronization for the peering connections

  • DNS synchronization can only be enabled when the status of the peering connection is "available."
  • DNS synchronization cannot be enabled if the DNS status of the peering connection is "synchronizing" or "disabling synchronization."

The open_peerconn_dns_sync function can be used to enable DNS synchronization for peering connections. The function is defined as follows:

Plain Text
1@required(peer_conn_id=(bytes, str), role=(bytes, str))
2def open_peerconn_dns_sync(self, peer_conn_id, role,
3                           client_token=None, config=None)

Parameter meaning

Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/VPC/s/Qjwvyuf0h

Response Value

Operation succeeded:

There are no special response parameters

Operation failed:

Throw an exception. For the exception list, refer to Peering Connection Exception List

Code example

For specific code examples, refer to example_open_peerconn_sync_dns.py

Disable DNS synchronization for the peering connections.

  • DNS synchronization can only be disabled when the status of the peering connection is "available.\
  • DNS synchronization cannot be turned off when the DNS status of peering connections is either synchronizing or in the process of being disabled.

The close_peerconn_dns_sync can be used to disable DNS synchronization for peering connections. The function is defined as follows:

Plain Text
1@required(peer_conn_id=(bytes, str), role=(bytes, str))
2def close_peerconn_dns_sync(self, peer_conn_id, role,
3                            client_token=None, config=None)

Parameter Meaning

Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/VPC/s/ojwvyucs2

Response value

Operation succeeded:

There are no special response parameters

Operation failed:

Throw an exception. For the exception list, refer to Peering Connection Exception List

Code example

For specific code examples, refer to example_close_peerconn_dns_sync.py

Update the peering connection release protection switch

The update_peerconn_delete_protect function can be used to update the peering connections release protection switch. The function is defined as follows:

Plain Text
1@required(peer_conn_id=(bytes, str), delete_protect=(bool,))
2def update_peerconn_delete_protect(self, peer_conn_id, delete_protect,
3                                   client_token=None, config=None):

Parameter meaning

Refer to the OpenAPI documentation: https://cloud.baidu.com/doc/VPC/s/4lzjn3dsi

Response Value

Operation succeeded:

There are no special response parameters

Operation failed:

Throw an exception. For the exception list, refer to Peering Connection Exception List

Code example

For specific code examples, refer to example_update_peerconn_delete_protect.py

Previous
Overview
Next
Route