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:
- api doc, neutron extensions
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RouterInterface
addInterfaceForPort(String routerId, String portId)
Add a interface to a router to connect to the specified portRouterInterface
addInterfaceForSubnet(String routerId, String subnetId)
Add a interface to a router to connect to the specified subnetRouter
create(Router.CreateRouter router)
Create a new routerboolean
delete(String id)
Deletes the specified routerRouter
get(String id)
Returns a Routers collection that should contain a single router with the id requested.PagedIterable<Router>
list()
Returns the list of all routers currently defined in Neutron for the current tenant.Routers
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 toRouter
update(String id, Router.UpdateRouter router)
Update a router
-
-
-
Method Detail
-
list
@Named("router:list") @GET PagedIterable<Router> 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
@Named("router:list") @GET Routers list(PaginationOptions options)
- See Also:
- api doc
-
get
@Named("router:get") @GET @Path("/{id}") @Nullable Router get(@PathParam("id") String id)
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
@Named("router:create") @POST Router create(Router.CreateRouter router)
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
@Named("router:delete") @DELETE @Path("/{id}") boolean delete(@PathParam("id") String id)
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
-
-