• Virtual Private Cloud

vpc
  1. Help Center
  2. Virtual Private Cloud
  3. API Reference
  4. APIs
  5. VPC Peering Connection
  6. Querying VPC Peering Connections

Querying VPC Peering Connections

Function

This interface is used to query all VPC peering connections accessible to the tenant submitting the request. The connections are filtered based on the filtering condition. For details about pagination query, see section Pagination.

URI

GET /v2.0/vpc/peerings

Example:

/v2.0/vpc/peerings?id={id}&name={name}&status={status}&tenant_id={tenant_id}&vpc_id={vpc_id}&limit={limit}&marker={marker}
Table 1 Parameter description

Name

Mandatory

Type

Description

id

No

String

Specifies that the VPC peering connection ID is used as the filtering condition.

name

No

String

  • Specifies that the peering connection name is used as the filter.
  • The value can contain no more than 64 characters.

status

No

String

Specifies that the VPC peering connection status is used as the filtering condition.

tenant_id

No

String

Specifies that the tenant ID is used as the filtering condition.

vpc_id

No

String

Specifies that the VPC ID is used as the filtering condition.

marker

No

String

Specifies the start resource ID of pagination query. If the parameter is left blank, only resources on the first page are queried.

limit

No

int

  • Specifies the number of records returned on each page.
  • The value ranges from 0 to intmax.

Request Message

  • Request parameter

    None

  • Example request
    GET /v2.0/vpc/peerings

Response Message

  • Response parameter
    Table 2 Response parameter

    Parameter

    Type

    Description

    peerings

    List(peering)

    Specifies the VPC peering connection object list. For details, see Table 1.

  • Example response
    {
        "peerings": [
            {
                "request_vpc_info": {
                    "vpc_id": "9daeac7c-a98f-430f-8e38-67f9c044e299",
                    "tenant_id": "f65e9ebc-ed5d-418b-a931-9a723718ba4e"
                },
                "accept_vpc_info": {
                    "vpc_id": "f583c072-0bb8-4e19-afb2-afb7c1693be5",
                    "tenant_id": "f65e9ebc-ed5d-418b-a931-9a723718ba4e"
                },
                "name": "test",
                "id": "b147a74b-39bb-4c7a-aed5-19cac4c2df13",
                "status": "ACTIVE"
            }
        ]
    }

Status Codes

For details, see section Status Codes.