@Override public void run() { Server checked = IaasOpenstack.this.novaClient.servers().show(server.getId()).execute(); if("ACTIVE".equals(checked.getStatus())) { timer.shutdown(); } } }, 10, 5, TimeUnit.SECONDS);
logger.info(new Date().toString()+ " " +logId+":OpenStackComputeService.refreshServerStatus() -mapServerStatus - in"); ((OpenStackServer) server).mapServerStatus(nova.getClient().servers().show(server.getId()).execute()); logger.info(new Date().toString()+ " " +logId+":OpenStackComputeService.refreshServerStatus() -mapServerStatus - out"); } catch (OpenStackBaseException ex) {
@SuppressWarnings("nls") @Override public void refreshServerStatus(Server server) throws ZoneException { checkArg(server, "server"); connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.SERVER, server); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); try { ((OpenStackServer) server).mapServerStatus(nova.getClient() .servers().show(server.getId()).execute()); } catch (OpenStackBaseException ex) { ExceptionMapper.mapException(ex); } }
/** * Returns the indicated host using the specified identification token * * @param id * The identification of the server * @return The server * @throws ZoneException * - If the host cannot be found * @see com.att.cdp.zones.ComputeService#getServer(java.lang.String) */ @SuppressWarnings("nls") @Override public Server getServer(String id) throws ZoneException { checkArg(id, "id"); connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.SERVER, id); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); try { com.woorea.openstack.nova.model.Server s = nova.getClient().servers().show(id).execute(); return new OpenStackServer(context, s); } catch (OpenStackBaseException ex) { ExceptionMapper.mapException(ex); } return null; // for the compiler }
/** * Returns the indicated host using the specified identification token * * @param id * The identification of the server * @return The server * @throws ZoneException * - If the host cannot be found * @see com.att.cdp.zones.ComputeService#getServer(java.lang.String) */ @SuppressWarnings("nls") @Override public Server getServer(String id) throws ZoneException { checkArg(id, "id"); connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.SERVER, id); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); try { com.woorea.openstack.nova.model.Server s = nova.getClient() .servers().show(id).execute(); return new OpenStackServer(context, s); } catch (OpenStackBaseException ex) { ExceptionMapper.mapException(ex); } return null; // for the compiler }