@GET @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) public HostList listHosts(@QueryParam("tenant") final URI tid) throws DatabaseException {
  URI tenantId;
  StorageOSUser user=getUserFromContext();
  if (tid == null || StringUtils.isBlank(tid.toString())) {
    tenantId=URI.create(user.getTenantId());
  }
 else {
    tenantId=tid;
  }
  TenantOrg tenant=_permissionsHelper.getObjectById(tenantId,TenantOrg.class);
  ArgValidator.checkEntity(tenant,tenantId,isIdEmbeddedInURL(tenantId),true);
  verifyAuthorizedInTenantOrg(tenantId,user);
  HostList list=new HostList();
  list.setHosts(map(ResourceTypeEnum.HOST,listChildren(tenantId,Host.class,"label","tenant")));
  return list;
}

@ GET @ Produces ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) public HostList listHosts ( @ QueryParam ( "tenant" ) final URI tid ) throws DatabaseException { URI tenantId ; StorageOSUser user = getUserFromContext ( ) ; if ( tid == null || StringUtils . isBlank ( tid . toString ( ) ) ) { tenantId = URI . create ( user . getTenantId ( ) ) ; } else { tenantId = tid ; } TenantOrg tenant = _permissionsHelper . getObjectById ( tenantId , TenantOrg . class ) ; ArgValidator . checkEntity ( tenant , tenantId , isIdEmbeddedInURL ( tenantId ) , true ) ; verifyAuthorizedInTenantOrg ( tenantId , user ) ; HostList list = new HostList ( ) ; list . setHosts ( map ( ResourceTypeEnum . HOST , listChildren ( tenantId , Host . class , "label" , "tenant" ) ) ) ; return list ; }
lists the id and name for all the hosts that belong to the given tenant organization .
