Search in sources :

Example 1 with FileSystemQuotaModifyParam

use of com.emc.storageos.vnxe.models.FileSystemQuotaModifyParam in project coprhd-controller by CoprHD.

the class VNXeApiClient method updateQuotaDirectory.

/**
 * update tree quota
 *
 * @param quotaId
 *            Id of quota to be updated
 * @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 updateQuotaDirectory(String quotaId, final Long hardLimit, final Long softLimit, final long softGrace) throws VNXeException {
    _logger.info("updating quota directory with ID: {} ", "/" + quotaId);
    FileSystemQuotaModifyParam param = new FileSystemQuotaModifyParam();
    FileSystemQuotaConfigParam qcParam = new FileSystemQuotaConfigParam();
    FileSystemQuotaRequests req = new FileSystemQuotaRequests(_khClient);
    if (hardLimit > 0) {
        param.setHardLimit(hardLimit);
    }
    if (softLimit > 0) {
        param.setSoftLimit(softLimit);
    }
    if (softGrace > 0) {
        qcParam.setGracePeriod(softGrace);
        req.updateFileSystemQuotaConfig(quotaId, qcParam);
    }
    return req.updateFileSystemQuotaAsync(quotaId, param);
}
Also used : FileSystemQuotaRequests(com.emc.storageos.vnxe.requests.FileSystemQuotaRequests) FileSystemQuotaModifyParam(com.emc.storageos.vnxe.models.FileSystemQuotaModifyParam) FileSystemQuotaConfigParam(com.emc.storageos.vnxe.models.FileSystemQuotaConfigParam)

Aggregations

FileSystemQuotaConfigParam (com.emc.storageos.vnxe.models.FileSystemQuotaConfigParam)1 FileSystemQuotaModifyParam (com.emc.storageos.vnxe.models.FileSystemQuotaModifyParam)1 FileSystemQuotaRequests (com.emc.storageos.vnxe.requests.FileSystemQuotaRequests)1