• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Neutron
  5. Routers
  6. Create router

Create router

Function Description

This interface is used to create a router.

Interface Format

Method

URI

Description

POST

/v2.0/routers

Creates a router.

Restrictions

N/A

Request Parameter

Parameter

Type

Mandatory

Description

router

Dict

Yes

Specifies the router. For details, see Table 1.

This parameter has no mandatory fields.

Response Parameter

Parameter

Type

Mandatory

Description

router

Dict

Yes

Specifies the router. For details, see Table 1.

Request Example

POST /v2.0/routers
{
    "router": {
        "name": "router2",
        "admin_state_up": true,
        "external_gateway_info": {
            "network_id": "9daeac7c-a98f-430f-8e38-67f9c044e299"
        }
    }
}

Response Example

{
    "router": {
        "status": "ACTIVE",
        "external_gateway_info": {
            "network_id": "9daeac7c-a98f-430f-8e38-67f9c044e299",
            "enable_snat": false
        }
        "name": "router2",
        "admin_state_up": true,
        "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f",
        "id": "76e48ca6-7d2d-45a6-947b-e48969a6035b",
        "distributed": false,
        "ha": false
    }
}

Error Code

See section Return Code Processing.