Search in sources :

Example 1 with DiskBean

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;
}
Also used : DiskBean(com.huawei.esight.service.bean.DiskBean) ArrayList(java.util.ArrayList) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey)

Aggregations

DiskBean (com.huawei.esight.service.bean.DiskBean)1 ResourceKey (com.integrien.alive.common.adapter3.ResourceKey)1 ArrayList (java.util.ArrayList)1