use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class VirtualArrays method removeStoragePools.
/**
* Removes a number of storage pools from the given virtual array, and redisplays the storage pools page.
*
* @param virtualArrayId
* the virtual array ID.
* @param ids
* the IDs of the storage pools to remove.
*/
@FlashException
public static void removeStoragePools(String virtualArrayId, @As(",") String[] ids) {
if ((ids != null) && (ids.length > 0)) {
VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
updateStoragePools(uris(ids), removeVirtualArray(virtualArray));
}
storagePools(virtualArrayId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class VirtualArrays method addStoragePorts.
/**
* Adds a number of storage ports to the given virtual array, and redisplays the storage ports page.
*
* @param virtualArrayId
* the virtual array ID.
* @param ids
* the IDs of the storage ports to add.
*/
@FlashException
public static void addStoragePorts(String virtualArrayId, @As(",") String[] ids) {
if ((ids != null) && (ids.length > 0)) {
VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
updateStoragePorts(uris(ids), addVirtualArray(virtualArray));
}
storagePorts(virtualArrayId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class FileProtectionPolicies method listJson.
@FlashException(value = "list", keep = true)
public static void listJson() {
FilePolicyListRestRep viprSchedulePolicies = getViprClient().fileProtectionPolicies().listFilePolicies();
List<ScheculePoliciesDataTable.FileProtectionPolicy> scheculePolicies = Lists.newArrayList();
for (NamedRelatedResourceRep policy : viprSchedulePolicies.getFilePolicies()) {
scheculePolicies.add(new ScheculePoliciesDataTable.FileProtectionPolicy(getViprClient().fileProtectionPolicies().getFilePolicy(policy.getId())));
}
renderJSON(DataTablesSupport.createJSON(scheculePolicies, params));
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class FileProtectionPolicies method unassign.
@FlashException(value = "list", keep = true)
public static void unassign(String ids) {
FilePolicyRestRep filePolicyRestRep = getViprClient().fileProtectionPolicies().get(uri(ids));
if (filePolicyRestRep != null) {
AssignPolicyForm assignPolicy = new AssignPolicyForm().form(filePolicyRestRep);
addRenderApplyPolicysAt();
addAssignedProjectArgs(filePolicyRestRep);
addAssignedVPoolArgs(filePolicyRestRep);
render(assignPolicy);
} else {
flash.error(MessagesUtils.get(UNKNOWN, ids));
list();
}
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class FileProtectionPolicies method saveUnAssignPolicy.
@FlashException(keep = true, referrer = { "unassign" })
public static void saveUnAssignPolicy(AssignPolicyForm assignPolicy) {
if (assignPolicy == null) {
Logger.error("No Unassign policy parameters passed");
badRequest("No Unassign policy parameters passed");
return;
}
assignPolicy.validate("UnassignPolicy");
if (Validation.hasErrors()) {
Common.handleError();
}
assignPolicy.id = params.get("id");
FilePolicyUnAssignParam unAssignPolicyParam = new FilePolicyUnAssignParam();
try {
if (updateUnAssignPolicyParam(assignPolicy, unAssignPolicyParam)) {
TaskResourceRep taskRes = getViprClient().fileProtectionPolicies().unassignPolicy(uri(assignPolicy.id), unAssignPolicyParam);
if (isTaskSuccessful(assignPolicy.id, taskRes)) {
flash.success(MessagesUtils.get("unAssignPolicy.request.saved", assignPolicy.policyName));
}
}
} catch (Exception ex) {
flash.error(ex.getMessage(), assignPolicy.policyName);
}
if (StringUtils.isNotBlank(assignPolicy.referrerUrl)) {
redirect(assignPolicy.referrerUrl);
} else {
list();
}
}
Aggregations