• Virtual Private Cloud

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

Querying VPC Details

Function

This interface is used to query details about a VPC.

URI

GET /v1/{project_id}/vpcs/{vpc_id}
Table 1 Parameter description

Name

Mandatory

Description

project_id

Yes

Specifies the project ID.

vpc_id

Yes

Specifies the VPC ID, which uniquely identifies the VPC.

Request Message

  • Request parameter

    None

  • Example request

    None

Response Message

  • Response parameter
    Table 2 Response parameter

    Name

    Type

    Description

    vpc

    Dictionary data structure

    Specifies the VPC objects.

    Table 3 Description of the vpc field

    Name

    Type

    Description

    id

    String

    Specifies a resource ID in UUID format.

    name

    String

    Specifies the VPC name.

    cidr

    String

    Specifies the available IP address ranges for subnets in the VPC.

    status

    String

    • Specifies the VPC status.
    • The value can be CREATING (creating) or OK (successfully created).

    routes

    List

    • Specifies the route information.
    • For details, see the description of the route object.

    enable_shared_snat

    Boolean

    Specifies whether the shared SNAT function is enabled. The value true indicates that the function is enabled, and the value false indicates that the function is not enabled.

    Table 4 Description of the route field

    Name

    Type

    Description

    destination

    String

    • Specifies the destination network segment of a route.
    • The value must be in the CIDR format. Currently, only the value 0.0.0.0/0 is supported.

    nexthop

    String

    • Specifies the next hop of a route.
    • The value must be an IP address and must belong to the subnet in the VPC. Otherwise, this value does not take effect.
  • Example response
    {
        "vpc": {
            "id": "99d9d709-8478-4b46-9f3f-2206b1023fd3",
            "name": "vpc",
            "cidr": "192.168.0.0/16",
            "status": "OK",
            
            "routes": null,
            "enable_shared_snat": false
    }
    }

Status Codes

For details, see section Status Codes.

Error Codes

For details, see section Error Codes.