Interface RouterApi
@Beta
@Path("/routers")
@Consumes("application/json")
public interface RouterApi
Provides access to Router operations for the OpenStack Networking (Neutron) v2 API.
A logical entity for forwarding packets across internal subnets and NATting them on external
networks through an appropriate external gateway.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionaddInterfaceForPort
(String routerId, String portId) Add a interface to a router to connect to the specified portaddInterfaceForSubnet
(String routerId, String subnetId) Add a interface to a router to connect to the specified subnetcreate
(Router.CreateRouter router) Create a new routerboolean
Deletes the specified routerReturns a Routers collection that should contain a single router with the id requested.list()
Returns the list of all routers currently defined in Neutron for the current tenant.list
(PaginationOptions options) boolean
removeInterfaceForPort
(String routerId, String portId) Remove the interface where the specified port is connected toboolean
removeInterfaceForSubnet
(String routerId, String subnetId) Remove the interface where the specified subnet is connected toupdate
(String id, Router.UpdateRouter router) Update a router
-
Method Details
-
list
Returns the list of all routers currently defined in Neutron for the current tenant. The list provides the unique identifier of each router configured for the tenant- Returns:
- the list of all router references configured for the tenant.
-
list
- See Also:
-
get
Returns a Routers collection that should contain a single router with the id requested.- Parameters:
id
- the id of the router to return- Returns:
- Routers collection or empty if not found
-
create
Create a new router- Parameters:
router
- Options for creating a router- Returns:
- the newly created router
-
update
@Named("router:update") @PUT @Path("/{id}") Router update(@PathParam("id") String id, Router.UpdateRouter router) Update a router- Parameters:
id
- the id of the router to updaterouter
- Contains only the attributes to update- Returns:
- The modified router
-
delete
Deletes the specified router- Parameters:
id
- the id of the router to delete- Returns:
- true if delete successful, false if not
-
addInterfaceForSubnet
@Named("router:addInterfaceForSubnet") @PUT @Path("/{id}/add_router_interface") RouterInterface addInterfaceForSubnet(@PathParam("id") String routerId, String subnetId) Add a interface to a router to connect to the specified subnet- Parameters:
routerId
- the id of the router to create the interface atsubnetId
- the id of the subnet to connect with the interface- Returns:
- the newly-created router interface
-
addInterfaceForPort
@Named("router:addInterfaceForPort") @PUT @Path("/{id}/add_router_interface") RouterInterface addInterfaceForPort(@PathParam("id") String routerId, String portId) Add a interface to a router to connect to the specified port- Parameters:
routerId
- the id of the router to create the interface atportId
- the id of the port to connect with the interface- Returns:
- the newly-created router interface
-
removeInterfaceForSubnet
@Named("router:removeInterfaceForSubnet") @PUT @Path("/{id}/remove_router_interface") boolean removeInterfaceForSubnet(@PathParam("id") String routerId, String subnetId) Remove the interface where the specified subnet is connected to- Parameters:
routerId
- the id of the router to remove the interface fromsubnetId
- the id of the subnet to disconnect from the interface
-
removeInterfaceForPort
@Named("router:removeInterfaceForPort") @PUT @Path("/{id}/remove_router_interface") boolean removeInterfaceForPort(@PathParam("id") String routerId, String portId) Remove the interface where the specified port is connected to- Parameters:
routerId
- the id of the router to remove the interface fromportId
- the id of the port to disconnect from the interface
-