use of com.emc.sa.service.vipr.compute.tasks.FindHostsInCluster in project coprhd-controller by CoprHD.
the class ComputeUtils method findHostNamesInCluster.
/**
* Returns list of hostNames already in this cluster
* @param Cluster
* @return list of hostNames
*/
public static List<String> findHostNamesInCluster(Cluster cluster) {
if (cluster == null) {
return Collections.emptyList();
}
List<HostRestRep> hostRestReps = execute(new FindHostsInCluster(cluster.getId(), cluster.getLabel()));
List<String> hostNames = Lists.newArrayList();
if (hostRestReps != null) {
for (HostRestRep hostRestRep : hostRestReps) {
hostNames.add(hostRestRep.getHostName());
}
}
return hostNames;
}
Aggregations