Remove Router Interface
/v2.0/routers/{router_id}/remove_router_interfaceDeletes 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.
Source: remove-interface-from-router
Request
Parameters
router_idstringrequiredpathThe ID of the router.
subnet_idstringbodyThe ID of the subnet. One of subnet_id or port_id must be specified.
port_idstringbodyThe ID of the port. One of subnet_id or port_id must be specified.
Sample Request
- cURL
- HTTP
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/
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
idstringrequiredThe ID of the resource.
subnet_idstringrequiredThe ID of the subnet which the router interface belongs to.
subnet_idsarrayrequiredA list containing the ID of the subnet which the router interface belongs to. Contains only one member.
network_idstringrequiredThe ID of the attached network.
port_idstringrequiredThe ID of the port which represents the router interface.
project_idstringrequiredThe ID of the project.
tenant_idstringrequiredThe ID of the project.
tagsarrayrequiredThe list of tags on the resource.
Sample Response
Response body
{
"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 Code | Description |
|---|---|
| 200 - OK | Request was successful. |
Error
| Status Code | Description |
|---|---|
| 400 - Bad Request | Some content in the request was invalid. |
| 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. |