Search in sources :

Example 11 with RelatedResourceRep

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

the class DiscoverUnmanagedVolumesService method countUnmanagedVolumes.

private int countUnmanagedVolumes(String storageSystem) {
    int total = 0;
    List<RelatedResourceRep> unmanaged = execute(new GetUnmanagedVolumesForStorageSystem(storageSystem));
    if (unmanaged != null) {
        total = unmanaged.size();
    }
    return total;
}
Also used : GetUnmanagedVolumesForStorageSystem(com.emc.sa.service.vipr.block.tasks.GetUnmanagedVolumesForStorageSystem) RelatedResourceRep(com.emc.storageos.model.RelatedResourceRep)

Example 12 with RelatedResourceRep

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

the class DiscoverUnmanagedCGsService method countUnmanagedCGs.

private int countUnmanagedCGs(String protectionSystem) {
    int total = 0;
    List<RelatedResourceRep> unmanaged = execute(new GetUnmanagedCGsForProtectionSystem(protectionSystem));
    if (unmanaged != null) {
        total = unmanaged.size();
    }
    return total;
}
Also used : RelatedResourceRep(com.emc.storageos.model.RelatedResourceRep) GetUnmanagedCGsForProtectionSystem(com.emc.sa.service.vipr.block.tasks.GetUnmanagedCGsForProtectionSystem)

Example 13 with RelatedResourceRep

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

the class DiscoverUnmanagedFilesystemsService method countUnmanagedFileSystems.

private int countUnmanagedFileSystems(String storageSystem) {
    int total = 0;
    List<RelatedResourceRep> unmanaged = execute(new GetUnmanagedFilesystemsForStorageSystem(storageSystem));
    if (unmanaged != null) {
        total = unmanaged.size();
    }
    return total;
}
Also used : GetUnmanagedFilesystemsForStorageSystem(com.emc.sa.service.vipr.file.tasks.GetUnmanagedFilesystemsForStorageSystem) RelatedResourceRep(com.emc.storageos.model.RelatedResourceRep)

Example 14 with RelatedResourceRep

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

the class FileProtectionPolicies method getVarraysAssociatedWithPools.

public static void getVarraysAssociatedWithPools(String id) {
    List<VirtualArrayRestRep> varrayList = Lists.newArrayList();
    Set<String> varraySet = Sets.newHashSet();
    FileVirtualPoolRestRep vpool = getViprClient().fileVpools().get(uri(id));
    List<RelatedResourceRep> varrays = vpool.getVirtualArrays();
    for (RelatedResourceRep varray : varrays) {
        varraySet.add(varray.getId().toString());
    }
    for (String varrayId : varraySet) {
        VirtualArrayRestRep varray = getViprClient().varrays().get(uri(varrayId));
        varrayList.add(varray);
    }
    renderJSON(varrayList);
}
Also used : FileVirtualPoolRestRep(com.emc.storageos.model.vpool.FileVirtualPoolRestRep) NamedRelatedResourceRep(com.emc.storageos.model.NamedRelatedResourceRep) RelatedResourceRep(com.emc.storageos.model.RelatedResourceRep) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep)

Example 15 with RelatedResourceRep

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

the class BlockVirtualPools method checkDisconnectedStoragePools.

public static void checkDisconnectedStoragePools(@As(",") String[] ids) {
    List<BlockVirtualPoolRestRep> virtualpools = VirtualPoolUtils.getBlockVirtualPools();
    Set<String> connectedstoragepools = new HashSet<String>();
    List<String> failedArrays = new ArrayList<String>();
    for (BlockVirtualPoolRestRep virtualpool : virtualpools) {
        if (virtualpool.getUseMatchedPools()) {
            for (RelatedResourceRep pool : virtualpool.getMatchedStoragePools()) {
                connectedstoragepools.add(pool.getId().toString());
            }
        } else {
            for (RelatedResourceRep pool : virtualpool.getAssignedStoragePools()) {
                connectedstoragepools.add(pool.getId().toString());
            }
        }
    }
    for (String id : ids) {
        StorageSystemRestRep storageSystem = StorageSystemUtils.getStorageSystem(id);
        if (storageSystem != null && !storageSystem.getRegistrationStatus().equals("UNREGISTERED")) {
            boolean found = false;
            List<StoragePoolRestRep> storagepools = StoragePoolUtils.getStoragePools(id);
            for (StoragePoolRestRep storagepool : storagepools) {
                if (connectedstoragepools.contains(storagepool.getId().toString())) {
                    found = true;
                    break;
                }
            }
            if (!found) {
                failedArrays.add(storageSystem.getName());
            }
        }
    }
    renderJSON(failedArrays);
}
Also used : RelatedResourceRep(com.emc.storageos.model.RelatedResourceRep) StorageSystemRestRep(com.emc.storageos.model.systems.StorageSystemRestRep) ArrayList(java.util.ArrayList) BlockVirtualPoolRestRep(com.emc.storageos.model.vpool.BlockVirtualPoolRestRep) StoragePoolRestRep(com.emc.storageos.model.pools.StoragePoolRestRep) HashSet(java.util.HashSet)

Aggregations

RelatedResourceRep (com.emc.storageos.model.RelatedResourceRep)41 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)25 ArrayList (java.util.ArrayList)19 VirtualArrayRelatedResourceRep (com.emc.storageos.model.VirtualArrayRelatedResourceRep)14 URI (java.net.URI)12 Asset (com.emc.sa.asset.annotation.Asset)8 ViPRCoreClient (com.emc.vipr.client.ViPRCoreClient)8 AssetDependencies (com.emc.sa.asset.annotation.AssetDependencies)7 VolumeRestRep (com.emc.storageos.model.block.VolumeRestRep)7 BlockSnapshotRestRep (com.emc.storageos.model.block.BlockSnapshotRestRep)5 BlockSnapshotSessionRestRep (com.emc.storageos.model.block.BlockSnapshotSessionRestRep)5 ClusterRestRep (com.emc.storageos.model.host.cluster.ClusterRestRep)5 BlockSnapshotSessionList (com.emc.storageos.model.block.BlockSnapshotSessionList)4 StoragePortList (com.emc.storageos.model.ports.StoragePortList)4 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)4 AssetOption (com.emc.vipr.model.catalog.AssetOption)4 HashMap (java.util.HashMap)4 HashSet (java.util.HashSet)4 URIQueryResultList (com.emc.storageos.db.client.constraint.URIQueryResultList)3 VolumeGroupList (com.emc.storageos.model.application.VolumeGroupList)3