use of com.att.cdp.zones.Context in project AJSC by att.
the class OpenStackComputeService method associateACL.
/**
* @see com.att.cdp.zones.ComputeService#associateACL(java.lang.String,
* java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public void associateACL(String serverId, String aclName) throws ZoneException {
checkArg(serverId, "serverId");
checkArg(aclName, "aclName");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVER, serverId);
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
try {
nova.getClient().servers().associateSecurityGroup(serverId, aclName).execute();
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
use of com.att.cdp.zones.Context in project AJSC by att.
the class OpenStackComputeService method stopServer.
/**
* Stops the indicated server
*
* @param id
* The id of the server to be stopped
* @throws ZoneException
* If the server is in an invalid state or it does not exist.
* @see com.att.cdp.zones.ComputeService#stopServer(java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public void stopServer(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 {
nova.getClient().servers().stop(id).execute();
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
use of com.att.cdp.zones.Context in project AJSC by att.
the class OpenStackComputeService method resumeServer.
/**
* @see com.att.cdp.zones.ComputeService#resumeServer(java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public void resumeServer(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 {
nova.getClient().servers().resume(id).execute();
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
use of com.att.cdp.zones.Context 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.att.cdp.zones.Context 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();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVER, serverId);
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
try {
nova.getClient().servers().migrate(serverId).execute();
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
Aggregations