use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class VirtualArrays method removeStoragePorts.
/**
* Removes a number of storage ports from 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 remove.
*/
@FlashException
public static void removeStoragePorts(String virtualArrayId, @As(",") String[] ids) {
if ((ids != null) && (ids.length > 0)) {
VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
updateStoragePorts(uris(ids), removeVirtualArray(virtualArray));
}
storagePorts(virtualArrayId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class VirtualArrays method save.
/**
* Saves a virtual array.
*
* @param virtualArray
* the virtual array.
*/
@FlashException(referrer = { "createSimple", "edit", "list" })
public static void save(VirtualArrayForm virtualArray) {
if (virtualArray == null) {
list();
}
virtualArray.validate("virtualArray");
if (Validation.hasErrors()) {
Common.handleError();
}
VirtualArrayRestRep varray = virtualArray.save();
if (TenantUtils.canReadAllTenants() && VirtualArrayUtils.canUpdateACLs()) {
saveTenantACLs(varray.getId().toString(), virtualArray.tenants);
}
flash.success(MessagesUtils.get(SAVED_SUCCESS, virtualArray.name));
backToReferrer();
list();
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class VirtualArrays method addStoragePools.
/**
* Adds a number of storage pools to 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 add.
*/
@FlashException
public static void addStoragePools(String virtualArrayId, @As(",") String[] ids) {
if ((ids != null) && (ids.length > 0)) {
VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
updateStoragePools(uris(ids), addVirtualArray(virtualArray));
}
storagePools(virtualArrayId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class VirtualArrays method removeNetworks.
/**
* Removes a number of networks from the given virtual array, and redisplays the networks page.
*
* @param virtualArrayId
* the virtual array ID.
* @param ids
* the IDs of the networks to remove.
*/
@FlashException
public static void removeNetworks(String virtualArrayId, @As(",") String[] ids) {
if ((ids == null) || (ids.length == 0)) {
networks(virtualArrayId);
}
VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
updateNetworks(uris(ids), removeVirtualArray(virtualArray));
networks(virtualArrayId);
}
use of controllers.util.FlashException in project coprhd-controller by CoprHD.
the class VirtualArrays method createSimple.
/**
* Simple create and save operation that takes only the name.
*
* @param name
* Name of the virtual array
*/
@FlashException("list")
public static void createSimple(String name) {
VirtualArrayForm virtualArray = new VirtualArrayForm();
virtualArray.name = name;
virtualArray.validate("virtualArray");
if (Validation.hasErrors()) {
flash.error(MessagesUtils.get(SAVED_ERROR, virtualArray.name));
list();
}
VirtualArrayRestRep varray = virtualArray.save();
flash.success(MessagesUtils.get(SAVED_SUCCESS, virtualArray.name));
virtualArray.load(varray);
edit(virtualArray.id);
}
Aggregations