Search in sources :

Example 1 with QuotaDirectoryRestRep

use of com.emc.storageos.model.file.QuotaDirectoryRestRep in project coprhd-controller by CoprHD.

the class FileMapper method map.

public static QuotaDirectoryRestRep map(QuotaDirectory from) {
    if (from == null) {
        return null;
    }
    QuotaDirectoryRestRep to = new QuotaDirectoryRestRep();
    mapDataObjectFields(from, to);
    to.setName(from.getName());
    if (from.getParent() != null) {
        to.setParentFileSystem(toRelatedResource(ResourceTypeEnum.FILE, from.getParent().getURI()));
    }
    if (from.getProject() != null) {
        to.setProject(toRelatedResource(ResourceTypeEnum.PROJECT, from.getProject().getURI()));
    }
    to.setNativeId(from.getNativeId());
    if (from.getSize() != null) {
        to.setQuotaSize(CapacityUtils.convertBytesToGBInStr(from.getSize()));
    }
    if (from.getSecurityStyle() != null) {
        to.setSecurityStyle(from.getSecurityStyle());
    }
    if (from.getOpLock() != null) {
        to.setOpLock(from.getOpLock());
    }
    to.setSoftLimit(from.getSoftLimit());
    to.setSoftGrace(from.getSoftGrace());
    to.setNotificationLimit(from.getNotificationLimit());
    to.setSoftLimitExceeded(from.getSoftLimitExceeded());
    return to;
}
Also used : QuotaDirectoryRestRep(com.emc.storageos.model.file.QuotaDirectoryRestRep)

Example 2 with QuotaDirectoryRestRep

use of com.emc.storageos.model.file.QuotaDirectoryRestRep in project coprhd-controller by CoprHD.

the class FileStorageUtils method deactivateQuotaDirectory.

public static void deactivateQuotaDirectory(URI quotaDirectoryId) {
    Task<QuotaDirectoryRestRep> response = execute(new DeactivateQuotaDirectory(quotaDirectoryId));
    addAffectedResource(response);
    logInfo("file.storage.task", response.getOpId());
}
Also used : QuotaDirectoryRestRep(com.emc.storageos.model.file.QuotaDirectoryRestRep) DeactivateQuotaDirectory(com.emc.sa.service.vipr.file.tasks.DeactivateQuotaDirectory)

Example 3 with QuotaDirectoryRestRep

use of com.emc.storageos.model.file.QuotaDirectoryRestRep in project coprhd-controller by CoprHD.

the class FileStorageUtils method createFileSystemQuotaDirectory.

public static URI createFileSystemQuotaDirectory(URI fileSystemId, String name, Boolean oplock, String securityStyle, String size, int softLimit, int advisoryLimit, int gracePeriod) {
    Task<QuotaDirectoryRestRep> task = execute(new CreateFileSystemQuotaDirectory(fileSystemId, name, oplock, securityStyle, size, softLimit, advisoryLimit, gracePeriod));
    addAffectedResource(task);
    return task.getResourceId();
}
Also used : CreateFileSystemQuotaDirectory(com.emc.sa.service.vipr.file.tasks.CreateFileSystemQuotaDirectory) QuotaDirectoryRestRep(com.emc.storageos.model.file.QuotaDirectoryRestRep)

Example 4 with QuotaDirectoryRestRep

use of com.emc.storageos.model.file.QuotaDirectoryRestRep in project coprhd-controller by CoprHD.

the class RemoveFileSystemQuotaDirectoryHelper method deleteQuotaDirectories.

public void deleteQuotaDirectories() {
    for (QuotaDirectoryRestRep qd : quotaDirectories) {
        URI qdId = qd.getId();
        FileStorageUtils.deactivateQuotaDirectory(qdId);
    }
}
Also used : QuotaDirectoryRestRep(com.emc.storageos.model.file.QuotaDirectoryRestRep) URI(java.net.URI)

Example 5 with QuotaDirectoryRestRep

use of com.emc.storageos.model.file.QuotaDirectoryRestRep in project coprhd-controller by CoprHD.

the class FileSystems method fileSystemQuotaJson.

public static void fileSystemQuotaJson(String id) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    QuotaDirectoryRestRep quota = client.quotaDirectories().getQuotaDirectory(uri(id));
    renderJSON(quota);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) QuotaDirectoryRestRep(com.emc.storageos.model.file.QuotaDirectoryRestRep)

Aggregations

QuotaDirectoryRestRep (com.emc.storageos.model.file.QuotaDirectoryRestRep)7 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)3 FlashException (controllers.util.FlashException)2 CreateFileSystemQuotaDirectory (com.emc.sa.service.vipr.file.tasks.CreateFileSystemQuotaDirectory)1 DeactivateQuotaDirectory (com.emc.sa.service.vipr.file.tasks.DeactivateQuotaDirectory)1 QuotaDirectoryDeleteParam (com.emc.storageos.model.file.QuotaDirectoryDeleteParam)1 URI (java.net.URI)1