use of com.emc.storageos.xtremio.restapi.model.response.XtremIOObjectInfo in project coprhd-controller by CoprHD.
the class XtremIOV2Client method getXtremIOXMSVersion.
@Override
public String getXtremIOXMSVersion() throws Exception {
ClientResponse response = get(XtremIOConstants.XTREMIO_V2_XMS_URI);
XtremIOXMSsInfo xmssInfo = getResponseObject(XtremIOXMSsInfo.class, response);
for (XtremIOObjectInfo xmsInfo : xmssInfo.getXmssInfo()) {
URI xmsURI = URI.create(URIUtil.getFromPath(xmsInfo.getHref()));
response = get(xmsURI);
XtremIOXMSResponse xmsResponse = getResponseObject(XtremIOXMSResponse.class, response);
XtremIOXMS xms = xmsResponse.getContent();
log.info(xms.toString());
return xms.getVersion();
}
return null;
}
use of com.emc.storageos.xtremio.restapi.model.response.XtremIOObjectInfo in project coprhd-controller by CoprHD.
the class XtremIOV2Client method getXtremIOVolumesForLinks.
@Override
public List<XtremIOVolume> getXtremIOVolumesForLinks(List<XtremIOObjectInfo> volumeLinks, String clusterName) throws Exception {
List<XtremIOVolume> volumeList = new ArrayList<XtremIOVolume>();
for (XtremIOObjectInfo volumeInfo : volumeLinks) {
URI volumeURI = URI.create(URIUtil.getFromPath(volumeInfo.getHref().concat(XtremIOConstants.getInputClusterString(clusterName))));
ClientResponse response = get(volumeURI);
XtremIOVolumes volumes = getResponseObject(XtremIOVolumes.class, response);
log.info("Volume {}", volumes.getContent().getVolInfo().get(1) + "-" + volumes.getContent().getVolInfo().get(2));
volumeList.add(volumes.getContent());
}
return volumeList;
}
use of com.emc.storageos.xtremio.restapi.model.response.XtremIOObjectInfo 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;
}
use of com.emc.storageos.xtremio.restapi.model.response.XtremIOObjectInfo 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;
}
use of com.emc.storageos.xtremio.restapi.model.response.XtremIOObjectInfo in project coprhd-controller by CoprHD.
the class XtremIOV2Client method getTagNames.
@Override
public List<String> getTagNames(String clusterName) throws Exception {
// No need to throw exception if we are not able to get tag names.
List<String> tagNames = new ArrayList<String>();
try {
ClientResponse response = get(XtremIOConstants.XTREMIO_V2_TAGS_URI);
XtremIOTagsInfo responseObjs = getResponseObject(XtremIOTagsInfo.class, response);
for (XtremIOObjectInfo objectInfo : responseObjs.getTagsInfo()) {
tagNames.add(objectInfo.getName());
}
} catch (Exception ex) {
log.warn("Error getting tag names", ex.getMessage());
log.info("Ignoring this as we again check if the tag is present before creating a new tag");
}
return tagNames;
}
Aggregations