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;
}
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());
}
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();
}
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);
}
}
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);
}
Aggregations