use of com.emc.cloud.platform.ucs.out.model.LsRequirement in project coprhd-controller by CoprHD.
the class UcsDiscoveryWorker method getServiceProfileTemplateDetails.
private Map<String, Object> getServiceProfileTemplateDetails(LsServer spt) {
Map<String, Object> serviceProfileTemplateDetails = new HashMap<>();
int vhbaCount = 0;
int vnicCount = 0;
List<VnicEther> vnics = new ArrayList<>();
List<VnicFc> vhbas = new ArrayList<>();
if (spt.getContent() != null && !spt.getContent().isEmpty()) {
for (Serializable element : spt.getContent()) {
if (element instanceof JAXBElement<?>) {
if (((JAXBElement) element).getValue() instanceof LsRequirement) {
LsRequirement lsRequirement = (LsRequirement) ((JAXBElement) element).getValue();
serviceProfileTemplateDetails.put("associatedServerPool", lsRequirement.getName());
} else if (((JAXBElement) element).getValue() instanceof VnicEther) {
vnics.add(((VnicEther) ((JAXBElement) element).getValue()));
vnicCount++;
} else if (((JAXBElement) element).getValue() instanceof VnicFc) {
vhbas.add(((VnicFc) ((JAXBElement) element).getValue()));
vhbaCount++;
} else if (((JAXBElement) element).getValue() instanceof LsbootDef) {
LsbootDef lsbootDef = (LsbootDef) ((JAXBElement) element).getValue();
serviceProfileTemplateDetails.put("associatedBootPolicy", lsbootDef);
}
}
}
serviceProfileTemplateDetails.put("vhbaCount", vhbaCount);
serviceProfileTemplateDetails.put("vnicCount", vnicCount);
serviceProfileTemplateDetails.put("vhbas", vhbas);
serviceProfileTemplateDetails.put("vnics", vnics);
}
return serviceProfileTemplateDetails;
}
Aggregations