use of com.emc.storageos.vnxe.requests.IscsiPortalListRequest in project coprhd-controller by CoprHD.
the class VNXeApiClient method getAllIscsiPorts.
/**
* Get all iSCSI ports
*
* @return
*/
public List<VNXeIscsiNode> getAllIscsiPorts() {
IscsiNodeRequests nodeReq = new IscsiNodeRequests(_khClient);
List<VNXeIscsiNode> nodes = nodeReq.getAllNodes();
if (nodes != null && !nodes.isEmpty()) {
Iterator<VNXeIscsiNode> it = nodes.iterator();
while (it.hasNext()) {
VNXeIscsiNode node = it.next();
VNXeEthernetPort eport = node.getEthernetPort();
if (eport != null) {
String id = eport.getId();
EthernetPortRequests portRequest = new EthernetPortRequests(_khClient);
VNXeEthernetPort detailedPort = portRequest.get(id);
node.setEthernetPort(detailedPort);
// get iscsiPortal. comment it out for now, since API does not work.
IscsiPortalListRequest portalReq = new IscsiPortalListRequest(_khClient);
VNXeIscsiPortal portal = portalReq.getByIscsiNode(node.getId());
if (portal == null) {
it.remove();
} else {
node.setIscsiPortal(portal);
}
} else {
it.remove();
}
}
}
return nodes;
}
Aggregations