Search in sources :

Example 61 with FlashException

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);
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) FlashException(controllers.util.FlashException)

Example 62 with FlashException

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();
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) FlashException(controllers.util.FlashException)

Example 63 with FlashException

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);
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) FlashException(controllers.util.FlashException)

Example 64 with FlashException

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);
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) FlashException(controllers.util.FlashException)

Example 65 with FlashException

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);
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) FlashException(controllers.util.FlashException)

Aggregations

FlashException (controllers.util.FlashException)122 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)45 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)9 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)9 URI (java.net.URI)9 ExportUpdateParam (com.emc.storageos.model.block.export.ExportUpdateParam)8 Restrictions (controllers.deadbolt.Restrictions)8 ArrayList (java.util.ArrayList)7 FilePolicyRestRep (com.emc.storageos.model.file.policy.FilePolicyRestRep)6 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)5 CopiesParam (com.emc.storageos.model.block.CopiesParam)4 SiteRestRep (com.emc.storageos.model.dr.SiteRestRep)4 ExportRule (com.emc.storageos.model.file.ExportRule)4 ExportRules (com.emc.storageos.model.file.ExportRules)4 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)4 ProjectRestRep (com.emc.storageos.model.project.ProjectRestRep)4 ServiceErrorException (com.emc.vipr.client.exceptions.ServiceErrorException)4 JsonArray (com.google.gson.JsonArray)3 JsonObject (com.google.gson.JsonObject)3 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)2