Search in sources :

Example 1 with ApiClusterList

use of com.cloudera.api.swagger.model.ApiClusterList in project tbd-studio-se by Talend.

the class HadoopCMConfigurator method getAllClusters.

/*
     * (non-Javadoc)
     *
     * @see org.talend.repository.hadoopcluster.configurator.HadoopConfigurator#getAllClusters()
     */
@Override
public List<String> getAllClusters() {
    List<String> names = new ArrayList<String>();
    ApiClusterList clusters;
    try {
        clusters = clusterAPI.readClusters(null, HadoopCMCluster.DEFAULT_VIEW_NAME);
        for (ApiCluster cluster : clusters.getItems()) {
            names.add(cluster.getDisplayName() + NAME_SEPARATOR + cluster.getName());
        }
    } catch (ApiException e) {
        throw new RuntimeException(e);
    }
    return names;
}
Also used : ApiClusterList(com.cloudera.api.swagger.model.ApiClusterList) ApiCluster(com.cloudera.api.swagger.model.ApiCluster) ArrayList(java.util.ArrayList) ApiException(com.cloudera.api.swagger.client.ApiException)

Aggregations

ApiException (com.cloudera.api.swagger.client.ApiException)1 ApiCluster (com.cloudera.api.swagger.model.ApiCluster)1 ApiClusterList (com.cloudera.api.swagger.model.ApiClusterList)1 ArrayList (java.util.ArrayList)1