use of com.att.cdp.openstack.model.OpenStackVirtualInterface in project AJSC by att.
the class OpenStackComputeService method getVirtualInterfaces.
/**
* This method returns a list of OS Virtual Interfaces for a specified server instance.
* <p>
* This includes the ID for the virtual interface as well as the associated mac address.
* </p>
*
* @return A list of virtual interfaces
* @throws ZoneException
* If the virtual interfaces cannot be listed
* @see com.att.cdp.zones.ComputeService#getVirtualInterfaces(java.lang.String)
*/
@SuppressWarnings("nls")
@Override
public List<VirtualInterface> getVirtualInterfaces(String id) throws ZoneException {
checkArg(id, "id");
connect();
Context context = getContext();
trackRequest();
RequestState.put(RequestState.SERVICE, "Compute");
RequestState.put(RequestState.SERVICE_URL, nova.getEndpoint());
ArrayList<VirtualInterface> list = new ArrayList<>();
try {
com.woorea.openstack.nova.model.VirtualInterfaces virtualInterfaces = nova.getClient().servers().listVirtualInterfaces(id).execute();
for (com.woorea.openstack.nova.model.VirtualInterface vi : virtualInterfaces.getList()) {
VirtualInterface virtualInterface = new OpenStackVirtualInterface(context, vi);
list.add(virtualInterface);
}
} catch (OpenStackBaseException e) {
ExceptionMapper.mapException(e);
}
return list;
}
Aggregations