Search in sources :

Example 1 with IsilonSshApi

use of com.emc.storageos.isilon.restapi.IsilonSshApi in project coprhd-controller by CoprHD.

the class IsilonFileStorageDevice method getIsilonDeviceSsh.

/**
 * Get isilon device represented by the StorageDevice
 *
 * @param StorageSystem
 *            object
 * @return IsilonSshApi object
 */
IsilonSshApi getIsilonDeviceSsh(StorageSystem device) throws IsilonException {
    IsilonSshApi sshDmApi = new IsilonSshApi();
    sshDmApi.setConnParams(device.getIpAddress(), device.getUsername(), device.getPassword());
    return sshDmApi;
}
Also used : IsilonSshApi(com.emc.storageos.isilon.restapi.IsilonSshApi)

Example 2 with IsilonSshApi

use of com.emc.storageos.isilon.restapi.IsilonSshApi in project coprhd-controller by CoprHD.

the class IsilonCommunicationInterface method discoverNetworkPools.

/**
 * discover the network interface of given Isilon storage cluster
 *
 * @param storageSystem
 * @return
 * @throws IsilonCollectionException
 */
private List<IsilonNetworkPool> discoverNetworkPools(StorageSystem storageSystem) throws IsilonCollectionException {
    List<IsilonNetworkPool> isilonNetworkPoolList = new ArrayList<IsilonNetworkPool>();
    URI storageSystemId = storageSystem.getId();
    _log.info("discoverNetworkPools for storage system {} - start", storageSystemId);
    List<IsilonNetworkPool> isilonNetworkPoolsTemp = null;
    try {
        if (VersionChecker.verifyVersionDetails(ONEFS_V8, storageSystem.getFirmwareVersion()) >= 0) {
            _log.info("Isilon release version {} and storagesystem label {}", storageSystem.getFirmwareVersion(), storageSystem.getLabel());
            IsilonApi isilonApi = getIsilonDevice(storageSystem);
            isilonNetworkPoolsTemp = isilonApi.getNetworkPools(null);
            if (isilonNetworkPoolsTemp != null) {
                isilonNetworkPoolList.addAll(isilonNetworkPoolsTemp);
            }
        } else {
            IsilonSshApi sshDmApi = new IsilonSshApi();
            sshDmApi.setConnParams(storageSystem.getIpAddress(), storageSystem.getUsername(), storageSystem.getPassword());
            Map<String, List<String>> networkPools = sshDmApi.getNetworkPools();
            List<String> smartconnects = null;
            IsilonNetworkPool isiNetworkPool = null;
            for (Map.Entry<String, List<String>> networkpool : networkPools.entrySet()) {
                smartconnects = networkpool.getValue();
                if (smartconnects != null) {
                    for (String smartconnect : smartconnects) {
                        isiNetworkPool = new IsilonNetworkPool();
                        isiNetworkPool.setAccess_zone(networkpool.getKey());
                        isiNetworkPool.setSc_dns_zone(smartconnect);
                        isilonNetworkPoolList.add(isiNetworkPool);
                    }
                }
            }
        }
    } catch (Exception e) {
        _log.error("discover of NetworkPools is failed. %s", e.getMessage());
    }
    return isilonNetworkPoolList;
}
Also used : IsilonSshApi(com.emc.storageos.isilon.restapi.IsilonSshApi) ArrayList(java.util.ArrayList) URI(java.net.URI) IsilonException(com.emc.storageos.isilon.restapi.IsilonException) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException) IOException(java.io.IOException) JSONException(org.codehaus.jettison.json.JSONException) URISyntaxException(java.net.URISyntaxException) DatabaseException(com.emc.storageos.db.exceptions.DatabaseException) IsilonCollectionException(com.emc.storageos.plugins.metering.isilon.IsilonCollectionException) IsilonNetworkPool(com.emc.storageos.isilon.restapi.IsilonNetworkPool) IsilonList(com.emc.storageos.isilon.restapi.IsilonApi.IsilonList) ArrayList(java.util.ArrayList) URIQueryResultList(com.emc.storageos.db.client.constraint.URIQueryResultList) List(java.util.List) IsilonApi(com.emc.storageos.isilon.restapi.IsilonApi) Map(java.util.Map) UnManagedSMBShareMap(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedSMBShareMap) UnManagedFSExportMap(com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExportMap) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) StringMap(com.emc.storageos.db.client.model.StringMap) CifsServerMap(com.emc.storageos.db.client.model.CifsServerMap)

Aggregations

IsilonSshApi (com.emc.storageos.isilon.restapi.IsilonSshApi)2 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)1 CifsServerMap (com.emc.storageos.db.client.model.CifsServerMap)1 StringMap (com.emc.storageos.db.client.model.StringMap)1 UnManagedFSExportMap (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedFSExportMap)1 UnManagedSMBShareMap (com.emc.storageos.db.client.model.UnManagedDiscoveredObjects.UnManagedSMBShareMap)1 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)1 IsilonApi (com.emc.storageos.isilon.restapi.IsilonApi)1 IsilonList (com.emc.storageos.isilon.restapi.IsilonApi.IsilonList)1 IsilonException (com.emc.storageos.isilon.restapi.IsilonException)1 IsilonNetworkPool (com.emc.storageos.isilon.restapi.IsilonNetworkPool)1 BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)1 IsilonCollectionException (com.emc.storageos.plugins.metering.isilon.IsilonCollectionException)1 IOException (java.io.IOException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1