Search in sources :

Example 16 with NetAppFacade

use of com.iwave.ext.netapp.NetAppFacade in project coprhd-controller by CoprHD.

the class NetAppApi method modifyShare.

public Boolean modifyShare(String mntpath, String shareName, String comment, int maxusers, String permission, String forcegroup) throws NetAppException {
    try {
        netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https, _vFilerName);
        CifsAcl acl = new CifsAcl();
        acl.setShareName(shareName);
        acl.setAccess(CifsAccess.valueOfAccess(cifsPermissionMap.get(permission)));
        acl.setUserName(CIFS_DEFAULT_GROUP);
        netAppFacade.setCIFSAcl(acl);
        return true;
    } catch (Exception e) {
        throw NetAppException.exceptions.modifyShareFailed(_ipAddress, e.getMessage());
    }
}
Also used : NetAppFacade(com.iwave.ext.netapp.NetAppFacade) CifsAcl(com.iwave.ext.netapp.model.CifsAcl)

Example 17 with NetAppFacade

use of com.iwave.ext.netapp.NetAppFacade in project coprhd-controller by CoprHD.

the class NetAppApi method deleteAllQTrees.

public Boolean deleteAllQTrees(String volName) throws NetAppException {
    String qtreeName = null;
    try {
        netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https);
        List<Qtree> qtrees = netAppFacade.listQtrees(volName);
        if (qtrees != null && !qtrees.isEmpty()) {
            for (Qtree qtree : qtrees) {
                qtreeName = qtree.getQtree();
                // Skip the unnamed Qtree.
                if (qtreeName != null && !qtreeName.isEmpty()) {
                    deleteQtree(qtreeName, volName, _vFilerName);
                }
            }
        }
        return true;
    } catch (Exception e) {
        _logger.error("Deleting the qtree {} of filesystem {} failed ", qtreeName, volName);
        throw NetAppException.exceptions.deleteQtreeFailed(qtreeName, e.getMessage());
    }
}
Also used : Qtree(com.iwave.ext.netapp.model.Qtree) NetAppFacade(com.iwave.ext.netapp.NetAppFacade)

Example 18 with NetAppFacade

use of com.iwave.ext.netapp.NetAppFacade in project coprhd-controller by CoprHD.

the class NetAppApi method setVolumeSize.

public Boolean setVolumeSize(String volume, String newSize) throws NetAppException {
    try {
        netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https);
        String cmdResult = netAppFacade.setVolumeSize(volume, newSize);
        // Return value is a empty string if the operation is not success
        if (cmdResult == null || cmdResult.equalsIgnoreCase("")) {
            return false;
        } else {
            return true;
        }
    } catch (Exception e) {
        throw NetAppException.exceptions.setVolumeSizeFailed(volume, newSize);
    }
}
Also used : NetAppFacade(com.iwave.ext.netapp.NetAppFacade)

Example 19 with NetAppFacade

use of com.iwave.ext.netapp.NetAppFacade in project coprhd-controller by CoprHD.

the class NetAppApi method setQtreemode.

public void setQtreemode(String volPath, String mode) throws NetAppException {
    try {
        netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https, _vFilerName);
        netAppFacade.setQTreeSecurityStyle(volPath, mode);
    } catch (Exception e) {
        throw NetAppException.exceptions.setVolumeQtreeModeFailed(volPath, mode);
    }
}
Also used : NetAppFacade(com.iwave.ext.netapp.NetAppFacade)

Example 20 with NetAppFacade

use of com.iwave.ext.netapp.NetAppFacade in project coprhd-controller by CoprHD.

the class NetAppApi method modifyShare.

public void modifyShare(String shareName, Map<String, String> attrs) throws NetAppException {
    try {
        netAppFacade = new NetAppFacade(_ipAddress, _portNumber, _userName, _password, _https);
        netAppFacade.changeCIFSShare(shareName, attrs);
    } catch (Exception e) {
        throw NetAppException.exceptions.modifyShareNameFailed(shareName, _ipAddress, e.getMessage());
    }
}
Also used : NetAppFacade(com.iwave.ext.netapp.NetAppFacade)

Aggregations

NetAppFacade (com.iwave.ext.netapp.NetAppFacade)24 ArrayList (java.util.ArrayList)5 CifsAcl (com.iwave.ext.netapp.model.CifsAcl)4 ExportRule (com.emc.storageos.model.file.ExportRule)2 QuotaStatus (com.iwave.ext.netapp.QuotaCommands.QuotaStatus)2 HashMap (java.util.HashMap)2 NFSSecurityStyle (com.iwave.ext.netapp.NFSSecurityStyle)1 VFilerInfo (com.iwave.ext.netapp.VFilerInfo)1 VolumeOptionType (com.iwave.ext.netapp.VolumeOptionType)1 Qtree (com.iwave.ext.netapp.model.Qtree)1 List (java.util.List)1 Map (java.util.Map)1