use of com.emc.storageos.vnxe.models.FileSystemQuotaCreateParam in project coprhd-controller by CoprHD.
the class VNXeApiClient method createQuotaDirectory.
/**
* create tree quota
*
* @param fsID
* file system ID
* @param quotaName
* name of quota to be created
* @param hardLimit
* the provided hard limit
* @param softLimit
* the provided soft limit
* @param softGrace
* The provided grace period for soft limit
* @return VNXeCommandJob
* @throws VNXeException
*/
public VNXeCommandJob createQuotaDirectory(final String fsID, final String quotaName, final Long hardLimit, final Long softLimit, final long softGrace) throws VNXeException {
_logger.info("Creating quota directory with path: {} for fs ID: {}", "/" + quotaName, fsID);
FileSystemQuotaCreateParam param = new FileSystemQuotaCreateParam();
FileSystemQuotaConfigParam qcParam = new FileSystemQuotaConfigParam();
if (softGrace > 0) {
qcParam.setGracePeriod(softGrace);
}
param.setPath("/" + quotaName);
if (hardLimit > 0) {
param.setHardLimit(hardLimit);
}
FileSystemQuotaRequests req = new FileSystemQuotaRequests(_khClient);
param.setFilesystem(fsID);
if (softLimit > 0) {
param.setSoftLimit(softLimit);
}
VNXeCommandResult res = req.createFileSystemQuotaSync(param);
return req.updateFileSystemQuotaConfig(res.getId(), qcParam);
}
Aggregations