Class RouterServiceImpl

    • Constructor Detail

      • RouterServiceImpl

        public RouterServiceImpl()
    • 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:
        list in interface RouterService
        Returns:
        List of Routers or empty list
      • get

        public Router get​(String routerId)
        Gets a Router by ID
        Specified by:
        get in interface RouterService
        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:
        delete in interface RouterService
        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:
        create in interface RouterService
        Parameters:
        name - the name of the router
        adminStateUp - the initial administrative state
        Returns:
        the newly create router
      • create

        public Router create​(Router router)
        Creates a Router
        Specified by:
        create in interface RouterService
        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. See IdEntity.setId(String)

        Specified by:
        update in interface RouterService
        Parameters:
        router - the router to update
        Returns:
        the updated router
      • toggleAdminStateUp

        public Router toggleAdminStateUp​(String routerId,
                                         boolean adminStateUp)
        Description copied from interface: RouterService
        Toggles the Administrative state by Router ID
        Specified by:
        toggleAdminStateUp in interface RouterService
        Parameters:
        routerId - the router identifier
        adminStateUp - 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: RouterService
        Attaches a Subnet or Port to the specified router
        Specified by:
        attachInterface in interface RouterService
        Parameters:
        routerId - the router identifier
        type - the type of portOrSubnetId identifier
        portOrSubnetId - 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: RouterService
        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.
        Specified by:
        detachInterface in interface RouterService
        Parameters:
        routerId - the router identifier
        subnetId - the subnet identifier
        portId - the port identifier
        Returns:
        the router interface that was detached