use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class BlockVolumes method resumeContinuousCopy.
@FlashException(referrer = { "volume" })
public static void resumeContinuousCopy(String volumeId, String continuousCopyId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(continuousCopyId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
CopiesParam input = createCopiesParam(continuousCopyId);
Tasks<VolumeRestRep> tasks = client.blockVolumes().resumeContinuousCopies(uri(volumeId), input);
flash.put("info", MessagesUtils.get("resources.continuouscopy.resume"));
}
volume(volumeId, null);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class BlockVolumes method cancelMigration.
@FlashException(referrer = { "volume" })
public static void cancelMigration(String volumeId, String migrationId) {
if (StringUtils.isNotBlank(volumeId) && StringUtils.isNotBlank(migrationId)) {
ViPRCoreClient client = BourneUtil.getViprClient();
client.blockMigrations().cancel(uri(migrationId));
flash.put("info", MessagesUtils.get("resources.migrations.cancel"));
}
volume(volumeId, null);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class FileSnapshots method deleteSnapshotShare.
@FlashException(referrer = { "snapshot" })
public static void deleteSnapshotShare(String snapshotId, String shareName) {
ViPRCoreClient client = BourneUtil.getViprClient();
Task<FileSnapshotRestRep> task = client.fileSnapshots().removeShare(uri(snapshotId), shareName);
flash.put("info", MessagesUtils.get("resources.filesnapshot.share.deactivate"));
snapshot(snapshotId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class FileSnapshots method removeSnapShotAcl.
/**
* This method called When user selects ACLs and hit delete button.
*
* @param aclURL
* URL of the snapshot share.
* @param ids
* ids of the selected ACL
*/
@FlashException(referrer = { "snapshot" })
public static void removeSnapShotAcl(String aclUrl, @As(",") String[] ids) {
ShareACLs aclsToDelete = new ShareACLs();
List<ShareACL> shareAcls = new ArrayList<ShareACL>();
String snapshotId = null;
String shareName = null;
if (ids != null && ids.length > 0) {
for (String id : ids) {
String type = SnapshotShareACLForm.extractTypeFromId(id);
String name = SnapshotShareACLForm.extractNameFromId(id);
String domain = SnapshotShareACLForm.extractDomainFromId(id);
snapshotId = SnapshotShareACLForm.extractSnapshotFromId(id);
shareName = SnapshotShareACLForm.extractShareNameFromId(id);
ShareACL ace = new ShareACL();
if (SnapshotShareACLForm.GROUP.equalsIgnoreCase(type)) {
ace.setGroup(name);
} else {
ace.setUser(name);
}
if (domain != null && !"".equals(domain) && !"null".equals(domain)) {
ace.setDomain(domain);
}
shareAcls.add(ace);
}
aclsToDelete.setShareACLs(shareAcls);
SnapshotCifsShareACLUpdateParams input = new SnapshotCifsShareACLUpdateParams();
input.setAclsToDelete(aclsToDelete);
ViPRCoreClient client = BourneUtil.getViprClient();
client.fileSnapshots().updateShareACL(uri(snapshotId), shareName, input);
}
flash.success(MessagesUtils.get("resources.filesystem.share.acl.deleted"));
listSnapshotAcl(snapshotId, shareName);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class FileSnapshots method save.
@FlashException(referrer = { "snapshot" })
public static void save(Boolean edit, String id, String fsPath, String exportPath, String security, String anon, @As(",") List<String> ro, @As(",") List<String> rw, @As(",") List<String> root) {
ExportRule rule = new ExportRule();
rule.setAnon(anon);
rule.setSecFlavor(security);
// Clean up endpoints list by removing all empty items if any
List<String> empty = Arrays.asList("");
rw.removeAll(empty);
ro.removeAll(empty);
root.removeAll(empty);
if (!ro.isEmpty()) {
rule.setReadOnlyHosts(FileUtils.buildEndpointList(ro));
}
if (!rw.isEmpty()) {
rule.setReadWriteHosts(FileUtils.buildEndpointList(rw));
}
if (!root.isEmpty()) {
rule.setRootHosts(FileUtils.buildEndpointList(root));
}
List<ExportRule> addRules = Lists.newArrayList();
addRules.add(rule);
ExportRules exportRules = new ExportRules();
exportRules.setExportRules(addRules);
SnapshotExportUpdateParams params = new SnapshotExportUpdateParams();
if (!edit) {
params.setExportRulesToAdd(exportRules);
} else {
params.setExportRulesToModify(exportRules);
}
ViPRCoreClient client = BourneUtil.getViprClient();
client.fileSnapshots().updateExport(uri(id), null, params);
flash.put("info", MessagesUtils.get("resources.filesystem.export.update"));
snapshot(id);
}
Aggregations