• Virtual Private Cloud

vpc
  1. Help Center
  2. Virtual Private Cloud
  3. API Reference
  4. APIs
  5. VPC Route
  6. Querying VPC Routes

Querying VPC Routes

Function

This interface is used to query all routes of the tenant submitting the request. The routes are filtered based on the filtering condition. For details about the response format of pagination query, see section Pagination.

URI

GET /v2.0/vpc/routes

Example:

/v2.0/vpc/routes?id={id}&vpc_id={vpc_id}&tenant_id={tenant_id}&destination={destination}&type={type}&limit={limit}&marker={marker}
Table 1 Parameter description

Name

Mandatory

Type

Description

id

No

String

Specifies that the route ID 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.

destination

No

String

Specifies that the route destination address (CIDR) is used as the filtering condition.

type

No

String

Specifies that the type 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/routes?vpc_id=ab78be2d-782f-42a5-aa72-35879f6890ff

Response Message

  • Response parameter
    Table 2 Response parameter

    Parameter

    Type

    Description

    routes

    List (route)

    Specifies the route object list. For details, see Table 1.

  • Example response
    { 
      "routes": [ 
        { 
          "type": "peering",  
          "nexthop": "60c809cb-6731-45d0-ace8-3bf5626421a9",  
          "destination": "192.168.200.0/24",  
          "vpc_id": "ab78be2d-782f-42a5-aa72-35879f6890ff",  
          "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f",
          "id": "3d42a0d4-a980-4613-ae76-a2cddecff054" 
        }
      ] 
    }

Status Codes

For details, see section Status Codes.