Search in sources :

Example 6 with ScReplayProfile

use of com.emc.storageos.driver.dellsc.scapi.objects.ScReplayProfile in project coprhd-controller by CoprHD.

the class DellSCDiscovery method getStorageVolumes.

/**
 * Discover storage volumes.
 *
 * @param storageSystem The storage system on which to discover.
 * @param storageVolumes The discovered storage volumes.
 * @param token Used for paging. Input 0 indicates that the first page should be returned. Output 0 indicates
 *            that last page was returned
 * @return The discovery task.
 */
public DriverTask getStorageVolumes(StorageSystem storageSystem, List<StorageVolume> storageVolumes, MutableInt token) {
    LOG.info("Getting volumes from {}", storageSystem.getNativeId());
    DellSCDriverTask task = new DellSCDriverTask("getVolumes");
    try {
        StorageCenterAPI api = connectionManager.getConnection(storageSystem.getNativeId());
        Map<ScReplayProfile, List<String>> cgInfo = util.getGCInfo(api, storageSystem.getNativeId());
        ScVolume[] volumes = api.getAllVolumes(storageSystem.getNativeId());
        for (ScVolume volume : volumes) {
            if (volume.inRecycleBin || volume.liveVolume || volume.cmmDestination || volume.replicationDestination) {
                continue;
            }
            StorageVolume driverVol = util.getStorageVolumeFromScVolume(api, volume, cgInfo);
            storageVolumes.add(driverVol);
        }
        task.setStatus(TaskStatus.READY);
    } catch (DellSCDriverException | StorageCenterAPIException e) {
        String msg = String.format("Error getting volume info: %s", e);
        LOG.warn(msg);
        task.setFailed(msg);
    }
    return task;
}
Also used : ScVolume(com.emc.storageos.driver.dellsc.scapi.objects.ScVolume) StorageCenterAPI(com.emc.storageos.driver.dellsc.scapi.StorageCenterAPI) StorageVolume(com.emc.storageos.storagedriver.model.StorageVolume) DellSCDriverException(com.emc.storageos.driver.dellsc.DellSCDriverException) DellSCDriverTask(com.emc.storageos.driver.dellsc.DellSCDriverTask) ScReplayProfile(com.emc.storageos.driver.dellsc.scapi.objects.ScReplayProfile) StorageCenterAPIException(com.emc.storageos.driver.dellsc.scapi.StorageCenterAPIException) ArrayList(java.util.ArrayList) List(java.util.List)

Example 7 with ScReplayProfile

use of com.emc.storageos.driver.dellsc.scapi.objects.ScReplayProfile in project coprhd-controller by CoprHD.

the class StorageCenterAPI method getConsistencyGroups.

/**
 * Gets all replay profiles that are consistent type.
 *
 * @param ssn The Storage Center serial number.
 * @return The consistent replay profiles.
 */
public ScReplayProfile[] getConsistencyGroups(String ssn) {
    PayloadFilter filter = new PayloadFilter();
    filter.append("scSerialNumber", ssn);
    filter.append("type", "Consistent");
    RestResult rr = restClient.post("StorageCenter/ScReplayProfile/GetList", filter.toJson());
    if (checkResults(rr)) {
        return gson.fromJson(rr.getResult(), ScReplayProfile[].class);
    }
    return new ScReplayProfile[0];
}
Also used : RestResult(com.emc.storageos.driver.dellsc.scapi.rest.RestResult) PayloadFilter(com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter) ScReplayProfile(com.emc.storageos.driver.dellsc.scapi.objects.ScReplayProfile)

Aggregations

ScReplayProfile (com.emc.storageos.driver.dellsc.scapi.objects.ScReplayProfile)7 StorageCenterAPIException (com.emc.storageos.driver.dellsc.scapi.StorageCenterAPIException)5 StorageCenterAPI (com.emc.storageos.driver.dellsc.scapi.StorageCenterAPI)4 DellSCDriverException (com.emc.storageos.driver.dellsc.DellSCDriverException)3 DellSCDriverTask (com.emc.storageos.driver.dellsc.DellSCDriverTask)3 ScVolume (com.emc.storageos.driver.dellsc.scapi.objects.ScVolume)3 StorageVolume (com.emc.storageos.storagedriver.model.StorageVolume)3 List (java.util.List)3 ArrayList (java.util.ArrayList)2 ScVolumeStorageUsage (com.emc.storageos.driver.dellsc.scapi.objects.ScVolumeStorageUsage)1 PayloadFilter (com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter)1 RestResult (com.emc.storageos.driver.dellsc.scapi.rest.RestResult)1 VolumeSnapshot (com.emc.storageos.storagedriver.model.VolumeSnapshot)1 HashMap (java.util.HashMap)1