Search in sources :

Example 11 with NetAppClusterFacade

use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.

the class NetAppClusterApi method deleteNFSShare.

public Boolean deleteNFSShare(String fsName, String qtreeName, ExportRule oldRule, String mountPath) throws NetAppCException {
    try {
        netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
        List<com.iwave.ext.netapp.utils.ExportRule> netAppCompatableRules = new ArrayList<>();
        com.iwave.ext.netapp.utils.ExportRule netAppOldRule = new com.iwave.ext.netapp.utils.ExportRule();
        copyPropertiesToSave(netAppOldRule, oldRule);
        netAppCompatableRules.add(netAppOldRule);
        netAppClusterFacade.deleteNFSShare(fsName, qtreeName, netAppOldRule, mountPath);
        return true;
    } catch (Exception e) {
        throw NetAppCException.exceptions.deleteNFSFailed(mountPath, _ipAddress, e.getMessage());
    }
}
Also used : NetAppClusterFacade(com.iwave.ext.netappc.NetAppClusterFacade) ArrayList(java.util.ArrayList) ExportRule(com.emc.storageos.model.file.ExportRule)

Example 12 with NetAppClusterFacade

use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.

the class NetAppClusterApi method deleteNFSExport.

public Boolean deleteNFSExport(String exportPath) throws NetAppCException {
    try {
        netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
        List<String> deletedPaths = netAppClusterFacade.deleteNFSShare(exportPath, false);
        if ((deletedPaths == null) || (1 >= deletedPaths.size())) {
            _logger.error("exportPath deletion failed");
            return false;
        }
        return true;
    } catch (Exception e) {
        throw NetAppCException.exceptions.deleteNFSFailed(exportPath, _ipAddress, e.getMessage());
    }
}
Also used : NetAppClusterFacade(com.iwave.ext.netappc.NetAppClusterFacade)

Example 13 with NetAppClusterFacade

use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.

the class NetAppClusterApi method addNFSShare.

public Boolean addNFSShare(String fsName, String qtreeName, String exportPath, ExportRule newRule) throws NetAppCException {
    try {
        netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
        _logger.info("NetApp Inputs for modifyNFSShare exportPath: {} ", exportPath);
        List<com.iwave.ext.netapp.utils.ExportRule> netAppCompatableRules = new ArrayList<>();
        com.iwave.ext.netapp.utils.ExportRule netAppNewRule = new com.iwave.ext.netapp.utils.ExportRule();
        copyPropertiesToSave(netAppNewRule, newRule);
        netAppCompatableRules.add(netAppNewRule);
        netAppClusterFacade.addNFSShare(fsName, qtreeName, exportPath, netAppNewRule);
    } catch (Exception e) {
        _logger.error("Error Occured {} ", e.getMessage(), e);
        throw NetAppCException.exceptions.exportFSFailed(exportPath, exportPath, e.getMessage());
    }
    return true;
}
Also used : NetAppClusterFacade(com.iwave.ext.netappc.NetAppClusterFacade) ArrayList(java.util.ArrayList) ExportRule(com.emc.storageos.model.file.ExportRule)

Example 14 with NetAppClusterFacade

use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.

the class NetAppClusterApi method listSnapshots.

public List<String> listSnapshots(String volumeName) throws NetAppCException {
    List<String> snapshots = null;
    try {
        netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
        snapshots = (List<String>) netAppClusterFacade.listSnapshots(volumeName);
    } catch (Exception e) {
        String[] params = { volumeName, e.getMessage() };
        _logger.info("Failed to retrieve list of snapshots for {} due to {}", params);
    }
    return snapshots;
}
Also used : NetAppClusterFacade(com.iwave.ext.netappc.NetAppClusterFacade)

Example 15 with NetAppClusterFacade

use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.

the class NetAppClusterApi method offlineVol.

public Boolean offlineVol(String volName) throws NetAppCException {
    try {
        netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
        netAppClusterFacade.setVolumeOffline(volName, 1);
        return true;
    } catch (Exception e) {
        throw NetAppCException.exceptions.deleteFSFailed(volName, _ipAddress, e.getMessage());
    }
}
Also used : NetAppClusterFacade(com.iwave.ext.netappc.NetAppClusterFacade)

Aggregations

NetAppClusterFacade (com.iwave.ext.netappc.NetAppClusterFacade)27 ArrayList (java.util.ArrayList)6 CifsAcl (com.iwave.ext.netappc.model.CifsAcl)5 ExportRule (com.emc.storageos.model.file.ExportRule)3 HashMap (java.util.HashMap)3 QuotaStatus (com.iwave.ext.netapp.QuotaCommands.QuotaStatus)2 Map (java.util.Map)2 ExportsRuleInfo (com.iwave.ext.netapp.model.ExportsRuleInfo)1 Qtree (com.iwave.ext.netapp.model.Qtree)1 NFSSecurityStyle (com.iwave.ext.netappc.NFSSecurityStyle)1 StorageVirtualMachineInfo (com.iwave.ext.netappc.StorageVirtualMachineInfo)1 List (java.util.List)1