Search in sources :

Example 21 with NetAppClusterFacade

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

the class NetAppClusterApi method listCIFSShareAcl.

public List<CifsAcl> listCIFSShareAcl(String shareName) {
    try {
        netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
        _logger.info("Facade created : {} ", netAppClusterFacade);
        List<CifsAcl> oldAcls = netAppClusterFacade.listCIFSAcls(shareName);
        return oldAcls;
    } catch (Exception e) {
        _logger.error("Error Occured {} ", e.getMessage(), e);
        throw NetAppCException.exceptions.listCIFSShareAclFailed(shareName, e.getMessage());
    }
}
Also used : CifsAcl(com.iwave.ext.netappc.model.CifsAcl) NetAppClusterFacade(com.iwave.ext.netappc.NetAppClusterFacade)

Example 22 with NetAppClusterFacade

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

the class NetAppClusterApi method deleteQtree.

public void deleteQtree(String qtreeName, String volumeName, String vfilerName) throws NetAppCException {
    try {
        netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
        String qtreePath = constructQtreePath(volumeName, qtreeName);
        // Before deleting the qtree, delete the quota associated with the tree.
        if (netAppClusterFacade.getTreeQuota(volumeName, qtreePath) != null) {
            netAppClusterFacade.deleteTreeQuota(volumeName, qtreePath);
        }
        // Now delete the qtree.
        netAppClusterFacade.deleteQtree(qtreePath, true);
    } catch (Exception e) {
        throw NetAppCException.exceptions.deleteQtreeFailed(qtreeName, e.getMessage());
    }
}
Also used : NetAppClusterFacade(com.iwave.ext.netappc.NetAppClusterFacade)

Example 23 with NetAppClusterFacade

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

the class NetAppClusterApi method deleteNFS.

public Boolean deleteNFS(String volName) throws NetAppCException {
    String exportPath = volName;
    try {
        netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
        if (volName != null && !volName.isEmpty() && !volName.startsWith("/")) {
            exportPath = "/" + volName;
        }
        List<ExportsRuleInfo> exportRules = listNFSExportRules(volName);
        if (exportRules.isEmpty()) {
            _logger.info("Export doesn't exist on the array to delete {}", exportPath);
            return true;
        }
        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(volName, _ipAddress, e.getMessage());
    }
}
Also used : NetAppClusterFacade(com.iwave.ext.netappc.NetAppClusterFacade) ExportsRuleInfo(com.iwave.ext.netapp.model.ExportsRuleInfo)

Example 24 with NetAppClusterFacade

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

the class NetAppClusterApi method setQtreemode.

public void setQtreemode(String volPath, String mode) throws NetAppCException {
    try {
        netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
        netAppClusterFacade.setQTreeSecurityStyle(volPath, mode);
    } catch (Exception e) {
        throw NetAppCException.exceptions.setVolumeQtreeModeFailed(volPath, mode);
    }
}
Also used : NetAppClusterFacade(com.iwave.ext.netappc.NetAppClusterFacade)

Example 25 with NetAppClusterFacade

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

the class NetAppClusterApi method addCIFSShareAcl.

public boolean addCIFSShareAcl(String shareName, List<CifsAcl> acls) {
    try {
        netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
        _logger.info("Facade created : {} ", netAppClusterFacade);
        for (CifsAcl acl : acls) {
            acl.setShareName(shareName);
            netAppClusterFacade.addCIFSAcl(acl);
        }
    } catch (Exception e) {
        _logger.error("Error Occured {} ", e.getMessage(), e);
        throw NetAppCException.exceptions.addCifsShareAclFailed(shareName, e.getMessage());
    }
    return true;
}
Also used : CifsAcl(com.iwave.ext.netappc.model.CifsAcl) 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