use of com.emc.storageos.xtremio.restapi.model.response.XtremIOInitiator in project coprhd-controller by CoprHD.
the class XtremIOV1Client method getXtremIOInitiatorsInfo.
@Override
public List<XtremIOInitiator> getXtremIOInitiatorsInfo(String clusterName) throws Exception {
ClientResponse response = get(XtremIOConstants.XTREMIO_INITIATORS_URI);
XtremIOInitiatorsInfo initiatorPortLinks = getResponseObject(XtremIOInitiatorsInfo.class, response);
log.info("Returned Initiator Links size : {}", initiatorPortLinks.getInitiators().length);
List<XtremIOInitiator> initiatorPortList = new ArrayList<XtremIOInitiator>();
for (XtremIOObjectInfo initiatorPortInfo : initiatorPortLinks.getInitiators()) {
URI initiatorPortUri = URI.create(URIUtil.getFromPath(initiatorPortInfo.getHref()));
try {
response = get(initiatorPortUri);
XtremIOInitiators initiatorPorts = getResponseObject(XtremIOInitiators.class, response);
log.info("Initiator Port {}", initiatorPorts.getContent().getName() + "-" + initiatorPorts.getContent().getPortAddress());
initiatorPortList.add(initiatorPorts.getContent());
} catch (Exception e) {
if (null != e.getMessage() && !e.getMessage().contains(XtremIOConstants.OBJECT_NOT_FOUND)) {
throw e;
} else {
log.warn("GET initiator - {} failed with obj_not_found. Initiator might be deleted from the system", initiatorPortUri.toString());
}
}
}
return initiatorPortList;
}
Aggregations