Search in sources :

Example 1 with FileSystemQuotaRequests

use of com.emc.storageos.vnxe.requests.FileSystemQuotaRequests in project coprhd-controller by CoprHD.

the class VNXeApiClient method getQuotaByName.

/**
 * Get quota by its name
 *
 * @param fsId
 *            fs Id
 * @param name
 *            quota name
 * @return VNXUnityTreeQuota
 */
public VNXUnityTreeQuota getQuotaByName(String fsId, String name) {
    _logger.info("Getting the quota {}: ", name);
    FileSystemQuotaRequests req = new FileSystemQuotaRequests(_khClient);
    return req.getByName(fsId, name);
}
Also used : FileSystemQuotaRequests(com.emc.storageos.vnxe.requests.FileSystemQuotaRequests)

Example 2 with FileSystemQuotaRequests

use of com.emc.storageos.vnxe.requests.FileSystemQuotaRequests 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)

Example 3 with FileSystemQuotaRequests

use of com.emc.storageos.vnxe.requests.FileSystemQuotaRequests 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);
}
Also used : FileSystemQuotaRequests(com.emc.storageos.vnxe.requests.FileSystemQuotaRequests) VNXeCommandResult(com.emc.storageos.vnxe.models.VNXeCommandResult) FileSystemQuotaCreateParam(com.emc.storageos.vnxe.models.FileSystemQuotaCreateParam) FileSystemQuotaConfigParam(com.emc.storageos.vnxe.models.FileSystemQuotaConfigParam)

Example 4 with FileSystemQuotaRequests

use of com.emc.storageos.vnxe.requests.FileSystemQuotaRequests in project coprhd-controller by CoprHD.

the class VNXeApiClient method getQuotaById.

/**
 * Get quota by its ID
 *
 * @param name
 *            quota ID
 * @return VNXUnityTreeQuota
 */
public VNXUnityTreeQuota getQuotaById(String quotaId) {
    _logger.info("Getting the quota {}: ", quotaId);
    FileSystemQuotaRequests req = new FileSystemQuotaRequests(_khClient);
    return req.getFileSystemQuota(quotaId);
}
Also used : FileSystemQuotaRequests(com.emc.storageos.vnxe.requests.FileSystemQuotaRequests)

Aggregations

FileSystemQuotaRequests (com.emc.storageos.vnxe.requests.FileSystemQuotaRequests)4 FileSystemQuotaConfigParam (com.emc.storageos.vnxe.models.FileSystemQuotaConfigParam)2 FileSystemQuotaCreateParam (com.emc.storageos.vnxe.models.FileSystemQuotaCreateParam)1 FileSystemQuotaModifyParam (com.emc.storageos.vnxe.models.FileSystemQuotaModifyParam)1 VNXeCommandResult (com.emc.storageos.vnxe.models.VNXeCommandResult)1