Search in sources :

Example 1 with FindHostsInCluster

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;
}
Also used : HostRestRep(com.emc.storageos.model.host.HostRestRep) FindHostsInCluster(com.emc.sa.service.vipr.compute.tasks.FindHostsInCluster)

Aggregations

FindHostsInCluster (com.emc.sa.service.vipr.compute.tasks.FindHostsInCluster)1 HostRestRep (com.emc.storageos.model.host.HostRestRep)1