use of com.dtstack.taier.pluginapi.pojo.ClusterResource in project Taier by DTStack.
the class ConsoleService method clusterResources.
public ClusterResource clusterResources(String clusterName) {
if (StringUtils.isEmpty(clusterName)) {
return new ClusterResource();
}
Cluster cluster = clusterMapper.getByClusterName(clusterName);
if (cluster == null) {
throw new RdosDefineException(ErrorCode.DATA_NOT_FIND);
}
Component yarnComponent = componentService.getComponentByClusterId(cluster.getId(), EComponentType.YARN.getTypeCode(), null);
if (yarnComponent == null) {
return null;
}
JSONObject yarnConfigStr = componentService.getComponentByClusterId(cluster.getId(), EComponentType.YARN.getTypeCode(), false, JSONObject.class, null);
return getResources(yarnComponent, cluster, yarnConfigStr);
}
Aggregations