Search in sources :

Example 1 with CPUBean

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

the class ESightAdapter method setCpu.

private List<ResourceKey> setCpu(String host, List<ResourceKey> allResourceList, ServerDeviceBean deviceBean, ServerDeviceDetailBean device) {
    List<ResourceKey> deviceChildKeys = new ArrayList<>();
    List<CPUBean> cpuBeans = device.getCPU();
    if (!cpuBeans.isEmpty()) {
        List<ResourceKey> cpuResourceKey = new ArrayList<>();
        List<String> childHealthList = new ArrayList<>();
        for (CPUBean cpu : cpuBeans) {
            ResourceKey key = cpu.convert2Resource(host + deviceBean.getDn(), getAdapterKind(), metricsByResource);
            cpuResourceKey.add(key);
            allResourceList.add(key);
            childHealthList.add(ConvertUtils.convertHealthState(cpu.getHealthState()));
        }
        // CPU Group
        ResourceKey cpuGroup = device.createGroupKey(Constant.TREE_CPU_GROUP, Constant.KIND_CPU_GROUP, cpuResourceKey, relationshipsByResource, getAdapterKind());
        deviceChildKeys.add(cpuGroup);
        // add health state here
        setHealStatus4GroupObject(cpuGroup, Constant.ATTR_HEALTHSTATE, childHealthList);
    }
    return deviceChildKeys;
}
Also used : ArrayList(java.util.ArrayList) CPUBean(com.huawei.esight.service.bean.CPUBean) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey)

Aggregations

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