@Test public void testDeleteVirtualPort() { NetworkId networkId = networkId3; DeviceId deviceId = devId2; PortNumber portNum = portNumber(2); mockVnetAdminService.removeVirtualPort(networkId, deviceId, portNum); expectLastCall(); replay(mockVnetAdminService); WebTarget wt = target() .property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); String reqLocation = "vnets/" + networkId.toString() + "/devices/" + deviceId.toString() + "/ports/" + portNum.toLong(); Response response = wt.path(reqLocation) .request(MediaType.APPLICATION_JSON_TYPE) .delete(); assertThat(response.getStatus(), is(HttpURLConnection.HTTP_NO_CONTENT)); verify(mockVnetAdminService); }
@DELETE @Path("{networkId}/devices/{deviceId}/ports/{portNum}") public Response removeVirtualPort(@PathParam("networkId") long networkId, @PathParam("deviceId") String deviceId, @PathParam("portNum") long portNum) { NetworkId nid = NetworkId.networkId(networkId); vnetAdminService.removeVirtualPort(nid, DeviceId.deviceId(deviceId), PortNumber.portNumber(portNum)); return Response.noContent().build(); }
VirtualNetworkWebResource extends AbstractWebResource { @DELETE @Path("{networkId}/devices/{deviceId}/ports/{portNum}") public Response removeVirtualPort(@PathParam("networkId") long networkId, @PathParam("deviceId") String deviceId, @PathParam("portNum") long portNum) { NetworkId nid = NetworkId.networkId(networkId); vnetAdminService.removeVirtualPort(nid, DeviceId.deviceId(deviceId), PortNumber.portNumber(portNum)); return Response.noContent().build(); } }
VirtualNetworkWebResource extends AbstractWebResource { @DELETE @Path("{networkId}/devices/{deviceId}/ports/{portNum}") public Response removeVirtualPort(@PathParam("networkId") long networkId, @PathParam("deviceId") String deviceId, @PathParam("portNum") long portNum) { NetworkId nid = NetworkId.networkId(networkId); vnetAdminService.removeVirtualPort(nid, DeviceId.deviceId(deviceId), PortNumber.portNumber(portNum)); return Response.noContent().build(); }  }
VirtualNetworkWebResource extends AbstractWebResource { @DELETE @Path("{networkId}/devices/{deviceId}/ports/{portNum}") public Response removeVirtualPort(@PathParam("networkId") long networkId, @PathParam("deviceId") String deviceId, @PathParam("portNum") long portNum) { NetworkId nid = NetworkId.networkId(networkId); vnetAdminService.removeVirtualPort(nid, DeviceId.deviceId(deviceId), PortNumber.portNumber(portNum)); return Response.noContent().build(); }  @GET @Produces(MediaType.APPLICATION_JSON) Response getVirtualNetworks(); @GET @Produces(MediaType.APPLICATION_JSON) @Path("{tenantId}") Response getVirtualNetworkById(@PathParam("tenantId") String tenantId); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response createVirtualNetwork(InputStream stream); @DELETE @Path("{networkId}") Response removeVirtualNetwork(@PathParam("networkId") long networkId); @GET @Produces(MediaType.APPLICATION_JSON) @Path("{networkId}/devices") Response getVirtualDevices(@PathParam("networkId") long networkId); @POST @Path("{networkId}/devices") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response createVirtualDevice(@PathParam("networkId") long networkId,
                                        InputStream stream); @DELETE @Path("{networkId}/devices/{deviceId}") Response removeVirtualDevice(@PathParam("networkId") long networkId,
                                        @PathParam("deviceId") String deviceId); @GET @Produces(MediaType.APPLICATION_JSON) @Path("{networkId}/devices/{deviceId}/ports") Response getVirtualPorts(@PathParam("networkId") long networkId,
                                    @PathParam("deviceId") String deviceId); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Path("{networkId}/devices/{deviceId}/ports") Response createVirtualPort(@PathParam("networkId") long networkId,
                                      @PathParam("deviceId") String virtDeviceId,
                                      InputStream stream); @DELETE @Path("{networkId}/devices/{deviceId}/ports/{portNum}") Response removeVirtualPort(@PathParam("networkId") long networkId,
                                      @PathParam("deviceId") String deviceId,
                                      @PathParam("portNum") long portNum); @GET @Produces(MediaType.APPLICATION_JSON) @Path("{networkId}/links") Response getVirtualLinks(@PathParam("networkId") long networkId); @POST @Path("{networkId}/links") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response createVirtualLink(@PathParam("networkId") long networkId,
                                      InputStream stream); @DELETE @Path("{networkId}/links") @Consumes(MediaType.APPLICATION_JSON) Response removeVirtualLink(@PathParam("networkId") long networkId,
                                      InputStream stream); }
VirtualNetworkWebResource extends AbstractWebResource { @DELETE @Path("{networkId}/devices/{deviceId}/ports/{portNum}") public Response removeVirtualPort(@PathParam("networkId") long networkId, @PathParam("deviceId") String deviceId, @PathParam("portNum") long portNum) { NetworkId nid = NetworkId.networkId(networkId); vnetAdminService.removeVirtualPort(nid, DeviceId.deviceId(deviceId), PortNumber.portNumber(portNum)); return Response.noContent().build(); }  @GET @Produces(MediaType.APPLICATION_JSON) Response getVirtualNetworks(); @GET @Produces(MediaType.APPLICATION_JSON) @Path("{tenantId}") Response getVirtualNetworkById(@PathParam("tenantId") String tenantId); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response createVirtualNetwork(InputStream stream); @DELETE @Path("{networkId}") Response removeVirtualNetwork(@PathParam("networkId") long networkId); @GET @Produces(MediaType.APPLICATION_JSON) @Path("{networkId}/devices") Response getVirtualDevices(@PathParam("networkId") long networkId); @POST @Path("{networkId}/devices") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response createVirtualDevice(@PathParam("networkId") long networkId,
                                        InputStream stream); @DELETE @Path("{networkId}/devices/{deviceId}") Response removeVirtualDevice(@PathParam("networkId") long networkId,
                                        @PathParam("deviceId") String deviceId); @GET @Produces(MediaType.APPLICATION_JSON) @Path("{networkId}/devices/{deviceId}/ports") Response getVirtualPorts(@PathParam("networkId") long networkId,
                                    @PathParam("deviceId") String deviceId); @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Path("{networkId}/devices/{deviceId}/ports") Response createVirtualPort(@PathParam("networkId") long networkId,
                                      @PathParam("deviceId") String virtDeviceId,
                                      InputStream stream); @DELETE @Path("{networkId}/devices/{deviceId}/ports/{portNum}") Response removeVirtualPort(@PathParam("networkId") long networkId,
                                      @PathParam("deviceId") String deviceId,
                                      @PathParam("portNum") long portNum); @GET @Produces(MediaType.APPLICATION_JSON) @Path("{networkId}/links") Response getVirtualLinks(@PathParam("networkId") long networkId); @POST @Path("{networkId}/links") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) Response createVirtualLink(@PathParam("networkId") long networkId,
                                      InputStream stream); @DELETE @Path("{networkId}/links") @Consumes(MediaType.APPLICATION_JSON) Response removeVirtualLink(@PathParam("networkId") long networkId,
                                      InputStream stream);  }