use of com.vmware.flowgate.common.AssetStatus in project flowgate by vmware.
the class AssetControllerTest method createAsset.
Asset createAsset() {
Asset asset = new Asset();
BaseDocumentUtil.generateID(asset);
asset.setAssetName("pek-wor-server-02");
asset.setAssetNumber(12345);
asset.setAssetSource("5b7d208d55368540fcba1692");
asset.setCategory(AssetCategory.Server);
asset.setModel("Dell 750");
asset.setManufacturer("Dell");
asset.setSerialnumber("Serialnumber");
asset.setRegion("Region");
asset.setCountry("china");
asset.setCity("beijing");
asset.setBuilding("Raycom");
asset.setFloor("9F");
asset.setRoom("901");
asset.setRow("9");
asset.setCol("9");
asset.setExtraLocation("");
asset.setCabinetName("");
List<String> pdus = new ArrayList<>();
asset.setPdus(pdus);
List<String> switches = new ArrayList<>();
asset.setSwitches(switches);
AssetStatus status = new AssetStatus();
asset.setStatus(status);
Map<String, String> formulas = new HashMap<String, String>();
Map<String, Map<String, String>> pduMetricFormulas = new HashMap<String, Map<String, String>>();
Map<String, String> MetricAndIdMap = new HashMap<String, String>();
MetricAndIdMap.put(MetricName.SERVER_CONNECTED_PDU_CURRENT, "0001bdc8b25d4c2badfd045ab61aabfa");
MetricAndIdMap.put(MetricName.SERVER_CONNECTED_PDU_POWER, "0001bdc8b25d4c2badfd045ab61aabfa");
MetricAndIdMap.put(MetricName.SERVER_VOLTAGE, "0001bdc8b25d4c2badfd045ab61aabfa");
pduMetricFormulas.put("0001bdc8b25d4c2badfd045ab61aabfa", MetricAndIdMap);
String pduFormulaInfo = null;
try {
pduFormulaInfo = mapper.writeValueAsString(pduMetricFormulas);
} catch (JsonProcessingException e) {
TestCase.fail(e.getMessage());
}
formulas.put(FlowgateConstant.PDU, pduFormulaInfo);
asset.setMetricsformulars(formulas);
return asset;
}
Aggregations