Creating a VPC Peering Connection

Function

This API is used to create a VPC peering connection used to connect to other VPCs.

URI

  • URI format

    POST /v1.0/{project_id}/reserved_cluster/{cluster_id}/peering

  • Parameter description
    Table 1 URI parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Project ID. For details about how to obtain the project ID, see Obtaining a Project ID.

    cluster_id

    Yes

    Cluster ID.

Request

Create a VPC peering connection used to connect to other VPCs. The request parameter setting is in JSON format.

  • Example request
    {
      "vpc_id": "f4da5a55-fcd9-4a93-8b86-5b81585e14bb",
      "name": "myVpc"
    }
  • Parameter description
    Table 2 Request parameters

    Parameter

    Mandatory

    Type

    Description

    vpc_id

    Yes

    String

    ID of the peer VPC.

    name

    Yes

    String

    Name of the VPC peering connection.

    accept_tenant_id

    No

    String

    ID of the tenant to which the peer VPC belongs. This parameter is required only when a VPC peering connection to the VPC of another tenant is created.

Response

  • Example response
    {  
       "peering":{  
          "name":"myVpc",
          "id":"7e974044-bcc1-4f25-aff8-5f10cb347b0f",
          "request_vpc_info":{  
             "vpc_id":"83081290-198e-48e2-8e2d-64c50023d136",
             "tenant_id":"8185f87d043f4519a68420a282b5e2fa"
          },
          "accept_vpc_info":{  
             "vpc_id":"f4da5a55-fcd9-4a93-8b86-5b81585e14bb",
             "tenant_id":"4f30b9215e054c908d18f2b150131646"
          },
          "status":"PENDING_ACCEPTANCE"
       }
    }
  • Parameter description
    Table 3 Response parameters

    Parameter

    Mandatory

    Type

    Description

    name

    Yes

    String

    Name of the VPC peering connection.

    id

    Yes

    String

    ID of the VPC peering connection.

    request_vpc_info

    Yes

    Struct

    Information about the local VPC.

    accept_vpc_info

    Yes

    Struct

    Information about the peer VPC.

    vpc_id

    Yes

    String

    ID of the peer VPC.

    tenant_id

    Yes

    String

    ID of the tenant to which the peer VPC belongs.

    status

    Yes

    String

    Status of the VPC peering connection. Available options are as follows: PENDING_ACCEPTANCE, REJECTED, EXPIRED, DELETED, and ACTIVE.

Status Code

Table 4 Status code

Status Code

Description

201

A VPC peering connection is created successfully.

400

The input parameter is invalid.

500

Failed to complete the request because of an internal service error.

Error Code

For details, see Error Codes.