Search in sources :

Example 6 with StorageSystemRestRep

use of com.emc.storageos.model.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.

the class Networks method getDisconnectedStorage.

public static void getDisconnectedStorage(@As(",") String[] ids) {
    List<NetworkRestRep> networks = NetworkUtils.getNetworks();
    Set<String> connectedstoragesystems = new HashSet<String>();
    Set<String> disConnectedstoragesystems = new HashSet<String>();
    for (NetworkRestRep network : networks) {
        for (StoragePortRestRep port : StoragePortUtils.getStoragePortsByNetwork(network.getId())) {
            connectedstoragesystems.add(port.getStorageDevice().getId().toString());
        }
    }
    for (String id : ids) {
        StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
        if (storageSystem == null || storageSystem.getRegistrationStatus().equals("UNREGISTERED")) {
            // ignore for now
            continue;
        }
        if (!connectedstoragesystems.contains(id)) {
            disConnectedstoragesystems.add(storageSystem.getName());
        }
    }
    renderJSON(disConnectedstoragesystems);
}
Also used : StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) StoragePortRestRep(com.emc.storageos.model.ports.StoragePortRestRep) NetworkRestRep(com.emc.storageos.model.varray.NetworkRestRep) HashSet(java.util.HashSet)

Example 7 with StorageSystemRestRep

use of com.emc.storageos.model.systems.StorageSystemRestRep 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 8 with StorageSystemRestRep

use of com.emc.storageos.model.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.

the class StorageSystems method discoveryCheckJson.

public static void discoveryCheckJson(@As(",") String[] ids) {
    List<String> failedDiscovery = new ArrayList<String>();
    for (String id : ids) {
        StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
        if (storageSystem == null || storageSystem.getRegistrationStatus().equals("UNREGISTERED")) {
            // ignore for now
            continue;
        }
        if (!storageSystem.getDiscoveryJobStatus().equals("COMPLETE")) {
            failedDiscovery.add(storageSystem.getName());
            continue;
        }
    }
    renderJSON(failedDiscovery);
}
Also used : StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) ArrayList(java.util.ArrayList)

Example 9 with StorageSystemRestRep

use of com.emc.storageos.model.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.

the class StorageSystems method createPort.

public static void createPort(String id) {
    StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
    StringOption[] portTypeOptions = { new StringOption("", ""), new StringOption("IP", StringOption.getDisplayValue("IP", "storageArrayPort.portTypes")), new StringOption("FC", StringOption.getDisplayValue("FC", "storageArrayPort.portTypes")) };
    renderArgs.put("portTypeOptions", Arrays.asList(portTypeOptions));
    render(storageSystem);
}
Also used : StringOption(util.StringOption) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep)

Example 10 with StorageSystemRestRep

use of com.emc.storageos.model.systems.StorageSystemRestRep in project coprhd-controller by CoprHD.

the class StorageSystems method ports.

public static void ports(String id) {
    addReferenceData();
    StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
    if (storageSystem == null) {
        flash.error(MessagesUtils.get(UNKNOWN, id));
        list();
    }
    StorageArrayPortDataTable dataTable = new StorageArrayPortDataTable(storageSystem);
    render("@listPorts", storageSystem, dataTable);
}
Also used : StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep)

Aggregations

StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)44 URI (java.net.URI)11 ArrayList (java.util.ArrayList)10 StoragePortRestRep (com.emc.storageos.model.ports.StoragePortRestRep)7 HashSet (java.util.HashSet)7 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)6 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)6 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)5 StoragePoolRestRep (com.emc.storageos.model.pools.StoragePoolRestRep)5 Asset (com.emc.sa.asset.annotation.Asset)4 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)4 AssetOption (com.emc.vipr.model.catalog.AssetOption)4 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)3 StorageProviderRestRep (com.emc.storageos.model.smis.StorageProviderRestRep)3 JsonArray (com.google.gson.JsonArray)3 JsonObject (com.google.gson.JsonObject)3 HashMap (java.util.HashMap)3 GetStorageSystems (com.emc.sa.service.vipr.tasks.GetStorageSystems)2 RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)2 FileShareRestRep (com.emc.storageos.model.file.FileShareRestRep)2