use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.
the class NetAppClusterApi method updateQtree.
public void updateQtree(String qtreeName, String volumeName, Boolean opLocks, String securityStyle, Long size, String vfilerName) throws NetAppCException {
try {
netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
netAppClusterFacade.updateQtree(qtreeName, volumeName, opLocks, securityStyle);
String qtreePath = constructQtreePath(volumeName, qtreeName);
// Modify the quota
if (size > 0) {
netAppClusterFacade.setDiskLimitTreeQuota(volumeName, qtreePath, size / SIZE_KB, 0);
try {
QuotaStatus quotaStatus = netAppClusterFacade.getQuotaStatus(volumeName);
if (quotaStatus.OFF == quotaStatus) {
netAppClusterFacade.turnQuotaOn(volumeName);
} else {
// Resizing only works for certain types of changes to the quotas file.
// For other changes, you need to reinitialize quotas.
netAppClusterFacade.reintializeQuota(volumeName);
}
// QuotaStatus quotaStatus = netAppClusterFacade.getQuotaStatus(volumeName);
_logger.info("Quota status on volume {} is {}. ", volumeName, quotaStatus.toString());
} catch (Exception e) {
_logger.warn("Quota status on volume {} is not stable. ", volumeName);
}
}
} catch (Exception e) {
throw NetAppCException.exceptions.createQtreeFailed(qtreeName, e.getMessage());
}
}
use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.
the class NetAppClusterApi method deleteAllQTrees.
public Boolean deleteAllQTrees(String volName) throws NetAppCException {
String qtreeName = null;
try {
netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
List<Qtree> qtrees = netAppClusterFacade.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, _svmName);
}
}
}
return true;
} catch (Exception e) {
_logger.error("Deleting the qtree {} of filesystem {} failed ", qtreeName, volName);
throw NetAppCException.exceptions.deleteQtreeFailed(qtreeName, e.getMessage());
}
}
use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.
the class NetAppClusterApi method modifyShare.
public Boolean modifyShare(String mntpath, String shareName, String comment, int maxusers, String permission, String forcegroup) throws NetAppCException {
try {
netAppClusterFacade = new NetAppClusterFacade(_ipAddress, _portNumber, _userName, _password, _https, true, _svmName);
CifsAcl acl = new CifsAcl();
acl.setShareName(shareName);
acl.setAccess(CifsAccess.valueOfAccess(cifsPermissionMap.get(permission)));
acl.setUserName(CIFS_DEFAULT_GROUP);
netAppClusterFacade.setCIFSAcl(acl);
return true;
} catch (Exception e) {
throw NetAppCException.exceptions.modifyShareFailed(_ipAddress, e.getMessage());
}
}
use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.
the class NetAppClusterApi method modifyCIFSShareAcl.
public boolean modifyCIFSShareAcl(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.setCIFSAcl(acl);
}
} catch (Exception e) {
_logger.error("Error Occured {} ", e.getMessage(), e);
throw NetAppCException.exceptions.modifyCifsShareAclFailed(shareName, e.getMessage());
}
return true;
}
use of com.iwave.ext.netappc.NetAppClusterFacade in project coprhd-controller by CoprHD.
the class NetAppClusterApi method deleteCIFSShareAcl.
public boolean deleteCIFSShareAcl(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.deleteCIFSAcl(acl);
}
} catch (Exception e) {
_logger.error("Error Occured {} ", e.getMessage(), e);
throw NetAppCException.exceptions.deleteCIFSShareAclFailed(shareName, e.getMessage());
}
return true;
}
Aggregations