Search in sources :

Example 11 with FileSnapshotRestRep

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

the class FileSnapshots method deleteSnapshotExport.

@FlashException(referrer = { "snapshot" })
public static void deleteSnapshotExport(String snapshotId, String security, String exportPath) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    ExportRule rule = new ExportRule();
    rule.setSecFlavor(security);
    List<ExportRule> list = Lists.newArrayList();
    list.add(rule);
    ExportRules exportRules = new ExportRules();
    exportRules.setExportRules(list);
    SnapshotExportUpdateParams params = new SnapshotExportUpdateParams();
    params.setExportRulesToDelete(exportRules);
    FileSnapshotRestRep snapshot = client.fileSnapshots().get(uri(snapshotId));
    String subDir = FileUtils.findSubDirectory(snapshot.getMountPath(), exportPath);
    client.fileSnapshots().updateExport(uri(snapshotId), subDir, params);
    flash.put("info", MessagesUtils.get("resources.filesnapshot.export.deactivate"));
    snapshot(snapshotId);
}
Also used : SnapshotExportUpdateParams(com.emc.storageos.model.file.SnapshotExportUpdateParams) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FileSnapshotRestRep(com.emc.storageos.model.file.FileSnapshotRestRep) ExportRules(com.emc.storageos.model.file.ExportRules) ExportRule(com.emc.storageos.model.file.ExportRule) FlashException(controllers.util.FlashException)

Example 12 with FileSnapshotRestRep

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

the class FileSystems method fileSystemSnapshots.

public static void fileSystemSnapshots(String fileSystemId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    List<NamedRelatedResourceRep> refs = client.fileSnapshots().listByFileSystem(uri(fileSystemId));
    List<FileSnapshotRestRep> snapshots = client.fileSnapshots().getByRefs(refs);
    render(snapshots);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) FileSnapshotRestRep(com.emc.storageos.model.file.FileSnapshotRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep)

Example 13 with FileSnapshotRestRep

use of com.emc.storageos.model.file.FileSnapshotRestRep 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 14 with FileSnapshotRestRep

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

the class FileStorageUtils method deactivateSnapshotExport.

public static void deactivateSnapshotExport(URI fileSnapshotId, Boolean allDir, String subDir) {
    Task<FileSnapshotRestRep> task = execute(new DeactivateFileSnapshotExportRule(fileSnapshotId, allDir, subDir));
    addAffectedResource(task);
}
Also used : FileSnapshotRestRep(com.emc.storageos.model.file.FileSnapshotRestRep) DeactivateFileSnapshotExportRule(com.emc.sa.service.vipr.file.tasks.DeactivateFileSnapshotExportRule)

Example 15 with FileSnapshotRestRep

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

the class FileStorageUtils method deactivateFileSnapshot.

public static void deactivateFileSnapshot(URI snapshotId) {
    Task<FileSnapshotRestRep> task = execute(new DeactivateFileSnapshot(snapshotId));
    addAffectedResource(task);
}
Also used : FileSnapshotRestRep(com.emc.storageos.model.file.FileSnapshotRestRep) DeactivateFileSnapshot(com.emc.sa.service.vipr.file.tasks.DeactivateFileSnapshot)

Aggregations

FileSnapshotRestRep (com.emc.storageos.model.file.FileSnapshotRestRep)21 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)8 DeactivateFileSnapshotExportRule (com.emc.sa.service.vipr.file.tasks.DeactivateFileSnapshotExportRule)3 Task (com.emc.vipr.client.Task)3 FlashException (controllers.util.FlashException)3 CreateFileSnapshot (com.emc.sa.service.vipr.file.tasks.CreateFileSnapshot)2 ExportRule (com.emc.storageos.model.file.ExportRule)2 ExportRules (com.emc.storageos.model.file.ExportRules)2 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)2 SnapshotExportUpdateParams (com.emc.storageos.model.file.SnapshotExportUpdateParams)2 URI (java.net.URI)2 ArrayList (java.util.ArrayList)2 CreateFileSnapshotExport (com.emc.sa.service.vipr.file.tasks.CreateFileSnapshotExport)1 CreateFileSnapshotShare (com.emc.sa.service.vipr.file.tasks.CreateFileSnapshotShare)1 DeactivateFileSnapshot (com.emc.sa.service.vipr.file.tasks.DeactivateFileSnapshot)1 DeactivateFileSnapshotExport (com.emc.sa.service.vipr.file.tasks.DeactivateFileSnapshotExport)1 DeactivateFileSnapshotShare (com.emc.sa.service.vipr.file.tasks.DeactivateFileSnapshotShare)1 DeactivateFileSystemExportRule (com.emc.sa.service.vipr.file.tasks.DeactivateFileSystemExportRule)1 FindFileSnapshotExportRules (com.emc.sa.service.vipr.file.tasks.FindFileSnapshotExportRules)1 FindFileSystemExportRules (com.emc.sa.service.vipr.file.tasks.FindFileSystemExportRules)1