Search in sources :

Example 6 with StoragePortRestRep

use of com.emc.storageos.model.ports.StoragePortRestRep in project coprhd-controller by CoprHD.

the class Networks method getConnectedStorage.

public static void getConnectedStorage() {
    List<NetworkRestRep> networks = NetworkUtils.getNetworks();
    Set<String> connectedstoragesystems = new HashSet<String>();
    for (NetworkRestRep network : networks) {
        for (StoragePortRestRep port : StoragePortUtils.getStoragePortsByNetwork(network.getId())) {
            connectedstoragesystems.add(port.getStorageDevice().getId().toString());
        }
    }
    renderJSON(connectedstoragesystems);
}
Also used : StoragePortRestRep(com.emc.storageos.model.ports.StoragePortRestRep) NetworkRestRep(com.emc.storageos.model.varray.NetworkRestRep) HashSet(java.util.HashSet)

Example 7 with StoragePortRestRep

use of com.emc.storageos.model.ports.StoragePortRestRep in project coprhd-controller by CoprHD.

the class StorageSystems method metricDetails.

public static void metricDetails(String id) {
    StoragePortRestRep port = StoragePortUtils.getStoragePort(id);
    render(port);
}
Also used : StoragePortRestRep(com.emc.storageos.model.ports.StoragePortRestRep)

Example 8 with StoragePortRestRep

use of com.emc.storageos.model.ports.StoragePortRestRep in project coprhd-controller by CoprHD.

the class StorageSystems method editPort.

public static void editPort(String id, String portId) {
    StoragePortRestRep storagePort = StoragePortUtils.getStoragePort(portId);
    if (storagePort == null) {
        flash.error(MessagesUtils.get(UNKNOWN_PORT, portId));
        ports(id);
    }
    URI storageSystemId = id(storagePort.getStorageDevice());
    StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(storageSystemId);
    if (storageSystem == null) {
        flash.error(MessagesUtils.get(UNKNOWN, storageSystemId));
        list();
    }
    if (RegistrationStatus.isUnregistered(storageSystem.getRegistrationStatus())) {
        flash.put("warning", MessagesUtils.get(NOT_REGISTERED, storageSystem.getName()));
    }
    StorageArrayPortForm storageArrayPort = new StorageArrayPortForm();
    storageArrayPort.readFrom(storagePort);
    render(storageArrayPort, storagePort, storageSystem);
}
Also used : StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) StoragePortRestRep(com.emc.storageos.model.ports.StoragePortRestRep) URI(java.net.URI)

Example 9 with StoragePortRestRep

use of com.emc.storageos.model.ports.StoragePortRestRep 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 10 with StoragePortRestRep

use of com.emc.storageos.model.ports.StoragePortRestRep 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)

Aggregations

StoragePortRestRep (com.emc.storageos.model.ports.StoragePortRestRep)22 URI (java.net.URI)8 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)7 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)5 NetworkRestRep (com.emc.storageos.model.varray.NetworkRestRep)4 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)4 StoragePortInfo (models.datatable.StoragePortDataTable.StoragePortInfo)3 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)2 InitiatorRestRep (com.emc.storageos.model.host.InitiatorRestRep)2 StoragePortGroupRestRepList (com.emc.storageos.model.portgroup.StoragePortGroupRestRepList)2 StoragePortList (com.emc.storageos.model.ports.StoragePortList)2 StoragePortUpdate (com.emc.storageos.model.ports.StoragePortUpdate)2 AssetOption (com.emc.vipr.model.catalog.AssetOption)2 FlashException (controllers.util.FlashException)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 EndpointInfo (models.datatable.NetworkEndpointDataTable.EndpointInfo)2 Asset (com.emc.sa.asset.annotation.Asset)1 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)1 SnapshotList (com.emc.storageos.model.SnapshotList)1