use of com.emc.cloud.platform.ucs.in.model.ConfigResolveClass in project coprhd-controller by CoprHD.
the class UCSMServiceImpl method getFICUplinkPorts.
@Override
public Map<String, FcPIo> getFICUplinkPorts(String ucsmURL, String username, String password) throws ClientGeneralException {
Map<String, FcPIo> uplinkMap = new HashMap<String, FcPIo>();
ComputeSession computeSession = sessionManager.getSession(ucsmURL, username, password);
ConfigResolveClass configResolveClass = new ConfigResolveClass();
configResolveClass.setClassId(NamingClassId.FC_P_IO);
configResolveClass.setInHierarchical("false");
com.emc.cloud.platform.ucs.out.model.ConfigResolveClass configResolveClassOut = computeSession.execute(factory.createConfigResolveClass(configResolveClass), com.emc.cloud.platform.ucs.out.model.ConfigResolveClass.class);
for (JAXBElement<?> managedObject : getConfigSetManagedObjects(configResolveClassOut)) {
if (managedObject.getValue() instanceof FcPIo) {
uplinkMap.put(((FcPIo) managedObject.getValue()).getDn(), (FcPIo) managedObject.getValue());
}
}
return uplinkMap;
}
use of com.emc.cloud.platform.ucs.in.model.ConfigResolveClass in project coprhd-controller by CoprHD.
the class UCSMServiceImpl method getComputeBlades.
@Override
public List<ComputeBlade> getComputeBlades(String ucsmURL, String username, String password) throws ClientGeneralException {
List<ComputeBlade> blades = new ArrayList<ComputeBlade>();
try {
ComputeSession computeSession = sessionManager.getSession(ucsmURL, username, password);
ConfigResolveClass configResolveClass = new ConfigResolveClass();
configResolveClass.setClassId(NamingClassId.COMPUTE_ITEM);
configResolveClass.setInHierarchical("true");
com.emc.cloud.platform.ucs.out.model.ConfigResolveClass configResolveClassOut = computeSession.execute(factory.createConfigResolveClass(configResolveClass), com.emc.cloud.platform.ucs.out.model.ConfigResolveClass.class);
ConfigSet configSet = null;
if (configResolveClassOut.getContent() != null && !configResolveClassOut.getContent().isEmpty()) {
for (Object object : configResolveClassOut.getContent()) {
if (object instanceof JAXBElement<?>) {
if (!(((JAXBElement) object).getValue() instanceof ConfigSet)) {
continue;
}
configSet = ((JAXBElement<ConfigSet>) object).getValue();
if (configSet != null && configSet.getManagedObject() != null && !configSet.getManagedObject().isEmpty()) {
for (JAXBElement<?> managedObject : configSet.getManagedObject()) {
if (managedObject.getValue() instanceof ComputeBlade) {
blades.add((ComputeBlade) managedObject.getValue());
}
}
}
}
}
}
} catch (ClientGeneralException e) {
log.warn("Unable to get compute elements", e);
throw e;
}
return blades;
}
use of com.emc.cloud.platform.ucs.in.model.ConfigResolveClass in project coprhd-controller by CoprHD.
the class UCSMServiceImpl method getVlanById.
@Override
public FabricVlan getVlanById(String ucsmURL, String username, String password, String vlanId) throws ClientGeneralException {
ComputeSession computeSession = sessionManager.getSession(ucsmURL, username, password);
ConfigResolveClass configResolveClass = new ConfigResolveClass();
configResolveClass.setClassId(NamingClassId.FABRIC_VLAN);
configResolveClass.setInHierarchical("true");
FilterFilter inFilter = new FilterFilter();
EqFilter eqFilter = new EqFilter();
eqFilter.setProperty("id");
eqFilter.setClazz(NamingClassId.FABRIC_VLAN);
eqFilter.setValue(vlanId);
inFilter.setAbstractFilter(factory.createEq(eqFilter));
configResolveClass.getContent().add(new JAXBElement<FilterFilter>(new QName("inFilter"), FilterFilter.class, inFilter));
com.emc.cloud.platform.ucs.out.model.ConfigResolveClass configResolveClassOut = computeSession.execute(factory.createConfigResolveClass(configResolveClass), com.emc.cloud.platform.ucs.out.model.ConfigResolveClass.class);
ConfigSet configSet = null;
if (configResolveClassOut.getContent() != null && !configResolveClassOut.getContent().isEmpty()) {
for (Object object : configResolveClassOut.getContent()) {
if (object instanceof JAXBElement<?>) {
if (!(((JAXBElement) object).getValue() instanceof ConfigSet)) {
continue;
}
configSet = ((JAXBElement<ConfigSet>) object).getValue();
if (configSet != null && configSet.getManagedObject() != null && !configSet.getManagedObject().isEmpty()) {
for (JAXBElement<?> managedObject : configSet.getManagedObject()) {
if (managedObject.getValue() instanceof FabricVlan) {
return (FabricVlan) managedObject.getValue();
}
}
}
}
}
}
return null;
}
use of com.emc.cloud.platform.ucs.in.model.ConfigResolveClass in project coprhd-controller by CoprHD.
the class UCSMServiceImpl method getUcsVlans.
@Override
public List<FabricVlan> getUcsVlans(String ucsmURL, String username, String password) throws ClientGeneralException {
List<FabricVlan> vlanList = new ArrayList<FabricVlan>();
ComputeSession computeSession = sessionManager.getSession(ucsmURL, username, password);
ConfigResolveClass configResolveClass = new ConfigResolveClass();
configResolveClass.setClassId(NamingClassId.FABRIC_VLAN);
configResolveClass.setInHierarchical("false");
com.emc.cloud.platform.ucs.out.model.ConfigResolveClass configResolveClassOut = computeSession.execute(factory.createConfigResolveClass(configResolveClass), com.emc.cloud.platform.ucs.out.model.ConfigResolveClass.class);
for (JAXBElement<?> managedObject : getConfigSetManagedObjects(configResolveClassOut)) {
if (managedObject.getValue() instanceof FabricVlan) {
vlanList.add((FabricVlan) managedObject.getValue());
}
}
return vlanList;
}
use of com.emc.cloud.platform.ucs.in.model.ConfigResolveClass in project coprhd-controller by CoprHD.
the class UCSMServiceImpl method getUplinkPortChannels.
@Override
public Map<String, SwFcSanPc> getUplinkPortChannels(String ucsmURL, String username, String password) throws ClientGeneralException {
Map<String, SwFcSanPc> switchFcInterfaceMap = new HashMap<String, SwFcSanPc>();
ComputeSession computeSession = sessionManager.getSession(ucsmURL, username, password);
ConfigResolveClass configResolveClass = new ConfigResolveClass();
configResolveClass.setClassId(NamingClassId.SW_FC_SAN_PC);
configResolveClass.setInHierarchical("true");
com.emc.cloud.platform.ucs.out.model.ConfigResolveClass configResolveClassOut = computeSession.execute(factory.createConfigResolveClass(configResolveClass), com.emc.cloud.platform.ucs.out.model.ConfigResolveClass.class);
for (JAXBElement<?> managedObject : getConfigSetManagedObjects(configResolveClassOut)) {
if (managedObject.getValue() instanceof SwFcSanPc) {
switchFcInterfaceMap.put(((SwFcSanPc) managedObject.getValue()).getDn(), (SwFcSanPc) managedObject.getValue());
}
}
return switchFcInterfaceMap;
}
Aggregations