use of com.emc.storageos.xtremio.restapi.model.response.XtremIOPorts in project coprhd-controller by CoprHD.
the class XtremIOV1Client method getXtremIOPortInfo.
@Override
public List<XtremIOPort> getXtremIOPortInfo(String clusterName) throws Exception {
ClientResponse response = get(XtremIOConstants.XTREMIO_TARGETS_URI);
XtremIOPortsInfo targetPortLinks = getResponseObject(XtremIOPortsInfo.class, response);
log.info("Returned Target Links size : {}", targetPortLinks.getPortInfo().length);
List<XtremIOPort> targetPortList = new ArrayList<XtremIOPort>();
for (XtremIOObjectInfo targetPortInfo : targetPortLinks.getPortInfo()) {
URI targetPortUri = URI.create(URIUtil.getFromPath(targetPortInfo.getHref()));
response = get(targetPortUri);
XtremIOPorts targetPorts = getResponseObject(XtremIOPorts.class, response);
log.info("Target Port {}", targetPorts.getContent().getName() + "-" + targetPorts.getContent().getPortAddress());
targetPortList.add(targetPorts.getContent());
}
return targetPortList;
}
use of com.emc.storageos.xtremio.restapi.model.response.XtremIOPorts in project coprhd-controller by CoprHD.
the class XtremIOV2Client method getXtremIOPortInfo.
@Override
public List<XtremIOPort> getXtremIOPortInfo(String clusterName) throws Exception {
String uriString = XtremIOConstants.XTREMIO_V2_TARGETS_STR.concat(XtremIOConstants.getInputClusterString(clusterName));
ClientResponse response = get(URI.create(uriString));
XtremIOPortsInfo targetPortLinks = getResponseObject(XtremIOPortsInfo.class, response);
log.info("Returned Target Links size : {}", targetPortLinks.getPortInfo().length);
List<XtremIOPort> targetPortList = new ArrayList<XtremIOPort>();
for (XtremIOObjectInfo targetPortInfo : targetPortLinks.getPortInfo()) {
URI targetPortUri = URI.create(URIUtil.getFromPath(targetPortInfo.getHref().concat(XtremIOConstants.getInputClusterString(clusterName))));
response = get(targetPortUri);
XtremIOPorts targetPorts = getResponseObject(XtremIOPorts.class, response);
log.info("Target Port {}", targetPorts.getContent().getName() + "-" + targetPorts.getContent().getPortAddress());
targetPortList.add(targetPorts.getContent());
}
return targetPortList;
}
Aggregations