use of com.woorea.openstack.nova.model.ServerAction.Rebuild in project AJSC by att.
the class OpenStackComputeService method rebuildServer.
/**
* Rebuilds the server with the exact same image that it was currently built
* from.
*
* @see com.att.cdp.zones.ComputeService#rebuildServer(com.att.cdp.zones.model.Server)
*/
@SuppressWarnings("nls")
@Override
public void rebuildServer(Server server) throws ZoneException {
checkArg(server, "server");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVER, server.getId());
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
Rebuild rebuild = new Rebuild();
rebuild.setImageRef(server.getImage());
try {
nova.getClient().servers().rebuild(server.getId(), rebuild).execute();
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
use of com.woorea.openstack.nova.model.ServerAction.Rebuild in project AJSC by att.
the class OpenStackComputeService method rebuildServer.
/**
* Rebuilds the server with the exact same image that it was currently built from.
*
* @see com.att.cdp.zones.ComputeService#rebuildServer(com.att.cdp.zones.model.Server)
*/
@SuppressWarnings("nls")
@Override
public void rebuildServer(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());
Rebuild rebuild = new Rebuild();
rebuild.setImageRef(server.getImage());
try {
nova.getClient().servers().rebuild(server.getId(), rebuild).execute();
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
use of com.woorea.openstack.nova.model.ServerAction.Rebuild in project AJSC by att.
the class OpenStackComputeService method rebuildServer.
/**
* Rebuilds the server from a supplied snapshot
*
* @see com.att.cdp.zones.ComputeService#rebuildServer(com.att.cdp.zones.model.Server, java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public void rebuildServer(Server server, String snapshot) throws ZoneException {
checkArg(server, "server");
checkArg(snapshot, "snapshot");
connect();
trackRequest();
RequestState.put(RequestState.SERVER, server.getId());
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
Rebuild rebuild = new Rebuild();
rebuild.setImageRef(snapshot);
try {
nova.getClient().servers().rebuild(server.getId(), rebuild).execute();
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
use of com.woorea.openstack.nova.model.ServerAction.Rebuild in project AJSC by att.
the class OpenStackComputeService method rebuildServer.
/**
* Rebuilds the server from a supplied snapshot
*
* @param server
* The server to be re-built
* @param snapshot
* The snapshot or image id to be used to rebuild the server
* @throws ZoneException
* If the server cannot be rebuilt
*/
@SuppressWarnings("nls")
@Override
public void rebuildServer(Server server, String snapshot) throws ZoneException {
checkArg(server, "server");
checkArg(snapshot, "snapshot");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVER, server.getId());
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
Rebuild rebuild = new Rebuild();
rebuild.setImageRef(snapshot);
try {
nova.getClient().servers().rebuild(server.getId(), rebuild).execute();
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
Aggregations