Search in sources :

Example 6 with MetricKey

use of com.integrien.alive.common.adapter3.MetricKey in project Server_Management_Plugin_vRealize by Huawei.

the class MezzBean method convert2Resource.

@Override
public ResourceKey convert2Resource(String id, String adapterKind, Map<ResourceKey, List<MetricData>> metricsByResource) {
    ResourceKey resourceKey = new ResourceKey(this.name, Constant.KIND_MEZZ, adapterKind);
    // 设定唯一的标识,保证同名的资源可以正常显示
    ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, id + this.uuid, true);
    resourceKey.addIdentifier(dnIdentifier);
    long timestamp = System.currentTimeMillis();
    List<MetricData> metricData = new ArrayList<>();
    // 写入resource属性
    metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_NAME), timestamp, this.name));
    metricData.add(new MetricData(new MetricKey(false).add(Constant.ATTR_MEZZ_HEALTH_STATUS), timestamp, ConvertUtils.convertHealthState(this.getMezzHealthStatus())));
    metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_PRESENTSTATE), timestamp, ConvertUtils.convertPresentState(this.presentState)));
    metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MEZZ_INFO), timestamp, this.mezzInfo));
    metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MEZZ_LOCATION), timestamp, this.mezzLocation));
    metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MEZZ_ETH_MAC), timestamp, this.mezzETHMac));
    metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MEZZ_IB_MAC), timestamp, this.mezzIBMac));
    metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MEZZ_FCWWPN), timestamp, this.mezzFCWWPN));
    metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MOID), timestamp, this.moId));
    metricData.add(new MetricData(new MetricKey(true).add(Constant.ATTR_UUID), timestamp, this.uuid));
    // 关联key和属性值
    metricsByResource.put(resourceKey, metricData);
    return resourceKey;
}
Also used : ResourceIdentifierConfig(com.integrien.alive.common.adapter3.config.ResourceIdentifierConfig) MetricKey(com.integrien.alive.common.adapter3.MetricKey) ArrayList(java.util.ArrayList) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey) MetricData(com.integrien.alive.common.adapter3.MetricData)

Example 7 with MetricKey

use of com.integrien.alive.common.adapter3.MetricKey in project Server_Management_Plugin_vRealize by Huawei.

the class PCIEBean method convert2Resource.

@Override
public ResourceKey convert2Resource(String dn, String adapterKind, Map<ResourceKey, List<MetricData>> metricsByResource) {
    ResourceKey resourceKey = new ResourceKey(this.name, Constant.KIND_PCIE, adapterKind);
    // 设定唯一的标识,保证同名的资源可以正常显示
    ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, dn + this.uuid, true);
    resourceKey.addIdentifier(dnIdentifier);
    long timestamp = System.currentTimeMillis();
    List<MetricData> metricDataList = new ArrayList<>();
    // 写入resource属性
    metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_NAME), timestamp, this.name));
    metricDataList.add(new MetricData(new MetricKey(false, Constant.ATTR_PCIESSDCARD_HEALTHSTATUS), timestamp, ConvertUtils.convertHealthState(this.pcieSsdCardHealthStatus)));
    metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_PCIESSDCARD_LIFELEFT), timestamp, this.pcieSsdCardLifeLeft));
    metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_UUID), timestamp, this.uuid));
    metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_PCIESSDCARD_MANYFACTURER), timestamp, this.pciecardManufacturer));
    metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MOID), timestamp, this.moId));
    // 关联key和属性值
    metricsByResource.put(resourceKey, metricDataList);
    return resourceKey;
}
Also used : ResourceIdentifierConfig(com.integrien.alive.common.adapter3.config.ResourceIdentifierConfig) MetricKey(com.integrien.alive.common.adapter3.MetricKey) ArrayList(java.util.ArrayList) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey) MetricData(com.integrien.alive.common.adapter3.MetricData)

Example 8 with MetricKey

use of com.integrien.alive.common.adapter3.MetricKey in project Server_Management_Plugin_vRealize by Huawei.

the class RAIDBean method convert2Resource.

@Override
public ResourceKey convert2Resource(String dn, String adapterKind, Map<ResourceKey, List<MetricData>> metricsByResource) {
    // 生成resource key
    ResourceKey resourceKey = new ResourceKey(this.name, Constant.KIND_RAID, adapterKind);
    // 设定唯一的标识,保证同名的资源可以正常显示
    ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, dn + this.uuid, true);
    resourceKey.addIdentifier(dnIdentifier);
    long timestamp = System.currentTimeMillis();
    List<MetricData> metricDataList = new ArrayList<>();
    // 写入resource属性
    metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_NAME), timestamp, this.name));
    metricDataList.add(new MetricData(new MetricKey(false, Constant.ATTR_HEALTHSTATE), timestamp, ConvertUtils.convertHealthState(this.healthState)));
    metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_RAID_TYPE), timestamp, this.raidType));
    metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_INTERFACE_TYPE), timestamp, ConvertUtils.covnertInterfaceType(this.interfaceType)));
    metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_BBU_TYPE), timestamp, this.bbuType));
    metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MOID), timestamp, this.moId));
    metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_UUID), timestamp, this.uuid));
    // 关联key和属性值
    metricsByResource.put(resourceKey, metricDataList);
    return resourceKey;
}
Also used : ResourceIdentifierConfig(com.integrien.alive.common.adapter3.config.ResourceIdentifierConfig) MetricKey(com.integrien.alive.common.adapter3.MetricKey) ArrayList(java.util.ArrayList) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey) MetricData(com.integrien.alive.common.adapter3.MetricData)

Example 9 with MetricKey

use of com.integrien.alive.common.adapter3.MetricKey in project Server_Management_Plugin_vRealize by Huawei.

the class BoardBean method convert2Resource.

@Override
public ResourceKey convert2Resource(String id, String adapterKind, Map<ResourceKey, List<MetricData>> metricsByResource) {
    ResourceKey resourceKey = new ResourceKey(this.name, Constant.KIND_BOARD, adapterKind);
    // 设定唯一的标识,保证同名的资源可以正常显示
    ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, id + this.uuid, true);
    resourceKey.addIdentifier(dnIdentifier);
    long timestamp = System.currentTimeMillis();
    List<MetricData> metricDataList = new ArrayList<>();
    // 写入resource属性
    metricDataList.add(new MetricData(new MetricKey(true).add(Constant.ATTR_NAME), timestamp, this.name));
    metricDataList.add(new MetricData(new MetricKey(true).add(Constant.ATTR_TYPE), timestamp, ConvertUtils.convertBoardType(this.type)));
    metricDataList.add(new MetricData(new MetricKey(true).add(Constant.ATTR_SN), timestamp, this.sn));
    metricDataList.add(new MetricData(new MetricKey(true).add(Constant.ATTR_PART_NUMBER), timestamp, this.partNumber));
    metricDataList.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MANUFACTURE), timestamp, this.manufacture));
    metricDataList.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MANUTIME), timestamp, this.manuTime));
    metricDataList.add(new MetricData(new MetricKey(true).add(Constant.ATTR_UUID), timestamp, this.uuid));
    metricDataList.add(new MetricData(new MetricKey(true).add(Constant.ATTR_MOID), timestamp, this.moId));
    metricDataList.add(new MetricData(new MetricKey(true).add(Constant.ATTR_PRESENTSTATE), timestamp, ConvertUtils.convertPresentState(this.presentState)));
    metricDataList.add(new MetricData(new MetricKey(false).add(Constant.ATTR_HEALTHSTATE), timestamp, ConvertUtils.convertHealthState(this.healthState)));
    metricDataList.add(new MetricData(new MetricKey(true).add(Constant.ATTR_IP_ADDRESS), timestamp, this.ipAddress));
    // 关联key和属性值
    metricsByResource.put(resourceKey, metricDataList);
    return resourceKey;
}
Also used : ResourceIdentifierConfig(com.integrien.alive.common.adapter3.config.ResourceIdentifierConfig) MetricKey(com.integrien.alive.common.adapter3.MetricKey) ArrayList(java.util.ArrayList) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey) MetricData(com.integrien.alive.common.adapter3.MetricData)

Example 10 with MetricKey

use of com.integrien.alive.common.adapter3.MetricKey in project Server_Management_Plugin_vRealize by Huawei.

the class NetworkCardBean method convert2Resource.

@Override
public ResourceKey convert2Resource(String dn, String adapterKind, Map<ResourceKey, List<MetricData>> metricsByResource) {
    ResourceKey resourceKey = new ResourceKey(this.deviceName, Constant.KIND_NETWORKCATD, adapterKind);
    // 设定唯一的标识,保证同名的资源可以正常显示
    ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, dn + this.uuid, true);
    resourceKey.addIdentifier(dnIdentifier);
    long timestamp = System.currentTimeMillis();
    List<MetricData> metricDataList = new ArrayList<>();
    // 写入resource属性
    metricDataList.add(new MetricData(new MetricKey(true).add(Constant.ATTR_UUID), timestamp, this.uuid));
    metricDataList.add(new MetricData(new MetricKey(true, "deviceName"), timestamp, this.deviceName));
    metricDataList.add(new MetricData(new MetricKey(true, "cardName"), timestamp, this.cardName));
    metricDataList.add(new MetricData(new MetricKey(true, "cardManufacturer"), timestamp, this.cardManufacturer));
    metricDataList.add(new MetricData(new MetricKey(true, "cardModel"), timestamp, this.cardModel));
    metricDataList.add(new MetricData(new MetricKey(true, "chipManufacturer"), timestamp, this.chipManufacturer));
    metricDataList.add(new MetricData(new MetricKey(true, "chipModel"), timestamp, this.chipModel));
    metricDataList.add(new MetricData(new MetricKey(true, "firmwarePkgVersion"), timestamp, this.firmwarePkgVersion));
    metricDataList.add(new MetricData(new MetricKey(true, "driverName"), timestamp, this.driverName));
    metricDataList.add(new MetricData(new MetricKey(true, "driverVersion"), timestamp, this.driverVersion));
    metricDataList.add(new MetricData(new MetricKey(false).add(Constant.ATTR_HEALTHSTATE), timestamp, ConvertUtils.convertHealthState(this.healthState)));
    // 关联key和属性值
    metricsByResource.put(resourceKey, metricDataList);
    return resourceKey;
}
Also used : ResourceIdentifierConfig(com.integrien.alive.common.adapter3.config.ResourceIdentifierConfig) MetricKey(com.integrien.alive.common.adapter3.MetricKey) ArrayList(java.util.ArrayList) ResourceKey(com.integrien.alive.common.adapter3.ResourceKey) MetricData(com.integrien.alive.common.adapter3.MetricData)

Aggregations

MetricData (com.integrien.alive.common.adapter3.MetricData)14 MetricKey (com.integrien.alive.common.adapter3.MetricKey)14 ArrayList (java.util.ArrayList)14 ResourceKey (com.integrien.alive.common.adapter3.ResourceKey)13 ResourceIdentifierConfig (com.integrien.alive.common.adapter3.config.ResourceIdentifierConfig)12 ServerDeviceBean (com.huawei.esight.service.bean.ServerDeviceBean)1 DiscoveryResult (com.integrien.alive.common.adapter3.DiscoveryResult)1 Relationships (com.integrien.alive.common.adapter3.Relationships)1 ResourceConfig (com.integrien.alive.common.adapter3.config.ResourceConfig)1