Search in sources :

Example 1 with XtremIOPorts

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;
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) XtremIOPortsInfo(com.emc.storageos.xtremio.restapi.model.response.XtremIOPortsInfo) XtremIOPort(com.emc.storageos.xtremio.restapi.model.response.XtremIOPort) ArrayList(java.util.ArrayList) XtremIOPorts(com.emc.storageos.xtremio.restapi.model.response.XtremIOPorts) XtremIOObjectInfo(com.emc.storageos.xtremio.restapi.model.response.XtremIOObjectInfo) URI(java.net.URI)

Example 2 with XtremIOPorts

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;
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) XtremIOPortsInfo(com.emc.storageos.xtremio.restapi.model.response.XtremIOPortsInfo) XtremIOPort(com.emc.storageos.xtremio.restapi.model.response.XtremIOPort) ArrayList(java.util.ArrayList) XtremIOPorts(com.emc.storageos.xtremio.restapi.model.response.XtremIOPorts) XtremIOObjectInfo(com.emc.storageos.xtremio.restapi.model.response.XtremIOObjectInfo) URI(java.net.URI)

Aggregations

XtremIOObjectInfo (com.emc.storageos.xtremio.restapi.model.response.XtremIOObjectInfo)2 XtremIOPort (com.emc.storageos.xtremio.restapi.model.response.XtremIOPort)2 XtremIOPorts (com.emc.storageos.xtremio.restapi.model.response.XtremIOPorts)2 XtremIOPortsInfo (com.emc.storageos.xtremio.restapi.model.response.XtremIOPortsInfo)2 ClientResponse (com.sun.jersey.api.client.ClientResponse)2 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2