Search in sources :

Example 1 with CreateFileSnapshot

use of com.emc.sa.service.vipr.file.tasks.CreateFileSnapshot in project coprhd-controller by CoprHD.

the class FileStorageUtils method createFileSnapshot.

public static URI createFileSnapshot(URI fileSystemId, String name) {
    Task<FileSnapshotRestRep> task = execute(new CreateFileSnapshot(fileSystemId, name));
    addAffectedResource(task);
    return task.getResourceId();
}
Also used : FileSnapshotRestRep(com.emc.storageos.model.file.FileSnapshotRestRep) CreateFileSnapshot(com.emc.sa.service.vipr.file.tasks.CreateFileSnapshot)

Example 2 with CreateFileSnapshot

use of com.emc.sa.service.vipr.file.tasks.CreateFileSnapshot 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)

Aggregations

CreateFileSnapshot (com.emc.sa.service.vipr.file.tasks.CreateFileSnapshot)2 FileSnapshotRestRep (com.emc.storageos.model.file.FileSnapshotRestRep)2 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)1 Task (com.emc.vipr.client.Task)1 ArrayList (java.util.ArrayList)1