Search in sources :

Example 31 with FileShareRestRep

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);
    }
}
Also used : Task(com.emc.vipr.client.Task) FileSnapshotRestRep(com.emc.storageos.model.file.FileSnapshotRestRep) ArrayList(java.util.ArrayList) CreateFileSnapshot(com.emc.sa.service.vipr.file.tasks.CreateFileSnapshot) FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep)

Example 32 with FileShareRestRep

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);
    }
}
Also used : FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep) URI(java.net.URI)

Example 33 with FileShareRestRep

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());
}
Also used : FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep)

Example 34 with FileShareRestRep

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;
}
Also used : AssetOption(com.emc.vipr.model.catalog.AssetOption) FilePolicyRestRep(com.emc.storageos.model.file.policy.FilePolicyRestRep) FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Example 35 with FileShareRestRep

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;
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) AssetOption(com.emc.vipr.model.catalog.AssetOption) FileShareRestRep(com.emc.storageos.model.file.FileShareRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

Aggregations

FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)66 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)27 URI (java.net.URI)15 Asset (com.emc.sa.asset.annotation.Asset)13 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)13 AssetOption (com.emc.vipr.model.catalog.AssetOption)10 ArrayList (java.util.ArrayList)7 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)6 FileProtectionRestRep (com.emc.storageos.model.file.FileShareRestRep.FileProtectionRestRep)5 FilePolicyRestRep (com.emc.storageos.model.file.policy.FilePolicyRestRep)5 Task (com.emc.vipr.client.Task)4 FlashException (controllers.util.FlashException)4 CreateFileSystem (com.emc.sa.service.vipr.file.tasks.CreateFileSystem)3 DeactivateFileSystem (com.emc.sa.service.vipr.file.tasks.DeactivateFileSystem)3 DeactivateFileSystemExportRule (com.emc.sa.service.vipr.file.tasks.DeactivateFileSystemExportRule)3 FileSystemDeleteParam (com.emc.storageos.model.file.FileSystemDeleteParam)3 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)3 FileVirtualPoolRestRep (com.emc.storageos.model.vpool.FileVirtualPoolRestRep)3 MachineTagsCollection (com.emc.sa.machinetags.MachineTagsCollection)2 DeactivateFileSystemShare (com.emc.sa.service.vipr.file.tasks.DeactivateFileSystemShare)2