Search in sources :

Example 16 with VirtualArrayRestRep

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

the class VirtualArrays method edit.

/**
 * Displays the page for editing an existing virtual array.
 *
 * @param id
 *            the virtual array ID.
 */
public static void edit(String id) {
    VirtualArrayRestRep virtualArray = getVirtualArray(id);
    VirtualArrayForm form = new VirtualArrayForm();
    form.load(virtualArray);
    edit(form);
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep)

Example 17 with VirtualArrayRestRep

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

the class VirtualArrays method addAllFlashVirtualArray.

private static void addAllFlashVirtualArray() {
    VirtualArrayForm virtualArray = new VirtualArrayForm();
    virtualArray.name = ALL_FLASH_VARRAY;
    virtualArray.validate("virtualArray");
    if (Validation.hasErrors()) {
        flash.error(MessagesUtils.get(SAVED_ERROR, virtualArray.name));
        list();
    }
    VirtualArrayRestRep varray = virtualArray.save();
    virtualArray.load(varray);
    List<String> ids = Lists.newArrayList();
    for (StorageSystemRestRep storageSystem : StorageSystemUtils.getStorageSystems()) {
        // Check if storage system is of type UNITY, VMAX or XtremIO
        if (StringUtils.equals(XTREMIO, storageSystem.getSystemType())) {
            ids.add(storageSystem.getId().toString());
        }
        if (StringUtils.equals(VMAX, storageSystem.getSystemType()) || StringUtils.equals(UNITY, storageSystem.getSystemType())) {
            String modelType = storageSystem.getModel();
            if (modelType != null && (modelType.contains(SUFFIX_ALL_FLASH) || modelType.contains(POWERMAX) || modelType.contains(PMAX))) {
                ids.add(storageSystem.getId().toString());
            }
        }
    }
    addStorageSysVarray(virtualArray.id, ids);
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep)

Example 18 with VirtualArrayRestRep

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

the class VirtualArrays method addStorageSysVarray.

/**
 * Adds all ports of the given storage systems to the virtual array.
 *
 * @param virtualArrayId
 *            the virtual array ID.
 * @param ids
 *            the storage system IDs.
 */
private static void addStorageSysVarray(String virtualArrayId, List<String> ids) {
    List<URI> storagePorts = Lists.newArrayList();
    for (URI storageSystemId : uris(ids)) {
        List<StoragePortRestRep> ports = StoragePortUtils.getStoragePortsByStorageSystem(storageSystemId);
        storagePorts.addAll(ResourceUtils.ids(ports));
    }
    VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
    if (!storagePorts.isEmpty()) {
        updateStoragePorts(storagePorts, addVirtualArray(virtualArray));
    }
    updateVarrayCookie(virtualArray.getId().toString(), virtualArray.getName());
    list();
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) StoragePortRestRep(com.emc.storageos.model.ports.StoragePortRestRep) URI(java.net.URI)

Example 19 with VirtualArrayRestRep

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

the class VirtualArrays method itemDetails.

/**
 * Renders the details of a single virtual array.
 *
 * @param id
 *            the virtual array ID.
 */
public static void itemDetails(String id) {
    VirtualArrayRestRep virtualArray = VirtualArrayUtils.getVirtualArray(id);
    if (virtualArray == null) {
        error(MessagesUtils.get(UNKNOWN, id));
    }
    Map<String, Set<NamedRelatedResourceRep>> connectivityMap = VirtualArrayUtils.getConnectivityMap(id);
    // Do not display RP/VPLEX connectivity separately
    connectivityMap.remove(ConnectivityTypes.RP_VPLEX);
    Map<String, Set<String>> attributes = VirtualArrayUtils.getAvailableAttributes(uris(id));
    render(virtualArray, connectivityMap, attributes);
}
Also used : Set(java.util.Set) HashSet(java.util.HashSet) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep)

Example 20 with VirtualArrayRestRep

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

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