/** * Detaches a port (interface) from a server * * @param serverId * The server to which the port is attached * @param portId * The port to be detached from the server * @return The object that performs the detach */ public DetachInterfaceAttachment detachInterfaceAttachment(String serverId, String portId) { return new DetachInterfaceAttachment(serverId, portId); }
/** * @see com.att.cdp.zones.ComputeService#detachPort(com.att.cdp.zones.model.Server, * com.att.cdp.zones.model.Port) */ @Override public void detachPort(Server server, Port port) throws ZoneException { checkArg(server, "server"); checkArg(port, "port"); connect(); trackRequest(); RequestState.put(RequestState.PORT, port.getId()); RequestState.put(RequestState.SERVER, server.getId()); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); try { nova.getClient().servers() .detachInterfaceAttachment(server.getId(), port.getId()) .execute(); } catch (OpenStackConnectException | OpenStackResponseException e) { ExceptionMapper.mapException(e); } }
/** * @see com.att.cdp.zones.ComputeService#detachPort(com.att.cdp.zones.model.Server, com.att.cdp.zones.model.Port) */ @Override public void detachPort(Server server, Port port) throws ZoneException { checkArg(server, "server"); checkArg(port, "port"); connect(); trackRequest(); RequestState.put(RequestState.PORT, port.getId()); RequestState.put(RequestState.SERVER, server.getId()); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); try { nova.getClient().servers().detachInterfaceAttachment(server.getId(), port.getId()).execute(); } catch (OpenStackConnectException | OpenStackResponseException e) { ExceptionMapper.mapException(e); } }