• Virtual Private Cloud

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

Updating VPC Information

Function

This interface is used to update information about a VPC.

URI

PUT /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
    Table 2 Request parameter

    Name

    Mandatory

    Type

    Description

    vpc

    Yes

    Dictionary data structure

    Specifies the VPC object.

    Table 3 Description of the vpc field

    Name

    Mandatory

    Type

    Description

    name

    No

    String

    • Specifies the VPC name.
    • The value is a string of no more than 64 characters that can contain letters, digits, underscores (_), hyphens (-), and periods (.).
    • For a tenant, each VPC name must be unique if the value of name is not empty.

    cidr

    No

    String

    • Specifies the available IP address ranges for subnets in the VPC.
    • The value ranges from 10.0.0.0/8 to 10.255.255.240/28, 172.16.0.0/12 to 172.31.255.240/28, or 192.168.0.0/16 to 192.168.255.240/28.
    • The value must be in CIDR format, for example, 192.168.0.0/16.

    enable_shared_snat

    No

    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.

  • Example request
    {
    "vpc":
        {
        "name": "vpc1",
        "cidr": "192.168.0.0/16",
        "enable_shared_snat": true
        }
    }

Response Message

  • Response parameter
    Table 4 Response parameter

    Name

    Type

    Description

    vpc

    Dictionary data structure

    Specifies the VPC object.

    Table 5 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 6 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": "vpc1",
            "cidr": "192.168.0.0/16",
            "status": "OK",
            
            "routes": null,
            "enable_shared_snat": true
        }
    }

Status Codes

For details, see section Status Codes.

Error Codes

For details, see section Error Codes.