• Virtual Private Cloud

vpc
  1. Help Center
  2. Virtual Private Cloud
  3. API Reference
  4. OpenStack Neutron APIs
  5. Router
  6. Creating a Router

Creating a Router

Function

This interface is used to create a router.

URI

POST /v2.0/routers

Request Message

Table 1 Request parameter

Parameter

Type

Mandatory

Description

router

Dict

Yes

Specifies the router list. For details, see Table 1. This parameter has no mandatory fields.

Response Message

Table 2 Response parameter

Parameter

Type

Description

router

Dict

Specifies the router. For details, see Table 1.

Example:

Example request

POST /v2.0/routers 
{
    "router": {
           "name": "router-test2",
           "admin_state_up": true
    }
}

Example response

{
    "router": {
        "id": "f5dbdfe0-86f9-4b0a-9a32-6be143f0a076",
        "name": "router-test2",
        "status": "ACTIVE",
        "tenant_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "project_id": "bbfe8c41dd034a07bebd592bf03b4b0c",
        "admin_state_up": true,
        "external_gateway_info": {
            "network_id": "0a2228f2-7f8a-45f1-8e09-9039e1d09975",
            "enable_snat": false
        },
        "routes": [],
        "created_at": "2018-09-20T02:06:07",
        "updated_at": "2018-09-20T02:06:09"
    }
}

Status Codes

For details, see section Status Codes.