Interface PortApi


  • @Beta
    @Path("/ports")
    @Consumes("application/json")
    public interface PortApi
    Provides access to Port operations for the OpenStack Networking (Neutron) v2 API.

    A port represents a virtual switch port on a logical network switch where all the interfaces attached to a given network are connected.

    A port has an administrative state which is either 'DOWN' or 'ACTIVE'. Ports which are administratively down will not be able to receive/send traffic.

    See Also:
    api doc
    • Method Detail

      • list

        @Named("port:list")
        @GET
        PagedIterable<Port> list()
        Returns the list of all ports currently defined in Neutron for the current tenant. The list provides the unique identifier of each network configured for the tenant.
        Returns:
        the list of all port references configured for the tenant
      • get

        @Named("port:get")
        @GET
        @Path("/{id}")
        @Nullable
        Port get​(@PathParam("id")
                 String id)
        Returns the specific port
        Parameters:
        id - the id of the port to return
        Returns:
        Port or null if not found
      • create

        @Named("port:create")
        @POST
        Port create​(Port.CreatePort port)
        Create a new port in the specified network
        Parameters:
        port - the port details
        Returns:
        a reference of the newly-created port
      • createBulk

        @Named("port:createBulk")
        @POST
        com.google.common.collect.FluentIterable<Port> createBulk​(List<Port.CreatePort> ports)
        Create multiple ports
        Parameters:
        ports - the bulk of ports to create
        Returns:
        list of references of the newly-created ports
      • update

        @Named("port:update")
        @PUT
        @Path("/{id}")
        Port update​(@PathParam("id")
                    String id,
                    Port.UpdatePort port)
        Update a port
        Parameters:
        id - the id of the port to update
        port - CreatePort with just the attributes to update
        Returns:
        true if update successful, false if not
      • delete

        @Named("port:delete")
        @DELETE
        @Path("/{id}")
        boolean delete​(@PathParam("id")
                       String id)
        Delete a port
        Parameters:
        id - the id of the port to delete
        Returns:
        true if delete successful, false if not