return volume; } catch (OpenStackBaseException ex) { ex.printStackTrace(); ExceptionMapper.mapException(ex);
/** * Gets the ports connected to a specific server * * @throws ZoneException * If the server is null or invalid, if the context is closed, or if the context has not been * authenticated, or if the authentication has expired * @see com.att.cdp.zones.ComputeService#getPorts(com.att.cdp.zones.model.Server) */ @Override public List<Port> getPorts(Server server) throws ZoneException { checkArg(server, "server"); connect(); trackRequest(); RequestState.put(RequestState.SERVER, server.getId()); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); List<Port> list = new ArrayList<>(); try { InterfaceAttachments attachments = nova.getClient().servers().listInterfaceAttachments(server.getId()).execute(); for (InterfaceAttachment attachment : attachments.getList()) { OpenStackPort port = new OpenStackPort(getContext(), attachment); list.add(port); } } catch (OpenStackConnectException | OpenStackResponseException e) { // TODO Auto-generated catch block e.printStackTrace(); } return list; }