Search in sources :

Example 1 with XtremIOInitiatorGroups

use of com.emc.storageos.xtremio.restapi.model.response.XtremIOInitiatorGroups in project coprhd-controller by CoprHD.

the class XtremIOV1Client method getInitiatorGroup.

@Override
public XtremIOInitiatorGroup getInitiatorGroup(String initiatorGroupName, String clusterName) throws Exception {
    try {
        String uriStr = XtremIOConstants.XTREMIO_INITIATOR_GROUPS_STR.concat(XtremIOConstants.getInputNameString(initiatorGroupName));
        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;
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) XtremIOInitiatorGroups(com.emc.storageos.xtremio.restapi.model.response.XtremIOInitiatorGroups) XtremIOInitiatorGroup(com.emc.storageos.xtremio.restapi.model.response.XtremIOInitiatorGroup) XtremIOApiException(com.emc.storageos.xtremio.restapi.errorhandling.XtremIOApiException)

Example 2 with XtremIOInitiatorGroups

use of com.emc.storageos.xtremio.restapi.model.response.XtremIOInitiatorGroups 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;
}
Also used : ClientResponse(com.sun.jersey.api.client.ClientResponse) XtremIOInitiatorGroups(com.emc.storageos.xtremio.restapi.model.response.XtremIOInitiatorGroups) XtremIOInitiatorGroup(com.emc.storageos.xtremio.restapi.model.response.XtremIOInitiatorGroup) XtremIOApiException(com.emc.storageos.xtremio.restapi.errorhandling.XtremIOApiException)

Aggregations

XtremIOApiException (com.emc.storageos.xtremio.restapi.errorhandling.XtremIOApiException)2 XtremIOInitiatorGroup (com.emc.storageos.xtremio.restapi.model.response.XtremIOInitiatorGroup)2 XtremIOInitiatorGroups (com.emc.storageos.xtremio.restapi.model.response.XtremIOInitiatorGroups)2 ClientResponse (com.sun.jersey.api.client.ClientResponse)2