Create Router with external gateway

Verb URI Description
POST /routers Create a new Neutron router

Success and error response codes are not changed with regards to the operation as introduced by the L3 API extension.

Neutron API users can specify whether SNAT should be performed on the network specified as the router's external gateway by setting enable_snat in external_gateway_info to either True or False; the default value is True.

 

Example 4.38. Create router with SNAT disabled

POST /v2.0/routers
Accept: application/json
{
    "router":
    {
        "name": "another_router",
        "admin_state_up": true,
        "external_gateway_info": {
            "network_id": "3c5bcddd-6af9-4e6b-9c3e-c153e521cab8",
            "enable_snat": false}
    }
}

HTTP/1.1 201 OK
Content-Type: application/json; charset=UTF-8
{
    "router":
    {
        "status": "ACTIVE",
        "external_gateway_info": {
            "network_id": "3c5bcddd-6af9-4e6b-9c3e-c153e521cab8",
            "enable_snat": false}
        "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...