Search in sources :

Example 1 with RemoteClusterConnectionInformation

use of com.emc.fapiclient.ws.RemoteClusterConnectionInformation in project coprhd-controller by CoprHD.

the class RecoverPointClient method getClusterTopology.

public Set<String> getClusterTopology() throws RecoverPointException {
    Set<String> clusterTopology = new HashSet<String>();
    String mgmtIPAddress = _endpoint.toASCIIString();
    if (null == mgmtIPAddress) {
        throw RecoverPointException.exceptions.noRecoverPointEndpoint();
    }
    try {
        Map<Long, String> clusterSiteNameMap = new HashMap<Long, String>();
        for (ClusterConfiguration clusterInfo : functionalAPI.getFullRecoverPointSettings().getSystemSettings().getGlobalSystemConfiguration().getClustersConfigurations()) {
            clusterSiteNameMap.put(clusterInfo.getCluster().getId(), clusterInfo.getInternalClusterName());
        }
        logger.info("RecoverPoint service: Returning all RP Sites associated with endpoint: " + _endpoint);
        for (ClusterConfiguration clusterInfo : functionalAPI.getFullRecoverPointSettings().getSystemSettings().getGlobalSystemConfiguration().getClustersConfigurations()) {
            for (RemoteClusterConnectionInformation connectionInfo : clusterInfo.getRemoteClustersConnectionInformations()) {
                // Find the internal site name associated with the cluster name
                clusterTopology.add(clusterInfo.getInternalClusterName() + " " + clusterSiteNameMap.get(connectionInfo.getCluster().getId()) + " " + connectionInfo.getConnectionType().toString());
            }
        }
        return clusterTopology;
    } catch (RecoverPointException e) {
        throw e;
    } catch (Exception e) {
        throw RecoverPointException.exceptions.failedToPingMgmtIP(mgmtIPAddress, getCause(e));
    }
}
Also used : HashMap(java.util.HashMap) RecoverPointException(com.emc.storageos.recoverpoint.exceptions.RecoverPointException) ClusterConfiguration(com.emc.fapiclient.ws.ClusterConfiguration) RemoteClusterConnectionInformation(com.emc.fapiclient.ws.RemoteClusterConnectionInformation) FunctionalAPIValidationException_Exception(com.emc.fapiclient.ws.FunctionalAPIValidationException_Exception) FunctionalAPIActionFailedException_Exception(com.emc.fapiclient.ws.FunctionalAPIActionFailedException_Exception) FunctionalAPIInternalError_Exception(com.emc.fapiclient.ws.FunctionalAPIInternalError_Exception) RecoverPointException(com.emc.storageos.recoverpoint.exceptions.RecoverPointException) HashSet(java.util.HashSet)

Aggregations

ClusterConfiguration (com.emc.fapiclient.ws.ClusterConfiguration)1 FunctionalAPIActionFailedException_Exception (com.emc.fapiclient.ws.FunctionalAPIActionFailedException_Exception)1 FunctionalAPIInternalError_Exception (com.emc.fapiclient.ws.FunctionalAPIInternalError_Exception)1 FunctionalAPIValidationException_Exception (com.emc.fapiclient.ws.FunctionalAPIValidationException_Exception)1 RemoteClusterConnectionInformation (com.emc.fapiclient.ws.RemoteClusterConnectionInformation)1 RecoverPointException (com.emc.storageos.recoverpoint.exceptions.RecoverPointException)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1