Create Router

Verb URI Description
POST /routers Create a new logical router.

Normal Response Code: 201

Error Response Codes: Unauthorized (401), Bad Request (400)

This operation creates a new logical router. When it is created, a logical router does not have any internal interface. In other words, it is not associated to any subnet. The user can optionally specify an external gateway for a router at create time; a router's external gateway must be plugged into an external network, that is to say a network for which the extended field router:external is set to true.

In order to specify an external gateway, the identifier of the external network must be passed in the request body's external_gateway_info attribute. This can be achieved as shown in the following snippet:

"external_gateway_info" :
{
    "network_id": <external_network_uuid>
}

This operation requires a request body.

This operation returns a response body.

 

Example 4.17. Create Router: JSON Request

{
   "router":{
      "name":"another_router",
      "admin_state_up":true
   }
}

 

Example 4.18. Create Router: JSON Response

{
    "router":
    {
        "status": "ACTIVE",
        "external_gateway_info": null,
        "name": "another_router",
        "admin_state_up": true,
        "tenant_id": "6b96ff0cb17a4b859e1e575d221683d3",
        "id": "8604a0de-7f6b-409a-a47c-a1cc7bc77b2e"
     }
}

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page


loading table of contents...