use of com.integrien.alive.common.adapter3.ResourceKey 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;
}
use of com.integrien.alive.common.adapter3.ResourceKey in project Server_Management_Plugin_vRealize by Huawei.
the class ESightAdapter method setDeviceGroup.
private List<ResourceKey> setDeviceGroup(ServerDeviceDetailBean device, List<ResourceKey> childBladeDeviceKeyList, List<ChildBladeBean> childBladeBeans) {
List<ResourceKey> deviceChildKeys = new ArrayList<>();
if (!childBladeDeviceKeyList.isEmpty()) {
List<String> childHealthList = new ArrayList<>();
for (ChildBladeBean childBean : childBladeBeans) {
childHealthList.add(deviceHealthMap.get(childBean.getDn()));
}
ResourceKey devicesGroup = device.createGroupKey(Constant.TREE_DEVICES_GROUP, Constant.KIND_DEVICES_GROUP, childBladeDeviceKeyList, relationshipsByResource, getAdapterKind());
deviceChildKeys.add(devicesGroup);
setHealStatus4GroupObject(devicesGroup, Constant.ATTR_STATUS, childHealthList);
}
return deviceChildKeys;
}
use of com.integrien.alive.common.adapter3.ResourceKey in project Server_Management_Plugin_vRealize by Huawei.
the class ESightAdapter method setRaid.
private List<ResourceKey> setRaid(String host, List<ResourceKey> allResourceList, ServerDeviceBean deviceBean, ServerDeviceDetailBean device) {
List<ResourceKey> deviceChildKeys = new ArrayList<>();
List<RAIDBean> raidBeans = device.getRAID();
if (!raidBeans.isEmpty()) {
List<ResourceKey> raidResourceKey = new ArrayList<>();
List<String> childHealthList = new ArrayList<>();
for (RAIDBean raid : raidBeans) {
ResourceKey key = raid.convert2Resource(host + deviceBean.getDn(), getAdapterKind(), metricsByResource);
raidResourceKey.add(key);
allResourceList.add(key);
childHealthList.add(ConvertUtils.convertHealthState(raid.getHealthState()));
}
// RAID Group
ResourceKey raidGroup = device.createGroupKey(Constant.TREE_RAID_GROUP, Constant.KIND_RAID_GROUP, raidResourceKey, relationshipsByResource, getAdapterKind());
deviceChildKeys.add(raidGroup);
// add health state here
setHealStatus4GroupObject(raidGroup, Constant.ATTR_HEALTHSTATE, childHealthList);
}
return deviceChildKeys;
}
use of com.integrien.alive.common.adapter3.ResourceKey in project Server_Management_Plugin_vRealize by Huawei.
the class ESightAdapter method configEsight.
private void configEsight(String hostIp) {
ResourceKey resourceKey = new ResourceKey(hostIp, Constant.KIND_HOST_INSTANCE, getAdapterKind());
long timestamp = System.currentTimeMillis();
List<MetricData> metricDataList = new ArrayList<>();
// 设置eSight服务器的状态为离线状态
metricDataList.add(new MetricData(new MetricKey(false, Constant.ATTR_HEALTHSTATE), timestamp, ConvertUtils.convertHealthState(-1)));
metricsByResource.put(resourceKey, metricDataList);
DiscoveryResult discoveryResult = collectResult.getDiscoveryResult(true);
if (isNewResource(resourceKey)) {
discoveryResult.addResource(new ResourceConfig(resourceKey));
}
// Check if resource is part of monitored set, otherwise continue
ResourceConfig resourceConfig = getMonitoringResource(resourceKey);
if (resourceConfig == null) {
return;
}
// Add metrics
addMetricData(resourceConfig, metricsByResource.get(resourceKey));
// Add relationships
Relationships rel = new Relationships();
rel.setRelationships(resourceKey, relationshipsByResource.get(resourceKey), Collections.singleton(getAdapterKind()));
discoveryResult.addRelationships(rel);
return;
}
Aggregations