Package org.openstack4j.api.networking
Interface RouterService
-
- All Superinterfaces:
RestService
- All Known Implementing Classes:
RouterServiceImpl
public interface RouterService extends RestService
Provides Neutron Router based Service Operations- Author:
- Jeremy Unruh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RouterInterfaceattachInterface(String routerId, AttachInterfaceType type, String portOrSubnetId)Attaches a Subnet or Port to the specified routerRoutercreate(String name, boolean adminStateUp)Creates a basic router with minimal paramsRoutercreate(Router router)Creates a RouterActionResponsedelete(String routerId)Deletes the specified Router by IDRouterInterfacedetachInterface(String routerId, String subnetId, String portId)Removes an internal router interface, which detaches a subnet from the router.Routerget(String routerId)Gets a Router by IDList<? extends Router>list()This operation returns a list of routers to which the tenant has access.RoutertoggleAdminStateUp(String routerId, boolean adminStateUp)Toggles the Administrative state by Router IDRouterupdate(Router router)Updates a Router.
-
-
-
Method Detail
-
list
List<? extends Router> list()
This operation returns a list of routers to which the tenant has access. Default policy settings return only those routers that are owned by the tenant who submits the request, unless the request is submitted by an user with administrative rights.- Returns:
- List of Routers or empty list
-
get
Router get(String routerId)
Gets a Router by ID- Parameters:
routerId- the router identifier- Returns:
- Router or null if not found
-
delete
ActionResponse delete(String routerId)
Deletes the specified Router by ID- Parameters:
routerId- the router identifier to delete- Returns:
- the action response
-
create
Router create(String name, boolean adminStateUp)
Creates a basic router with minimal params- Parameters:
name- the name of the routeradminStateUp- the initial administrative state- Returns:
- the newly create router
-
create
Router create(Router router)
Creates a Router- Parameters:
router- the router to create- Returns:
- the newly created router
-
update
Router update(Router router)
Updates a Router. Based on the OpenStack API documentation only [ name, admin_state_up and external_gateway_info ] will be updated.NOTE: The router identifier must be set in the
router. SeeIdEntity.setId(String)- Parameters:
router- the router to update- Returns:
- the updated router
-
toggleAdminStateUp
Router toggleAdminStateUp(String routerId, boolean adminStateUp)
Toggles the Administrative state by Router ID- Parameters:
routerId- the router identifieradminStateUp- true to enable the administrative state up- Returns:
- the updated router
-
attachInterface
RouterInterface attachInterface(String routerId, AttachInterfaceType type, String portOrSubnetId)
Attaches a Subnet or Port to the specified router- Parameters:
routerId- the router identifiertype- the type ofportOrSubnetIdidentifierportOrSubnetId- the port or subnet identifier- Returns:
- the newly created router interface
-
detachInterface
RouterInterface detachInterface(String routerId, String subnetId, String portId)
Removes an internal router interface, which detaches a subnet from the router. Either a subnet or port is allowed to be set and or both. At least one subnet or port identifier must be set or else a validation exception will be thrown.- Parameters:
routerId- the router identifiersubnetId- the subnet identifierportId- the port identifier- Returns:
- the router interface that was detached
- Throws:
ClientResponseException- if one of the specified identifiers does not exist
-
-