Let “host” be the Host object.
// get Host list from the datacenter.
getHostList();
int size = getHostList().size();
for(int i=0; i<size; i++)
{
host = getHostList().get(j); // get each Host from the list
int hid = host.getId();
double mip = host.getAvailableMips(); //retrieves the available Cpu capacity
long band = host.getBw(); //retrieves the available Bandwidth capacity
long st = host.getStorage(); //retrieves the available Storage capacity
}