Search in sources :

Example 1 with ProtectionSystemRestRep

use of com.emc.storageos.model.protection.ProtectionSystemRestRep in project coprhd-controller by CoprHD.

the class ProtectionMapper method map.

public static ProtectionSystemRestRep map(ProtectionSystem from) {
    if (from == null) {
        return null;
    }
    ProtectionSystemRestRep to = new ProtectionSystemRestRep();
    mapDiscoveredSystemObjectFields(from, to);
    to.setInstallationId(from.getInstallationId());
    to.setMajorVersion(from.getMajorVersion());
    to.setMinorVersion(from.getMinorVersion());
    to.setIpAddress(from.getIpAddress());
    to.setPortNumber(from.getPortNumber());
    to.setReachableStatus(from.getReachableStatus());
    to.setUsername(from.getUsername());
    to.setNativeGuid(from.getNativeGuid());
    if (from.getRpSiteNames() != null) {
        List<ProtectionSystemRPClusterRestRep> clusterReps = new ArrayList<>();
        for (Map.Entry<String, String> clusterEntry : from.getRpSiteNames().entrySet()) {
            ProtectionSystemRPClusterRestRep clusterRep = new ProtectionSystemRPClusterRestRep();
            clusterRep.setClusterId(clusterEntry.getKey());
            clusterRep.setClusterName(clusterEntry.getValue());
            // See if there are assigned virtual arrays for clusters
            if (from.getSiteAssignedVirtualArrays() != null && from.getSiteAssignedVirtualArrays().get(clusterEntry.getKey()) != null) {
                List<String> assignedVarrays = new ArrayList<>();
                assignedVarrays.addAll(from.getSiteAssignedVirtualArrays().get(clusterEntry.getKey()));
                clusterRep.setAssignedVarrays(assignedVarrays);
            }
            clusterReps.add(clusterRep);
        }
        to.setRpClusters(clusterReps);
    }
    return to;
}
Also used : ProtectionSystemRPClusterRestRep(com.emc.storageos.model.protection.ProtectionSystemRPClusterRestRep) ArrayList(java.util.ArrayList) ProtectionSystemRestRep(com.emc.storageos.model.protection.ProtectionSystemRestRep) Map(java.util.Map)

Example 2 with ProtectionSystemRestRep

use of com.emc.storageos.model.protection.ProtectionSystemRestRep in project coprhd-controller by CoprHD.

the class DataProtectionSystems method edit.

@FlashException("list")
public static void edit(String id) {
    addReferenceData();
    ProtectionSystemRestRep protectionSystem = ProtectionSystemUtils.getProtectionSystem(id);
    if (protectionSystem != null) {
        DataProtectionSystemForm dataProtectionSystem = new DataProtectionSystemForm(protectionSystem);
        render(dataProtectionSystem);
    } else {
        flash.error(MessagesUtils.get(UNKNOWN, id));
        list();
    }
}
Also used : ProtectionSystemRestRep(com.emc.storageos.model.protection.ProtectionSystemRestRep) FlashException(controllers.util.FlashException)

Example 3 with ProtectionSystemRestRep

use of com.emc.storageos.model.protection.ProtectionSystemRestRep in project coprhd-controller by CoprHD.

the class DataProtectionSystems method itemDetails.

public static void itemDetails(String id) {
    ProtectionSystemRestRep protectionSystem = ProtectionSystemUtils.getProtectionSystem(id);
    if (protectionSystem == null) {
        error(MessagesUtils.get(UNKNOWN, id));
    }
    ProtectionSystemConnectivityRestRep connectivity = ProtectionSystemUtils.getConnectivity(protectionSystem);
    Map<URI, StorageSystemRestRep> storageSystemMap = ProtectionSystemUtils.getStorageSystemMap(connectivity);
    render(protectionSystem, connectivity, storageSystemMap);
}
Also used : StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) ProtectionSystemConnectivityRestRep(com.emc.storageos.model.protection.ProtectionSystemConnectivityRestRep) ProtectionSystemRestRep(com.emc.storageos.model.protection.ProtectionSystemRestRep) URI(java.net.URI)

Example 4 with ProtectionSystemRestRep

use of com.emc.storageos.model.protection.ProtectionSystemRestRep in project coprhd-controller by CoprHD.

the class DiscoverUnmanagedCGsService method execute.

@Override
public void execute() throws Exception {
    List<URI> uris = uris(protectionSystems);
    List<ProtectionSystemRestRep> systemRestReps = execute(new GetProtectionSystems(uris));
    for (ProtectionSystemRestRep protectionSystem : systemRestReps) {
        logInfo("discover.unmanaged.cg.service.discovering", protectionSystem.getName());
        execute(new DiscoverUnmanagedCGs(protectionSystem.getId().toString(), DiscoverUnmanagedCGs.UnmanagedNamespace.UNMANAGED_CGS));
        int postCount = countUnmanagedCGs(protectionSystem.getId().toString());
        logInfo("discover.unmanaged.cg.service.discovered", postCount, protectionSystem.getName());
    }
}
Also used : DiscoverUnmanagedCGs(com.emc.sa.service.vipr.tasks.DiscoverUnmanagedCGs) GetProtectionSystems(com.emc.sa.service.vipr.tasks.GetProtectionSystems) URI(java.net.URI) ProtectionSystemRestRep(com.emc.storageos.model.protection.ProtectionSystemRestRep)

Example 5 with ProtectionSystemRestRep

use of com.emc.storageos.model.protection.ProtectionSystemRestRep in project coprhd-controller by CoprHD.

the class DiscoverUnmanagedVolumesService method execute.

@Override
public void execute() throws Exception {
    List<URI> uris = uris(storageSystems);
    List<StorageSystemRestRep> systemRestReps = execute(new GetStorageSystems(uris));
    // remove any VPLEX systems and add them back at the end of the systems list
    List<StorageSystemRestRep> vplexSystems = new ArrayList<StorageSystemRestRep>();
    Iterator<StorageSystemRestRep> it = systemRestReps.iterator();
    while (it.hasNext()) {
        StorageSystemRestRep system = it.next();
        if (BlockProviderUtils.isVplex(system)) {
            vplexSystems.add(system);
            it.remove();
        }
    }
    systemRestReps.addAll(vplexSystems);
    for (StorageSystemRestRep storageSystem : systemRestReps) {
        logInfo("discover.unmanaged.volume.service.discovering", storageSystem.getName());
        execute(new DiscoverUnmanagedVolumes(storageSystem.getId().toString()));
        int postCount = countUnmanagedVolumes(storageSystem.getId().toString());
        logInfo("discover.unmanaged.volume.service.discovered", postCount, storageSystem.getName());
    }
    List<ProtectionSystemRestRep> protectionSystemRestReps = execute(new GetProtectionSystems());
    for (ProtectionSystemRestRep protectionSystem : protectionSystemRestReps) {
        logInfo("discover.unmanaged.volume.service.discoveringcgs", protectionSystem.getName());
        execute(new DiscoverUnmanagedCGs(protectionSystem.getId().toString(), DiscoverUnmanagedCGs.UnmanagedNamespace.UNMANAGED_CGS));
        logInfo("discover.unmanaged.volume.service.discoveredcgs", protectionSystem.getName());
    }
}
Also used : StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) GetStorageSystems(com.emc.sa.service.vipr.tasks.GetStorageSystems) ArrayList(java.util.ArrayList) DiscoverUnmanagedVolumes(com.emc.sa.service.vipr.block.tasks.DiscoverUnmanagedVolumes) GetProtectionSystems(com.emc.sa.service.vipr.tasks.GetProtectionSystems) URI(java.net.URI) ProtectionSystemRestRep(com.emc.storageos.model.protection.ProtectionSystemRestRep) DiscoverUnmanagedCGs(com.emc.sa.service.vipr.tasks.DiscoverUnmanagedCGs)

Aggregations

ProtectionSystemRestRep (com.emc.storageos.model.protection.ProtectionSystemRestRep)5 URI (java.net.URI)3 DiscoverUnmanagedCGs (com.emc.sa.service.vipr.tasks.DiscoverUnmanagedCGs)2 GetProtectionSystems (com.emc.sa.service.vipr.tasks.GetProtectionSystems)2 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)2 ArrayList (java.util.ArrayList)2 DiscoverUnmanagedVolumes (com.emc.sa.service.vipr.block.tasks.DiscoverUnmanagedVolumes)1 GetStorageSystems (com.emc.sa.service.vipr.tasks.GetStorageSystems)1 ProtectionSystemConnectivityRestRep (com.emc.storageos.model.protection.ProtectionSystemConnectivityRestRep)1 ProtectionSystemRPClusterRestRep (com.emc.storageos.model.protection.ProtectionSystemRPClusterRestRep)1 FlashException (controllers.util.FlashException)1 Map (java.util.Map)1