use of com.emc.storageos.model.file.FileSnapshotRestRep in project coprhd-controller by CoprHD.
the class FileSnapshotService method getSnapshots.
/**
* Get all Snapshots matching the path
*
* @QueryParam mountpath
* @brief Show snapshots
* @return Snapshot details
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_MONITOR, Role.TENANT_ADMIN }, acls = { ACL.OWN, ACL.ALL })
public List<FileSnapshotRestRep> getSnapshots(@QueryParam("mountpath") String mountPath) {
List<FileSnapshotRestRep> snapRepList = new ArrayList<FileSnapshotRestRep>();
List<URI> ids = _dbClient.queryByType(Snapshot.class, true);
Iterator<Snapshot> iter = _dbClient.queryIterativeObjects(Snapshot.class, ids);
_log.info("getSnapshots call ... with mountpath {}", mountPath);
while (iter.hasNext()) {
Snapshot snap = iter.next();
if (snap != null) {
if (mountPath != null) {
if (snap.getMountPath().equalsIgnoreCase(mountPath)) {
snapRepList.add(map(snap));
} else {
_log.info("Skip this Snapshot Mount Path doesnt match {} {}", snap.getMountPath(), mountPath);
}
} else {
_log.info("Mountpath query param is null");
snapRepList.add(map(snap));
}
}
}
return snapRepList;
}
use of com.emc.storageos.model.file.FileSnapshotRestRep 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();
}
use of com.emc.storageos.model.file.FileSnapshotRestRep in project coprhd-controller by CoprHD.
the class FileStorageUtils method createFileSnapshotExport.
public static String createFileSnapshotExport(URI fileSnapshotId, String comment, String security, String permissions, String rootUser, List<String> exportHosts, String subDirectory) {
Task<FileSnapshotRestRep> task = execute(new CreateFileSnapshotExport(fileSnapshotId, comment, NFS_PROTOCOL, security, permissions, rootUser, exportHosts, subDirectory));
addAffectedResource(task);
String exportId = task.getResourceId().toString();
addRollback(new DeactivateFileSnapshotExportRule(fileSnapshotId, true, null));
logInfo("file.storage.export.task", exportId, task.getOpId());
return exportId;
}
use of com.emc.storageos.model.file.FileSnapshotRestRep in project coprhd-controller by CoprHD.
the class FileStorageUtils method deactivateSnapshotShare.
public static void deactivateSnapshotShare(URI fileSnapshotId, String shareName) {
Task<FileSnapshotRestRep> task = execute(new DeactivateFileSnapshotShare(fileSnapshotId, shareName));
addAffectedResource(task);
}
use of com.emc.storageos.model.file.FileSnapshotRestRep in project coprhd-controller by CoprHD.
the class FileStorageUtils method setFileSnapshotShareACL.
public static void setFileSnapshotShareACL(URI snapshotId, String shareName, FileSystemACLs[] acls) {
Task<FileSnapshotRestRep> task = execute(new SetFileSnapshotShareACL(snapshotId, shareName, acls));
addAffectedResource(task);
logInfo("file.storage.share.snapshot.acl", snapshotId, shareName, task.getOpId());
}
Aggregations