Search in sources :

Example 41 with VirtualArrayRestRep

use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.

the class VirtualArrays method getVirtualArray.

/**
 * Gets the given virtual array. If the array cannot be found, an error is show and redirects back to the referrer
 * or to the list page.
 *
 * @param id
 *            the virtual array ID.
 * @return the virtual array.
 */
@Util
public static VirtualArrayRestRep getVirtualArray(String id) {
    VirtualArrayRestRep virtualArray = VirtualArrayUtils.getVirtualArray(id);
    if (virtualArray == null) {
        flash.error(MessagesUtils.get(UNKNOWN, id));
        backToReferrer();
        list();
    }
    return virtualArray;
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) BourneUtil(util.BourneUtil) Util(play.mvc.Util)

Example 42 with VirtualArrayRestRep

use of com.emc.storageos.model.varray.VirtualArrayRestRep 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 43 with VirtualArrayRestRep

use of com.emc.storageos.model.varray.VirtualArrayRestRep 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 44 with VirtualArrayRestRep

use of com.emc.storageos.model.varray.VirtualArrayRestRep 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 45 with VirtualArrayRestRep

use of com.emc.storageos.model.varray.VirtualArrayRestRep in project coprhd-controller by CoprHD.

the class FileSystems method getTargetVArrys.

public static void getTargetVArrys() {
    ViPRCoreClient client = BourneUtil.getViprClient();
    List<StringOption> targetVarrayOptions = Lists.newArrayList();
    List<VirtualArrayRestRep> virtualArrays = client.varrays().getAll();
    if (virtualArrays != null && !virtualArrays.isEmpty()) {
        for (VirtualArrayRestRep varray : virtualArrays) {
            targetVarrayOptions.add(new StringOption(varray.getId().toString(), varray.getName()));
        }
    }
    renderArgs.put("targetVarrayOptions", targetVarrayOptions);
    renderJSON(targetVarrayOptions);
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) StringOption(util.StringOption) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep)

Aggregations

VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)56 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)15 URI (java.net.URI)15 AssetOption (com.emc.vipr.model.catalog.AssetOption)14 Asset (com.emc.sa.asset.annotation.Asset)11 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)11 ArrayList (java.util.ArrayList)10 FlashException (controllers.util.FlashException)9 HashSet (java.util.HashSet)8 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)7 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)6 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)6 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)5 StoragePortRestRep (com.emc.storageos.model.ports.StoragePortRestRep)5 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)4 ExportGroupRestRep (com.emc.storageos.model.block.export.ExportGroupRestRep)4 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)4 BlockVirtualPoolRestRep (com.emc.storageos.model.vpool.BlockVirtualPoolRestRep)4 HashMap (java.util.HashMap)4 BlockConsistencyGroupRestRep (com.emc.storageos.model.block.BlockConsistencyGroupRestRep)3