Class RouterServiceImpl
- java.lang.Object
-
- org.openstack4j.openstack.internal.BaseOpenStackService
-
- org.openstack4j.openstack.networking.internal.BaseNetworkingServices
-
- org.openstack4j.openstack.networking.internal.RouterServiceImpl
-
- All Implemented Interfaces:
RouterService,RestService
public class RouterServiceImpl extends BaseNetworkingServices implements RouterService
RouterService implementation that provides Neutron Router based Service Operations.- Author:
- Jeremy Unruh
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstack4j.openstack.internal.BaseOpenStackService
BaseOpenStackService.Invocation<R>
-
-
Constructor Summary
Constructors Constructor Description RouterServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete 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.-
Methods inherited from class org.openstack4j.openstack.internal.BaseOpenStackService
delete, deleteWithResponse, get, getProvider, getServiceVersion, getWithResponse, getXOpenstackRequestId, head, patch, patchWithResponse, post, postWithResponse, put, putWithResponse, request, toList, uri
-
-
-
-
Method Detail
-
list
public 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.- Specified by:
listin interfaceRouterService- Returns:
- List of Routers or empty list
-
get
public Router get(String routerId)
Gets a Router by ID- Specified by:
getin interfaceRouterService- Parameters:
routerId- the router identifier- Returns:
- Router or null if not found
-
delete
public ActionResponse delete(String routerId)
Deletes the specified Router by ID- Specified by:
deletein interfaceRouterService- Parameters:
routerId- the router identifier to delete- Returns:
- the action response
-
create
public Router create(String name, boolean adminStateUp)
Creates a basic router with minimal params- Specified by:
createin interfaceRouterService- Parameters:
name- the name of the routeradminStateUp- the initial administrative state- Returns:
- the newly create router
-
create
public Router create(Router router)
Creates a Router- Specified by:
createin interfaceRouterService- Parameters:
router- the router to create- Returns:
- the newly created router
-
update
public 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)- Specified by:
updatein interfaceRouterService- Parameters:
router- the router to update- Returns:
- the updated router
-
toggleAdminStateUp
public Router toggleAdminStateUp(String routerId, boolean adminStateUp)
Description copied from interface:RouterServiceToggles the Administrative state by Router ID- Specified by:
toggleAdminStateUpin interfaceRouterService- Parameters:
routerId- the router identifieradminStateUp- true to enable the administrative state up- Returns:
- the updated router
-
attachInterface
public RouterInterface attachInterface(String routerId, AttachInterfaceType type, String portOrSubnetId)
Description copied from interface:RouterServiceAttaches a Subnet or Port to the specified router- Specified by:
attachInterfacein interfaceRouterService- Parameters:
routerId- the router identifiertype- the type ofportOrSubnetIdidentifierportOrSubnetId- the port or subnet identifier- Returns:
- the newly created router interface
-
detachInterface
public RouterInterface detachInterface(String routerId, String subnetId, String portId)
Description copied from interface:RouterServiceRemoves 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.- Specified by:
detachInterfacein interfaceRouterService- Parameters:
routerId- the router identifiersubnetId- the subnet identifierportId- the port identifier- Returns:
- the router interface that was detached
-
-