Search in sources :

Example 1 with GetProtectionSystems

use of com.emc.sa.service.vipr.tasks.GetProtectionSystems 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 2 with GetProtectionSystems

use of com.emc.sa.service.vipr.tasks.GetProtectionSystems 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

DiscoverUnmanagedCGs (com.emc.sa.service.vipr.tasks.DiscoverUnmanagedCGs)2 GetProtectionSystems (com.emc.sa.service.vipr.tasks.GetProtectionSystems)2 ProtectionSystemRestRep (com.emc.storageos.model.protection.ProtectionSystemRestRep)2 URI (java.net.URI)2 DiscoverUnmanagedVolumes (com.emc.sa.service.vipr.block.tasks.DiscoverUnmanagedVolumes)1 GetStorageSystems (com.emc.sa.service.vipr.tasks.GetStorageSystems)1 StorageSystemRestRep (com.emc.storageos.model.systems.StorageSystemRestRep)1 ArrayList (java.util.ArrayList)1