use of com.att.cdp.openstack.model.OpenStackHypervisor in project AJSC by att.
the class OpenStackComputeService method getHypervisor.
/**
* @see com.att.cdp.zones.ComputeService#getHypervisor(java.lang.String)
*/
@Override
public Hypervisor getHypervisor(String id) throws ZoneException {
checkArg(id, "id");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.HYPERVISOR, id);
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
try {
com.woorea.openstack.nova.model.Hypervisor hypervisor = nova.getClient().hypervisors().show(id).execute();
return new OpenStackHypervisor(context, hypervisor);
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return null;
}
use of com.att.cdp.openstack.model.OpenStackHypervisor in project AJSC by att.
the class OpenStackComputeService method getHypervisors.
/**
* @see com.att.cdp.zones.ComputeService#getHypervisors()
*/
@Override
public List<Hypervisor> getHypervisors() throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
ArrayList<Hypervisor> list = new ArrayList<>();
try {
com.woorea.openstack.nova.model.Hypervisors hypervisors = nova.getClient().hypervisors().list(true).execute();
for (com.woorea.openstack.nova.model.Hypervisor h : hypervisors.getList()) {
list.add(new OpenStackHypervisor(context, h));
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
use of com.att.cdp.openstack.model.OpenStackHypervisor in project AJSC by att.
the class OpenStackComputeService method getHypervisors.
/**
* @see com.att.cdp.zones.ComputeService#getHypervisors(java.lang.String)
*/
@Override
public List<Hypervisor> getHypervisors(String id) throws ZoneException {
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
RequestState.put(RequestState.HYPERVISOR, id);
ArrayList<Hypervisor> list = new ArrayList<>();
try {
com.woorea.openstack.nova.model.Hypervisors hypervisors = nova.getClient().hypervisors().list(true).execute();
for (com.woorea.openstack.nova.model.Hypervisor h : hypervisors.getList()) {
if (id != null) {
if (h.getId().matches(id)) {
list.add(new OpenStackHypervisor(context, h));
}
} else {
list.add(new OpenStackHypervisor(context, h));
}
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
Aggregations