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, String protocol, String type, String permissions, String rootUser) {
Task<FileSnapshotRestRep> task = execute(new DeactivateFileSnapshotExport(fileSnapshotId, protocol, type, permissions, rootUser));
addAffectedResource(task);
}
use of com.emc.storageos.model.file.FileSnapshotRestRep in project coprhd-controller by CoprHD.
the class FileSnapshots method listSnapshotAcl.
/**
* This method called when Access Control List page is loaded.
*
* @param snapShotId
* SnapShot id of the provided SnapShot.
* @param shareName
* Name of the file share.
*/
public static void listSnapshotAcl(String snapshotId, String shareName) {
renderArgs.put("dataTable", new ShareACLDataTable());
renderArgs.put("snapshotId", uri(snapshotId));
renderArgs.put("shareName", shareName);
renderArgs.put("aclURL", "/file/snapshots/" + uri(snapshotId) + "/shares/" + shareName + "/acl");
ViPRCoreClient client = BourneUtil.getViprClient();
FileSnapshotRestRep restRep = client.fileSnapshots().get(uri(snapshotId));
renderArgs.put("snapshotName", restRep.getName());
SnapshotShareACLForm shareACL = new SnapshotShareACLForm();
render(shareACL);
}
use of com.emc.storageos.model.file.FileSnapshotRestRep in project coprhd-controller by CoprHD.
the class FileSnapshots method delete.
private static void delete(List<URI> ids) {
if (ids != null) {
ViPRCoreClient client = BourneUtil.getViprClient();
List<Task<FileSnapshotRestRep>> tasks = Lists.newArrayList();
for (URI id : ids) {
Task<FileSnapshotRestRep> task = client.fileSnapshots().deactivate(id);
tasks.add(task);
}
if (!tasks.isEmpty()) {
flash.put("info", MessagesUtils.get("resources.filesnapshots.deactivate", tasks.size()));
}
}
snapshots(null);
}
use of com.emc.storageos.model.file.FileSnapshotRestRep in project coprhd-controller by CoprHD.
the class FileSnapshots method snapshot.
public static void snapshot(String snapshotId) {
ViPRCoreClient client = BourneUtil.getViprClient();
FileSnapshotRestRep snapshot = null;
try {
snapshot = client.fileSnapshots().get(uri(snapshotId));
} catch (ViPRHttpException e) {
if (e.getHttpCode() == 404 || e.getHttpCode() == 400) {
flash.error(MessagesUtils.get(UNKNOWN, snapshotId));
snapshots(null);
}
throw e;
}
if (snapshot != null) {
if (snapshot.getParent() != null) {
FileShareRestRep fileSystem = client.fileSystems().get(snapshot.getParent());
renderArgs.put("fileSystem", fileSystem);
}
Tasks<FileSnapshotRestRep> tasksResponse = client.fileSnapshots().getTasks(snapshot.getId());
List<Task<FileSnapshotRestRep>> tasks = tasksResponse.getTasks();
renderArgs.put("tasks", tasks);
} else {
flash.error(MessagesUtils.get(UNKNOWN, snapshotId));
snapshots(null);
}
render(snapshot);
}
use of com.emc.storageos.model.file.FileSnapshotRestRep in project coprhd-controller by CoprHD.
the class FileSnapshots method deleteFileSnapshot.
@FlashException(referrer = { "snapshot" })
public static void deleteFileSnapshot(String fileSnapshotId) {
if (StringUtils.isNotBlank(fileSnapshotId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
Task<FileSnapshotRestRep> task = client.fileSnapshots().deactivate(uri(fileSnapshotId));
flash.put("info", MessagesUtils.get("resources.filesnapshot.deactivate"));
}
snapshot(fileSnapshotId);
}
Aggregations