Skip to main content

Remove Router Interface

PUT /v2.0/routers/{router_id}/remove_router_interface

Deletes an internal interface with the specified ID from a virtual router (detaches a subnet from the router). If the specified subnet ID is the last subnet on the port, the port is deleted as well.

You must specify either a subnet_id or port_id in the request body to identify which router interface to delete. You can also specify both. If both are specified, the subnet_id must correspond to the subnet ID of the first IP address on the port; otherwise, the operation returns 409 Conflict with details.

If the router interface you try to delete is used by one or more routes, this operation returns 409 Conflict. Remove those routes from the router first and retry.

If the router, subnet, or port does not exist or is not visible, this operation returns 404 Not Found. As a consequence of this operation, the port connecting the router with the subnet is removed from the subnet for the network when applicable.

Request

Parameters

NameInTypeDescription
router_idpathstringThe ID of the router.
subnet_id (Optional)bodystringThe ID of the subnet. One of subnet_id or port_id must be specified.
port_id (Optional)bodystringThe ID of the port. One of subnet_id or port_id must be specified.

Sample Request

Using curl

curl -ks -X PUT -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' -d '{
"subnet_id": "b367fdf4-d111-4c4c-b8c2-ea5d484ac0fb"
}' https://api.vietnix.cloud:9696/v2.0/routers/66fa6a3b-4b3a-485f-819d-c671765eb915/remove_router_interface/

#### Using HTTP request

```http
PUT https://api.vietnix.cloud:9696/v2.0/routers/{router_id}/remove_router_interface
Content-Type: application/json
X-Auth-Token: gAAAAA<...>

{
"subnet_id": "b367fdf4-d111-4c4c-b8c2-ea5d484ac0fb"
}

Response

Response Parameters

NameInTypeDescription
idbodystringThe ID of the resource.
subnet_idbodystringThe ID of the subnet which the router interface belongs to.
subnet_idsbodyarrayA list containing the ID of the subnet which the router interface belongs to. Contains only one member.
network_idbodystringThe ID of the attached network.
port_idbodystringThe ID of the port which represents the router interface.
project_idbodystringThe ID of the project.
tenant_idbodystringThe ID of the project.
tagsbodyarrayThe list of tags on the resource.

Sample Response

{
"id": "66fa6a3b-4b3a-485f-819d-c671765eb915",
"tenant_id": "f33507157a634f1cac71e06a70fb558e",
"port_id": "a60d084b-5bac-489c-b549-7e651b577e36",
"network_id": "36a3666a-8ed4-48bf-9528-15f573c4a4f0",
"subnet_id": "b367fdf4-d111-4c4c-b8c2-ea5d484ac0fb",
"subnet_ids": [
"b367fdf4-d111-4c4c-b8c2-ea5d484ac0fb"
]
}

Status Codes

Success

Status CodeDescription
200 - OKRequest was successful.

Error

Status CodeDescription
400 - Bad RequestSome content in the request was invalid.
401 - UnauthorizedUser must authenticate before making a request.
404 - Not FoundThe requested resource could not be found.
409 - ConflictThis operation conflicted with another operation on this resource.