use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class CreateFileSnapshotService method execute.
@Override
public void execute() {
for (FileShareRestRep fs : fileSystems) {
String fileSystemId = fs.getId().toString();
checkAndPurgeObsoleteSnapshot(fileSystemId);
Task<FileSnapshotRestRep> task = ViPRExecutionUtils.execute(new CreateFileSnapshot(fileSystemId, name));
addAffectedResource(task);
// record file snapshots for retention
List<Task<FileSnapshotRestRep>> tasks = new ArrayList<Task<FileSnapshotRestRep>>();
tasks.add(task);
addRetainedReplicas(fs.getId(), tasks);
}
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class CreateFileSystemQuotaDirectoryHelper method createFileSystemQuotaDirectories.
public void createFileSystemQuotaDirectories() {
int tempSoftLimit = (softLimit != null) ? softLimit.intValue() : 0;
int tempAdvisoryLimit = (advisoryLimit != null) ? advisoryLimit.intValue() : 0;
int tempGracePeriod = (gracePeriod != null) ? gracePeriod.intValue() : 0;
for (FileShareRestRep fs : fileSystems) {
URI fsId = fs.getId();
FileStorageUtils.createFileSystemQuotaDirectory(fsId, name, oplock, securityStyle, size, tempSoftLimit, tempAdvisoryLimit, tempGracePeriod);
}
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class MountNFSExportHelper method mountExport.
public void mountExport(URI fsId, URI hostId, String subDirectory, String mountPath, String securityType, String hostName, String fsType) {
FileShareRestRep fs = FileStorageUtils.getFileSystem(fsId);
FileStorageUtils.mountNFSExport(hostId, fs.getId(), subDirectory, mountPath, securityType, fsType);
ExecutionUtils.addAffectedResource(fs.getId().toString());
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileProvider method getFilesystemsWithPolicies.
@Asset("fileFilesystemWithPolicies")
@AssetDependencies("project")
public List<AssetOption> getFilesystemsWithPolicies(AssetOptionsContext ctx, URI project) {
List<AssetOption> options = Lists.newArrayList();
List<FilePolicyRestRep> fileSystemPolicies = getAllFileSystemLevelPolicies(ctx);
List<FileShareRestRep> fileSystems = api(ctx).fileSystems().findByProject(project);
for (FilePolicyRestRep policyRestRep : fileSystemPolicies) {
if (policyRestRep.getAssignedResources() != null && !policyRestRep.getAssignedResources().isEmpty()) {
for (FileShareRestRep fileSystem : fileSystems) {
for (NamedRelatedResourceRep resource : policyRestRep.getAssignedResources()) {
if (resource.getId().equals(fileSystem.getId())) {
options.add(new AssetOption(fileSystem.getId(), fileSystem.getName()));
break;
}
}
}
}
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
use of com.emc.storageos.model.file.FileShareRestRep in project coprhd-controller by CoprHD.
the class FileProvider method getFileContinuousCopies.
@Asset("fileContinuousCopies")
@AssetDependencies("fileWithContinuousCopies")
public List<AssetOption> getFileContinuousCopies(AssetOptionsContext ctx, URI fileId) {
ViPRCoreClient client = api(ctx);
List<AssetOption> options = Lists.newArrayList();
List<NamedRelatedResourceRep> mirrors = client.fileSystems().getFileContinuousCopies(fileId);
for (NamedRelatedResourceRep mirror : mirrors) {
FileShareRestRep fileShare = client.fileSystems().get(mirror.getId());
options.add(new AssetOption(fileShare.getId(), fileShare.getName()));
}
AssetOptionsUtils.sortOptionsByLabel(options);
return options;
}
Aggregations