use of com.woorea.openstack.base.client.OpenStackResponse in project AJSC by att.
the class OpenStackComputeService method processResize.
/**
* @see com.att.cdp.zones.ComputeService#processResize(com.att.cdp.zones.model.Server)
*/
@SuppressWarnings("nls")
@Override
public void processResize(Server server) throws ZoneException {
checkArg(server, "server");
checkArg(server.getId(), "server id");
connect();
trackRequest();
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
try {
OpenStackResponse request = nova.getClient().servers().confirmResize(server.getId()).request();
if (request != null && request.getStatus() != Status.NO_CONTENT.getStatusCode()) {
throw new ZoneException(request.getEntity(String.class));
}
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
use of com.woorea.openstack.base.client.OpenStackResponse in project AJSC by att.
the class OpenStackComputeService method abortResize.
/**
* @see com.att.cdp.zones.ComputeService#abortResize(com.att.cdp.zones.model.Server)
*/
@SuppressWarnings("nls")
@Override
public void abortResize(Server server) throws ZoneException {
checkArg(server, "server");
checkArg(server.getId(), "server id");
connect();
trackRequest();
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
try {
OpenStackResponse request = nova.getClient().servers().revertResize(server.getId()).request();
if (request != null && request.getStatus() != Status.ACCEPTED.getStatusCode()) {
throw new ZoneException(request.getEntity(String.class));
}
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
use of com.woorea.openstack.base.client.OpenStackResponse in project AJSC by att.
the class OpenStackComputeService method migrateServer.
/**
* @see com.att.cdp.zones.ComputeService#migrateServer(java.lang.String)
*/
@Override
public void migrateServer(String serverId) 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 {
OpenStackResponse response = nova.getClient().servers().migrate(serverId).request();
if (response == null || response.getStatus() != Status.ACCEPTED.getStatusCode()) {
throw new ZoneException(response.getEntity(String.class));
}
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
use of com.woorea.openstack.base.client.OpenStackResponse in project AJSC by att.
the class OpenStackComputeService method abortResize.
/**
* @see com.att.cdp.zones.ComputeService#abortResize(com.att.cdp.zones.model.Server)
*/
@SuppressWarnings("nls")
@Override
public void abortResize(Server server) throws ZoneException {
checkArg(server, "server");
checkArg(server.getId(), "server id");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
try {
OpenStackResponse request = nova.getClient().servers().revertResize(server.getId()).request();
if (request != null && request.getStatus() != Status.ACCEPTED.getStatusCode()) {
throw new ZoneException(request.getEntity(String.class));
}
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
Aggregations