Search in sources :

Example 1 with PCIEBean

use of com.huawei.esight.service.bean.PCIEBean in project Server_Management_Plugin_vRealize by Huawei.

the class ESightAdapter method setPcie.

private List<ResourceKey> setPcie(String host, List<ResourceKey> allResourceList, ServerDeviceBean deviceBean, ServerDeviceDetailBean device) {
    List<ResourceKey> deviceChildKeys = new ArrayList<>();
    List<PCIEBean> pcieBeans = device.getPCIE();
    if (!pcieBeans.isEmpty()) {
        List<ResourceKey> pcieResourceKey = new ArrayList<>();
        List<String> childHealthList = new ArrayList<>();
        for (PCIEBean pcie : pcieBeans) {
            ResourceKey key = pcie.convert2Resource(host + deviceBean.getDn(), getAdapterKind(), metricsByResource);
            pcieResourceKey.add(key);
            allResourceList.add(key);
            childHealthList.add(ConvertUtils.convertHealthState(pcie.getPcieSsdCardHealthStatus()));
        }
        // PCIE Group
        ResourceKey pcieGroup = device.createGroupKey(Constant.TREE_PCIE_GROUP, Constant.KIND_PCIE_GROUP, pcieResourceKey, relationshipsByResource, getAdapterKind());
        deviceChildKeys.add(pcieGroup);
        // add health state here
        setHealStatus4GroupObject(pcieGroup, Constant.ATTR_PCIESSDCARD_HEALTHSTATUS, childHealthList);
    }
    return deviceChildKeys;
}
Also used : PCIEBean(com.huawei.esight.service.bean.PCIEBean) ArrayList(java.util.ArrayList) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey)

Aggregations

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