Updated on 2022-08-15 GMT+08:00

Associating a Private Zone with a VPC

Function

Associate a private zone with a VPC.

URI

POST /v2/zones/{zone_id}/associaterouter

For details, see Table 1.
Table 1 Parameter in the URI

Parameter

Mandatory

Type

Description

zone_id

Yes

String

Zone ID

You can obtain the value by calling the API in Querying Private Zones.

Request

  • Parameter description
    Table 2 Parameters in the request

    Parameter

    Mandatory

    Type

    Description

    router

    Yes

    Object

    Router information (VPC associated with the zone)

    For details, see Table 3.

    Table 3 Description of the router field

    Parameter

    Mandatory

    Type

    Description

    router_id

    Yes

    String

    ID of the associated VPC

    router_region

    No

    String

    Region of the VPC

    If it is left blank, the region of the project in the token takes effect by default.

  • Example request
    Associate the zone whose ID is ff8080825b8fc86c015b94bc6f8712c3 with a VPC:
    POST https://{DNS_Endpoint}/v2/zones/ff8080825b8fc86c015b94bc6f8712c3/associaterouter
    {
        "router": {
            "router_id": "f0791650-db8c-4a20-8a44-a06c6e24b15b",
            "router_region": "xx"
        }
    }

Response

  • Parameter description
    Table 4 Parameters in the response

    Parameter

    Type

    Description

    router_id

    String

    Router ID (VPC ID)

    router_region

    String

    Region of the VPC

    status

    String

    Resource status

    For details, see Resource Status.

  • Example response
    {
        "status": "PENDING_CREATE",
        "router_id": "f0791650-db8c-4a20-8a44-a06c6e24b15b",
        "router_region": "xx"
    }
    

Returned Value

If a 2xx status code is returned, for example, 200, 202, or 204, the request is successful.

For details, see Status Code.