Search in sources :

Example 1 with EthernetPortRequests

use of com.emc.storageos.vnxe.requests.EthernetPortRequests 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;
}
Also used : VNXeIscsiNode(com.emc.storageos.vnxe.models.VNXeIscsiNode) IscsiNodeRequests(com.emc.storageos.vnxe.requests.IscsiNodeRequests) IscsiPortalListRequest(com.emc.storageos.vnxe.requests.IscsiPortalListRequest) VNXeIscsiPortal(com.emc.storageos.vnxe.models.VNXeIscsiPortal) EthernetPortRequests(com.emc.storageos.vnxe.requests.EthernetPortRequests) VNXeEthernetPort(com.emc.storageos.vnxe.models.VNXeEthernetPort)

Aggregations

VNXeEthernetPort (com.emc.storageos.vnxe.models.VNXeEthernetPort)1 VNXeIscsiNode (com.emc.storageos.vnxe.models.VNXeIscsiNode)1 VNXeIscsiPortal (com.emc.storageos.vnxe.models.VNXeIscsiPortal)1 EthernetPortRequests (com.emc.storageos.vnxe.requests.EthernetPortRequests)1 IscsiNodeRequests (com.emc.storageos.vnxe.requests.IscsiNodeRequests)1 IscsiPortalListRequest (com.emc.storageos.vnxe.requests.IscsiPortalListRequest)1