use of com.cloudera.api.model.ApiRoleList in project kylo by Teradata.
the class DefaultClouderaRootResource method getPopulatedClusterList.
/**
* @return cluster list with initialised service health status
*/
public ApiClusterList getPopulatedClusterList() {
ApiClusterList clusters = rootResource.getClustersResource().readClusters(DataView.SUMMARY);
if (clusters != null && clusters.getClusters() != null) {
for (ApiCluster cluster : clusters.getClusters()) {
String clusterName = cluster.getName();
ApiServiceList services = rootResource.getClustersResource().getServicesResource(clusterName).readServices(DataView.SUMMARY);
if (services != null && services.getServices() != null) {
cluster.setServices(services.getServices());
for (ApiService service : services.getServices()) {
String serviceName = service.getName();
ApiHealthSummary healthSummary = service.getHealthSummary();
List<ApiHealthCheck> healthChecks = service.getHealthChecks();
service.setHealthChecks(healthChecks);
service.setHealthSummary(healthSummary);
ApiRoleList roles = rootResource.getClustersResource().getServicesResource(clusterName).getRolesResource(serviceName).readRoles();
if (roles != null && roles.getRoles() != null) {
service.setRoles(roles.getRoles());
for (ApiRole role : roles.getRoles()) {
ApiHealthSummary roleHealthSummary = role.getHealthSummary();
List<ApiHealthCheck> roleHealthChecks = role.getHealthChecks();
role.setHealthSummary(roleHealthSummary);
role.setHealthChecks(roleHealthChecks);
}
}
}
}
}
}
return clusters;
}
Aggregations