Search in sources :

Example 1 with IdFilter

use of com.emc.vipr.client.core.filters.IdFilter in project coprhd-controller by CoprHD.

the class StoragePoolUtils method getStoragePoolsAssignableToVirtualArray.

public static List<StoragePoolRestRep> getStoragePoolsAssignableToVirtualArray(String virtualArrayId) {
    List<StoragePoolRestRep> assignedPools = getStoragePoolsAssignedToVirtualArray(virtualArrayId);
    List<URI> ids = Lists.newArrayList();
    for (StoragePoolRestRep pool : assignedPools) {
        if ((pool.getAssignedVirtualArrays() != null) && pool.getAssignedVirtualArrays().contains(virtualArrayId)) {
            ids.add(id(pool));
        }
    }
    return getViprClient().storagePools().getAll(new IdFilter<StoragePoolRestRep>(ids).notId());
}
Also used : IdFilter(com.emc.vipr.client.core.filters.IdFilter) StoragePoolRestRep(com.emc.storageos.model.pools.StoragePoolRestRep) URI(java.net.URI)

Example 2 with IdFilter

use of com.emc.vipr.client.core.filters.IdFilter in project coprhd-controller by CoprHD.

the class FindVirtualArrayInitiators method executeTask.

@Override
public Set<Initiator> executeTask() throws Exception {
    IdFilter<VirtualArrayRestRep> filter = new IdFilter<VirtualArrayRestRep>(varray);
    Set<Initiator> results = Sets.newHashSet();
    for (Initiator initiator : initiators) {
        String initiatorPort = initiator.getInitiatorPort();
        List<VirtualArrayRestRep> virtualArrays = getClient().varrays().findByInitiatorPort(initiatorPort, filter);
        // Filter will only return the virtual array we are searching for
        if (!virtualArrays.isEmpty()) {
            results.add(initiator);
        }
    }
    return results;
}
Also used : IdFilter(com.emc.vipr.client.core.filters.IdFilter) Initiator(com.emc.storageos.db.client.model.Initiator) VirtualArrayRestRep(com.emc.storageos.model.varray.VirtualArrayRestRep)

Aggregations

IdFilter (com.emc.vipr.client.core.filters.IdFilter)2 Initiator (com.emc.storageos.db.client.model.Initiator)1 StoragePoolRestRep (com.emc.storageos.model.pools.StoragePoolRestRep)1 VirtualArrayRestRep (com.emc.storageos.model.varray.VirtualArrayRestRep)1 URI (java.net.URI)1