• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Neutron
  5. Routers
  6. Add interface to router

Add interface to router

Function Description

This interface is used to add a router interface.

Interface Format

Method

URI

Description

PUT

/v2.0/routers/{router_id}/add_router_interface

Adds a router interface.

Restrictions

  • When a port is used, the port must and can have only one IP address.
  • When a subnet is used, the gateway IP address must be configured in the subnet.

Request Parameter

Parameter

Type

Mandatory

Description

subnet_id

uuid-str

No

Specifies that the subnet gateway IP address is used to create a router interface. Either subnet_id or port_id is used.

port_id

uuid-str

No

Specifies that the port IP address is used to create a router interface. Either subnet_id or port_id is used.

Response Parameter

Parameter

Type

Mandatory

Description

subnet_id

uuid-str

Yes

Specifies the subnet ID.

tenant_id

uuid-str

Yes

Specifies the tenant ID.

port_id

uuid-str

Yes

Specifies the port ID.

id

uuid-str

Yes

Specifies the router ID.

Request Example

PUT /v2.0/routers/5b8e885c-1347-4ac2-baf9-2249c8ed1270/add_router_interface
{"subnet_id": "ab78be2d-782f-42a5-aa72-35879f6890ff"}

Response Example

{
    "subnet_id": "ab78be2d-782f-42a5-aa72-35879f6890ff",
    "tenant_id": "6fbe9263116a4b68818cf1edce16bc4f",
    "port_id": "40e86635-b2a3-45de-a7c8-3cced5b7e755",
    "id": "5b8e885c-1347-4ac2-baf9-2249c8ed1270"
}

Error Code

For details, see section Return Code Processing.