use of com.huawei.esight.service.bean.DiskBean in project Server_Management_Plugin_vRealize by Huawei.
the class ESightAdapter method setDisk.
private List<ResourceKey> setDisk(String host, List<ResourceKey> allResourceList, ServerDeviceBean deviceBean, ServerDeviceDetailBean device) {
List<ResourceKey> deviceChildKeys = new ArrayList<>();
List<DiskBean> diskBeans = device.getDisk();
if (!diskBeans.isEmpty()) {
List<ResourceKey> diskResourceKey = new ArrayList<>();
List<String> childHealthList = new ArrayList<>();
for (DiskBean disk : diskBeans) {
ResourceKey key = disk.convert2Resource(host + deviceBean.getDn(), getAdapterKind(), metricsByResource);
diskResourceKey.add(key);
allResourceList.add(key);
childHealthList.add(ConvertUtils.convertHealthState(disk.getHealthState()));
}
// disk Group
ResourceKey diskGroup = device.createGroupKey(Constant.TREE_DISK_GROUP, Constant.KIND_DISK_GROUP, diskResourceKey, relationshipsByResource, getAdapterKind());
deviceChildKeys.add(diskGroup);
// add health state here
setHealStatus4GroupObject(diskGroup, Constant.ATTR_HEALTHSTATE, childHealthList);
}
return deviceChildKeys;
}
Aggregations