use of com.emc.storageos.xtremio.restapi.model.response.XtremIOInitiatorGroup in project coprhd-controller by CoprHD.
the class XtremIOProvUtils method getInitiatorGroupVolumes.
/**
* @param igName
* @param clusterName
* @param client
* @return
* @throws Exception
*/
public static List<XtremIOVolume> getInitiatorGroupVolumes(String igName, String clusterName, XtremIOClient client) throws Exception {
List<XtremIOVolume> igVolumes = new ArrayList<XtremIOVolume>();
List<XtremIOObjectInfo> igLunMaps = new ArrayList<XtremIOObjectInfo>();
if (client.isVersion2()) {
igLunMaps = client.getLunMapsForInitiatorGroup(igName, clusterName);
} else {
XtremIOInitiatorGroup ig = client.getInitiatorGroup(igName, clusterName);
if (ig == null) {
return igVolumes;
}
List<XtremIOObjectInfo> lunMaps = client.getLunMaps(clusterName);
String igIndex = ig.getIndex();
for (XtremIOObjectInfo lunMap : lunMaps) {
String[] lunInfo = lunMap.getName().split(XtremIOConstants.UNDERSCORE);
if (igIndex.equals(lunInfo[1])) {
igLunMaps.add(lunMap);
}
}
}
for (XtremIOObjectInfo igLunMap : igLunMaps) {
String[] igLunInfo = igLunMap.getName().split(XtremIOConstants.UNDERSCORE);
igVolumes.add(client.getVolumeByIndex(igLunInfo[0], clusterName));
}
return igVolumes;
}
use of com.emc.storageos.xtremio.restapi.model.response.XtremIOInitiatorGroup in project coprhd-controller by CoprHD.
the class XtremIOV2Client method getInitiatorGroup.
@Override
public XtremIOInitiatorGroup getInitiatorGroup(String initiatorGroupName, String clusterName) throws Exception {
try {
String uriStr = XtremIOConstants.XTREMIO_V2_INITIATOR_GROUPS_STR.concat(XtremIOConstants.getInputNameForClusterString(initiatorGroupName, clusterName));
ClientResponse response = get(URI.create(uriStr));
XtremIOInitiatorGroups igGroups = getResponseObject(XtremIOInitiatorGroups.class, response);
XtremIOInitiatorGroup igGroup = igGroups.getContent();
log.info(igGroup.toString());
return igGroup;
} catch (Exception e) {
if (null != e.getMessage() && !e.getMessage().contains(XtremIOConstants.OBJECT_NOT_FOUND)) {
throw e;
} else {
log.warn("Initiator group {} not found on cluster {}", initiatorGroupName, clusterName);
}
}
log.info("Initiator Group not registered on Array with name : {}", initiatorGroupName);
return null;
}
Aggregations