/** * Evacuate the server * * @param serverId * The server to be evacuated * @return The evacuate action to be performed * @see #evacuate(String, String, String, Boolean) */ public EvacuateAction evacuate(String serverId) { return evacuate(serverId, null, null, null); }
/** * Evacuates the server to a new host. The caller can supply the host name or id. * * @param serverId * The server to be evacuated * @param host * The host name or ID of the target host (where the server is to be moved to). * @return The action to be performed * @see #evacuate(String, String, String, Boolean) */ public EvacuateAction evacuate(String serverId, String host) { return evacuate(serverId, host, null, null); }
/** * @see com.att.cdp.zones.ComputeService#moveServer(java.lang.String, java.lang.String) */ @Override public void moveServer(String serverId, String targetHostId) throws ZoneException { checkArg(serverId, "serverId"); connect(); trackRequest(); RequestState.put(RequestState.SERVER, serverId); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); try { if (targetHostId != null && targetHostId.length() > 0) { nova.getClient().servers().evacuate(serverId, targetHostId).execute(); } else { nova.getClient().servers().evacuate(serverId).execute(); } } catch (OpenStackBaseException ex) { ExceptionMapper.mapException(ex); } }
/** * @see com.att.cdp.zones.ComputeService#moveServer(java.lang.String, * java.lang.String) */ @Override public void moveServer(String serverId, String targetHostId) throws ZoneException { checkArg(serverId, "serverId"); connect(); Context context = getContext(); trackRequest(); RequestState.put(RequestState.SERVER, serverId); RequestState.put(RequestState.SERVICE, "Compute"); RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint()); try { if (targetHostId != null && targetHostId.length() > 0) { nova.getClient().servers().evacuate(serverId, targetHostId) .execute(); } else { nova.getClient().servers().evacuate(serverId).execute(); } } catch (OpenStackBaseException ex) { ExceptionMapper.mapException(ex); } }