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 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.
      • 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 update
        router - 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 at
        subnetId - 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 at
        portId - 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 from
        subnetId - 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 from
        portId - the id of the port to disconnect from the interface