use of com.att.cdp.zones.Context in project AJSC by att.
the class OpenStackComputeService method prepareResize.
/**
* @see com.att.cdp.zones.ComputeService#prepareResize(com.att.cdp.zones.model.Server,
* java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public void prepareResize(Server server, Template newTemplate) throws ZoneException {
checkArg(server, "server");
checkArg(server.getId(), "server id");
checkArg(newTemplate, "template");
checkArg(newTemplate.getId(), "template id");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
try {
nova.getClient().servers().resize(server.getId(), newTemplate.getId(), null).execute();
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
use of com.att.cdp.zones.Context in project AJSC by att.
the class OpenStackComputeService method getExtensions.
/**
* Returns the set of extensions loaded, if any
*
* @return The list of extensions installed, if any
* @throws ZoneException
* If anything fails
*/
public List<String> getExtensions() throws ZoneException {
connect();
Context context = getContext();
ArrayList<String> extensions = new ArrayList<>();
trackRequest();
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
try {
for (Extension extension : nova.getClient().extensions().list(true).execute()) {
extensions.add(extension.getName());
}
} catch (OpenStackBaseException e) {
if (e instanceof OpenStackResponseException) {
OpenStackResponseException osre = (OpenStackResponseException) e;
if (osre.getStatus() != 404) {
ExceptionMapper.mapException(e);
}
} else {
ExceptionMapper.mapException(e);
}
}
return extensions;
}
use of com.att.cdp.zones.Context in project AJSC by att.
the class OpenStackComputeService method getAccessControlList.
/**
* @see com.att.cdp.zones.ComputeService#getAccessControlList(java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public ACL getAccessControlList(String id) throws ZoneException {
checkArg(id, "id");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
try {
SecurityGroup group = nova.getClient().securityGroups().showSecurityGroup(id).execute();
return new OpenStackACL(context, group);
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
return null;
}
use of com.att.cdp.zones.Context in project AJSC by att.
the class OpenStackComputeService method unpauseServer.
/**
* @see com.att.cdp.zones.ComputeService#unpauseServer(java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public void unpauseServer(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().unpause(id).execute();
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
use of com.att.cdp.zones.Context in project AJSC by att.
the class OpenStackComputeService method deleteACLRule.
/**
* @see com.att.cdp.zones.ComputeService#deleteACLRule(java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public void deleteACLRule(Rule rule) throws ZoneException {
checkArg(rule, "rule");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
try {
nova.getClient().securityGroups().deleteSecurityGroupRule(rule.getId()).execute();
} catch (OpenStackBaseException ex) {
ExceptionMapper.mapException(ex);
}
}
Aggregations