use of com.integrien.alive.common.adapter3.ResourceKey in project Server_Management_Plugin_vRealize by Huawei.
the class ServerDeviceDetailBean method convert2Resource.
@Override
public ResourceKey convert2Resource(String id, String adapterKind, Map<ResourceKey, List<MetricData>> metricsByResource) {
String resourceName = this.name;
if (resourceName == null || resourceName.isEmpty()) {
resourceName = this.ipAddress;
}
ResourceKey resourceKey = new ResourceKey(resourceName, Constant.KIND_SERVER_DEVICE, adapterKind);
ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, id + this.uuid, true);
resourceKey.addIdentifier(dnIdentifier);
long timestamp = System.currentTimeMillis();
List<MetricData> metricDataList = new ArrayList<>();
// 写入资源属性
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_DN), timestamp, this.dn));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_IP_ADDRESS), timestamp, this.ipAddress));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_NAME), timestamp, this.name));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_TYPE), timestamp, this.type));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_UUID), timestamp, this.uuid));
metricDataList.add(new MetricData(new MetricKey(false, Constant.ATTR_STATUS), timestamp, ConvertUtils.convertHealthState(this.status)));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_DESC), timestamp, this.desc));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_PRODUCT_SN), timestamp, this.productSn));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MANUFACTURE), timestamp, this.manufacturer));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_VERSION), timestamp, this.version));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_LOCATION), timestamp, this.location));
// 非机框服务器不需要写入以下属性
if (this.memoryCapacity != null) {
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MEMORY_CAPACITY), timestamp, this.memoryCapacity));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_MODEL), timestamp, this.mode));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_BMC_MAC_ADDR), timestamp, this.bmcMacAddr));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_CPU_NUMS), timestamp, this.cpuNums));
metricDataList.add(new MetricData(new MetricKey(true, Constant.ATTR_CPU_CORES), timestamp, this.cpuCores));
}
metricsByResource.put(resourceKey, metricDataList);
return resourceKey;
}
use of com.integrien.alive.common.adapter3.ResourceKey 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;
}
use of com.integrien.alive.common.adapter3.ResourceKey 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;
}
use of com.integrien.alive.common.adapter3.ResourceKey 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;
}
use of com.integrien.alive.common.adapter3.ResourceKey in project Server_Management_Plugin_vRealize by Huawei.
the class ServerDeviceDetailBean method createGroupKey.
/**
* 创建分组对象resource key.
*
* @param groupName 分组名字
* @param kindKey 类型
* @param childKeyList 下级资源列表
* @param relationshipsByResource 关系列表
* @param adapterKind adapter名字
* @return 资源key
*/
public ResourceKey createGroupKey(String groupName, String kindKey, List<ResourceKey> childKeyList, Map<ResourceKey, List<ResourceKey>> relationshipsByResource, String adapterKind) {
ResourceKey groupKey = new ResourceKey(groupName, kindKey, adapterKind);
// 设定唯一的标识,保证同名的资源可以正常显示
ResourceIdentifierConfig dnIdentifier = new ResourceIdentifierConfig(Constant.ATTR_ID, this.dn + groupName, true);
groupKey.addIdentifier(dnIdentifier);
// 关联resource和下级的child resource
relationshipsByResource.put(groupKey, childKeyList);
return groupKey;
}
Aggregations