Search in sources :

Example 21 with BaseCollectionException

use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.

the class VNXFileCommunicationInterface method checkCifsEnabled.

private boolean checkCifsEnabled(final StorageSystem system, VNXDataMover mover) throws VNXException {
    boolean cifsSupported = false;
    try {
        Map<String, Object> reqAttributeMap = getRequestParamsMap(system);
        reqAttributeMap.put(VNXFileConstants.MOVER_ID, Integer.toString(mover.getId()));
        reqAttributeMap.put(VNXFileConstants.ISVDM, "false");
        _discExecutor.setKeyMap(reqAttributeMap);
        _discExecutor.execute((Namespace) _discNamespaces.getNsList().get(VNXFileConstants.VNX_FILE_CIFS_CONFIG));
        cifsSupported = (Boolean) _discExecutor.getKeyMap().get(VNXFileConstants.CIFS_SUPPORTED);
    } catch (BaseCollectionException e) {
        throw new VNXException("check CIFS Enabled op failed", e);
    }
    return cifsSupported;
}
Also used : VNXException(com.emc.storageos.vnx.xmlapi.VNXException) DiscoveredDataObject(com.emc.storageos.db.client.model.DiscoveredDataObject) UnManagedDiscoveredObject(com.emc.storageos.db.client.model.UnManagedDiscoveredObject) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Example 22 with BaseCollectionException

use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.

the class VNXFileCommunicationInterface method getVdmPortGroups.

private List<VNXVdm> getVdmPortGroups(final StorageSystem system) throws VNXException {
    List<VNXVdm> vdms = null;
    try {
        Map<String, Object> reqAttributeMap = getRequestParamsMap(system);
        _discExecutor.setKeyMap(reqAttributeMap);
        _discExecutor.execute((Namespace) _discNamespaces.getNsList().get("vnxfileVdm"));
        vdms = (ArrayList<VNXVdm>) _discExecutor.getKeyMap().get(VNXFileConstants.VDM_INFO);
    } catch (BaseCollectionException e) {
        throw new VNXException("Get Vdm Port Groups op failed", e);
    }
    return vdms;
}
Also used : VNXException(com.emc.storageos.vnx.xmlapi.VNXException) VNXVdm(com.emc.storageos.vnx.xmlapi.VNXVdm) DiscoveredDataObject(com.emc.storageos.db.client.model.DiscoveredDataObject) UnManagedDiscoveredObject(com.emc.storageos.db.client.model.UnManagedDiscoveredObject) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Example 23 with BaseCollectionException

use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.

the class VNXFileCommunicationInterface method getCifServers.

private List<VNXCifsServer> getCifServers(final StorageSystem system, String moverId, String isVdm) throws VNXException {
    List<VNXCifsServer> cifsServers;
    try {
        Map<String, Object> reqAttributeMap = getRequestParamsMap(system);
        reqAttributeMap.put(VNXFileConstants.MOVER_ID, moverId);
        reqAttributeMap.put(VNXFileConstants.ISVDM, isVdm);
        _discExecutor.setKeyMap(reqAttributeMap);
        _discExecutor.execute((Namespace) _discNamespaces.getNsList().get(VNXFileConstants.VNX_FILE_CIFS_CONFIG));
        cifsServers = (List<VNXCifsServer>) _discExecutor.getKeyMap().get(VNXFileConstants.CIFS_SERVERS);
    } catch (BaseCollectionException e) {
        throw new VNXException("Get CifServers op failed", e);
    }
    return cifsServers;
}
Also used : VNXCifsServer(com.emc.storageos.vnx.xmlapi.VNXCifsServer) VNXException(com.emc.storageos.vnx.xmlapi.VNXException) DiscoveredDataObject(com.emc.storageos.db.client.model.DiscoveredDataObject) UnManagedDiscoveredObject(com.emc.storageos.db.client.model.UnManagedDiscoveredObject) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Example 24 with BaseCollectionException

use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.

the class VNXFileCommunicationInterface method getPortGroups.

private List<VNXDataMover> getPortGroups(final StorageSystem system) throws VNXException {
    List<VNXDataMover> dataMovers = null;
    try {
        Map<String, Object> reqAttributeMap = getRequestParamsMap(system);
        _discExecutor.setKeyMap(reqAttributeMap);
        _discExecutor.execute((Namespace) _discNamespaces.getNsList().get("vnxfileStoragePortGroup"));
        dataMovers = (ArrayList<VNXDataMover>) _discExecutor.getKeyMap().get(VNXFileConstants.STORAGE_PORT_GROUPS);
    } catch (BaseCollectionException e) {
        throw new VNXException("Get Port Groups op failed", e);
    }
    return dataMovers;
}
Also used : VNXDataMover(com.emc.storageos.vnx.xmlapi.VNXDataMover) VNXException(com.emc.storageos.vnx.xmlapi.VNXException) DiscoveredDataObject(com.emc.storageos.db.client.model.DiscoveredDataObject) UnManagedDiscoveredObject(com.emc.storageos.db.client.model.UnManagedDiscoveredObject) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Example 25 with BaseCollectionException

use of com.emc.storageos.plugins.BaseCollectionException in project coprhd-controller by CoprHD.

the class VNXFileCommunicationInterface method discoverNamedFileSystem.

private VNXFileSystem discoverNamedFileSystem(StorageSystem system, String fsName) {
    List<VNXFileSystem> fileSystems = null;
    VNXFileSystem fileSystem = null;
    try {
        // Retrieve list of File Systems from the VNX file device.
        Map<String, Object> reqAttributeMap = getRequestParamsMap(system);
        reqAttributeMap.put(VNXFileConstants.FILESYSTEM_NAME, fsName);
        _discExecutor.setKeyMap(reqAttributeMap);
        _discExecutor.execute((Namespace) _discNamespaces.getNsList().get(VNXFileConstants.VNX_FILE_SELECTED_FS));
        fileSystems = (List<VNXFileSystem>) _discExecutor.getKeyMap().get(VNXFileConstants.FILESYSTEMS);
        if ((fileSystems != null) && !(fileSystems.isEmpty())) {
            _logger.info("Number of file systems found: {}", fileSystems.size());
            fileSystem = fileSystems.get(0);
        } else {
            _logger.info("No File System was found on the VNX device");
        }
    } catch (BaseCollectionException ex) {
        _logger.error("VNX Exception: Discovery of File Systems failed for storage system {} due to {}", system.getId(), ex.getMessage());
    }
    return fileSystem;
}
Also used : VNXFileSystem(com.emc.storageos.vnx.xmlapi.VNXFileSystem) DiscoveredDataObject(com.emc.storageos.db.client.model.DiscoveredDataObject) UnManagedDiscoveredObject(com.emc.storageos.db.client.model.UnManagedDiscoveredObject) BaseCollectionException(com.emc.storageos.plugins.BaseCollectionException)

Aggregations

BaseCollectionException (com.emc.storageos.plugins.BaseCollectionException)185 Iterator (java.util.Iterator)66 CIMInstance (javax.cim.CIMInstance)66 CIMObjectPath (javax.cim.CIMObjectPath)59 StorageSystem (com.emc.storageos.db.client.model.StorageSystem)55 IOException (java.io.IOException)47 URI (java.net.URI)47 ArrayList (java.util.ArrayList)47 PostMethod (org.apache.commons.httpclient.methods.PostMethod)36 ResponsePacket (com.emc.nas.vnxfile.xmlapi.ResponsePacket)35 Status (com.emc.nas.vnxfile.xmlapi.Status)33 AccessProfile (com.emc.storageos.plugins.AccessProfile)30 List (java.util.List)30 Map (java.util.Map)30 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)28 StoragePool (com.emc.storageos.db.client.model.StoragePool)27 Header (org.apache.commons.httpclient.Header)27 StoragePort (com.emc.storageos.db.client.model.StoragePort)22 HashSet (java.util.HashSet)18 URISyntaxException (java.net.URISyntaxException)17