10.7. Deleting virtual routers

DELETE /v2.0/routers/{router_id}

Delete a logical router and, if present, its external gateway interface.

This operation fails if the router has attached internal interfaces. Find their IDs, as explained in Listing virtual router interfaces, and delete them, according to Deleting virtual router interfaces. After deleting all of router’s internal interfaces, delete the router itself.

Source: https://docs.openstack.org/api-ref/network/v2/index.html#delete-router

10.7.1. Request

Name In Type Description
router_id path string The ID of the router.

10.7.1.1. Example

# curl -ks -X DELETE -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' \
https://<node_IP_addr>:9696/v2.0/routers/ce996632-45a2-4c6b-a951-a624eba74621

10.7.2. Response

10.7.2.1. Status codes

10.7.2.1.1. Success

Code Reason
204 - No Content The server has fulfilled the request.

10.7.2.1.2. Error

Code Reason
401 - Unauthorized User must authenticate before making a request.
404 - Not Found The requested resource could not be found.
409 - Conflict This operation conflicted with another operation on this resource.
412 - Precondition Failed The server does not meet one of the preconditions that the requester put on the request header fields.