Search in sources :

Example 21 with VirtualArrayRestRep

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

the class VirtualArrays method addNetworks.

/**
 * Adds a number of networks to the given virtual array, and redisplays the networks page.
 *
 * @param virtualArrayId
 *            the virtual array ID.
 * @param ids
 *            the IDs of the networks to add.
 */
@FlashException
public static void addNetworks(String virtualArrayId, @As(",") String[] ids) {
    if ((ids == null) || (ids.length == 0)) {
        networks(virtualArrayId);
    }
    VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
    updateNetworks(uris(ids), addVirtualArray(virtualArray));
    networks(virtualArrayId);
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) FlashException(controllers.util.FlashException)

Example 22 with VirtualArrayRestRep

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

the class VirtualArrays method addStorageSystems.

/**
 * Adds all ports of the given storage systems to the virtual array.
 *
 * @param virtualArrayId
 *            the virtual array ID.
 * @param ids
 *            the storage system IDs.
 */
@FlashException(referrer = { "edit", "list" })
public static void addStorageSystems(String virtualArrayId, @As(",") String[] ids) {
    List<URI> storagePorts = Lists.newArrayList();
    for (URI storageSystemId : uris(ids)) {
        List<StoragePortRestRep> ports = StoragePortUtils.getStoragePortsByStorageSystem(storageSystemId);
        storagePorts.addAll(ResourceUtils.ids(ports));
    }
    if (!storagePorts.isEmpty()) {
        VirtualArrayRestRep virtualArray = getVirtualArray(virtualArrayId);
        updateStoragePorts(storagePorts, addVirtualArray(virtualArray));
    }
    edit(virtualArrayId);
}
Also used : VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) StoragePortRestRep(com.emc.storageos.model.ports.StoragePortRestRep) URI(java.net.URI) FlashException(controllers.util.FlashException)

Example 23 with VirtualArrayRestRep

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

Example 24 with VirtualArrayRestRep

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

the class BlockExportGroups method exportGroup.

public static void exportGroup(String exportGroupId) {
    ViPRCoreClient client = BourneUtil.getViprClient();
    ExportGroupRestRep exportGroup = null;
    try {
        exportGroup = client.blockExports().get(uri(exportGroupId));
    } catch (ViPRHttpException e) {
        if (e.getHttpCode() == 404) {
            flash.error(MessagesUtils.get(UNKNOWN, exportGroupId));
            exportGroups(null);
        }
        throw e;
    }
    VirtualArrayRestRep virtualArray = null;
    if (exportGroup != null) {
        virtualArray = client.varrays().get(exportGroup.getVirtualArray());
    } else {
        notFound("Export Group " + exportGroupId);
    }
    renderArgs.put("volumeDataTable", new BlockExportGroupVolumesDataTable());
    renderArgs.put("snapshotDataTable", new BlockExportGroupSnapshotsDataTable());
    SimpleHostDataTable hostsDataTable = new SimpleHostDataTable();
    NetworkEndpointDataTable initiatorsDataTable = NetworkEndpointDataTable.createDataTable("FC");
    initiatorsDataTable.alterColumn("portGroup").hidden().setSearchable(false);
    initiatorsDataTable.alterColumn("storageSystem").hidden().setSearchable(false);
    initiatorsDataTable.alterColumn("discovered").hidden().setSearchable(false);
    HostClusterDataTable clustersDataTable = new HostClusterDataTable();
    render(hostsDataTable, initiatorsDataTable, clustersDataTable, exportGroup, virtualArray);
}
Also used : HostClusterDataTable(models.datatable.HostClusterDataTable) ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) NetworkEndpointDataTable(models.datatable.NetworkEndpointDataTable) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) BlockExportGroupSnapshotsDataTable(models.datatable.BlockExportGroupSnapshotsDataTable) BlockExportGroupVolumesDataTable(models.datatable.BlockExportGroupVolumesDataTable) SimpleHostDataTable(models.datatable.SimpleHostDataTable) ViPRHttpException(com.emc.vipr.client.exceptions.ViPRHttpException)

Example 25 with VirtualArrayRestRep

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

the class BlockProvider method getExportPathVirtualArray.

@Asset("exportPathVirtualArray")
@AssetDependencies({ "exportPathExport", "exportPathStorageSystem" })
public List<AssetOption> getExportPathVirtualArray(AssetOptionsContext ctx, URI exportId, URI storageSystemId) {
    ViPRCoreClient client = api(ctx);
    List<AssetOption> options = Lists.newArrayList();
    ExportGroupRestRep export = client.blockExports().get(exportId);
    List<URI> vArrayIds = new ArrayList<URI>();
    vArrayIds.add(export.getVirtualArray().getId());
    List<StringHashMapEntry> altArrays = export.getAltVirtualArrays() != null ? export.getAltVirtualArrays() : new ArrayList<StringHashMapEntry>();
    for (StringHashMapEntry altArray : altArrays) {
        if (altArray.getName().equalsIgnoreCase(storageSystemId.toString())) {
            vArrayIds.add(URI.create(altArray.getValue()));
        }
    }
    List<VirtualArrayRestRep> vArrays = client.varrays().getByIds(vArrayIds);
    for (VirtualArrayRestRep vArray : vArrays) {
        options.add(new AssetOption(vArray.getId(), vArray.getName()));
    }
    return options;
}
Also used : ViPRCoreClient(com.emc.vipr.client.ViPRCoreClient) AssetOption(com.emc.vipr.model.catalog.AssetOption) ExportGroupRestRep(com.emc.storageos.model.block.export.ExportGroupRestRep) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep) ArrayList(java.util.ArrayList) URI(java.net.URI) StringHashMapEntry(com.emc.storageos.model.StringHashMapEntry) AssetDependencies(com.emc.sa.asset.annotation.AssetDependencies) Asset(com.emc.sa.asset.annotation.Asset)

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