Search in sources :

Example 6 with PayloadFilter

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

the class StorageCenterAPI method getStorageTypes.

/**
 * Get all storage types from the system.
 *
 * @param ssn The Storage Center system serial number.
 * @return The storage types.
 */
public ScStorageType[] getStorageTypes(String ssn) {
    PayloadFilter filter = new PayloadFilter();
    if (ssn != null) {
        filter.append("scSerialNumber", ssn);
    }
    RestResult rr = restClient.post("StorageCenter/ScStorageType/GetList", filter.toJson());
    if (checkResults(rr)) {
        return gson.fromJson(rr.getResult(), ScStorageType[].class);
    }
    return new ScStorageType[0];
}
Also used : ScStorageType(com.emc.storageos.driver.dellsc.scapi.objects.ScStorageType) RestResult(com.emc.storageos.driver.dellsc.scapi.rest.RestResult) PayloadFilter(com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter)

Example 7 with PayloadFilter

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

the class StorageCenterAPI method findServerHba.

/**
 * Find an initiator WWN or iSCSI IQN.
 *
 * @param ssn The Storage Center SN on which to check.
 * @param iqnOrWwn The FC WWN or iSCSI IQN.
 * @return The HBA object.
 */
private ScServerHba findServerHba(String ssn, String iqnOrWwn) {
    ScServerHba result = null;
    PayloadFilter filter = new PayloadFilter();
    filter.append("scSerialNumber", ssn);
    filter.append("instanceName", iqnOrWwn);
    RestResult rr = restClient.post("StorageCenter/ScServerHba/GetList", filter.toJson());
    if (checkResults(rr)) {
        ScServerHba[] hbas = gson.fromJson(rr.getResult(), ScServerHba[].class);
        for (ScServerHba hba : hbas) {
            // Should only return one if found, but just grab first from list
            result = hba;
            break;
        }
    }
    return result;
}
Also used : RestResult(com.emc.storageos.driver.dellsc.scapi.rest.RestResult) PayloadFilter(com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter) ScServerHba(com.emc.storageos.driver.dellsc.scapi.objects.ScServerHba)

Example 8 with PayloadFilter

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

the class StorageCenterAPI method getAllVolumes.

/**
 * Gets all volumes.
 *
 * @param ssn The Storage Center to query from.
 * @return The volumes on the requested SC.
 */
public ScVolume[] getAllVolumes(String ssn) {
    PayloadFilter filter = new PayloadFilter();
    filter.append("scSerialNumber", ssn);
    RestResult rr = restClient.post("StorageCenter/ScVolume/GetList", filter.toJson());
    if (checkResults(rr)) {
        return gson.fromJson(rr.getResult(), ScVolume[].class);
    }
    return new ScVolume[0];
}
Also used : ScVolume(com.emc.storageos.driver.dellsc.scapi.objects.ScVolume) RestResult(com.emc.storageos.driver.dellsc.scapi.rest.RestResult) PayloadFilter(com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter)

Example 9 with PayloadFilter

use of com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter 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)

Example 10 with PayloadFilter

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

the class StorageCenterAPI method getVolumeSnapshots.

/**
 * Gets all replays for a given volume.
 *
 * @param instanceId The volume instance ID.
 * @return The volume's replays.
 */
public ScReplay[] getVolumeSnapshots(String instanceId) {
    PayloadFilter filter = new PayloadFilter();
    filter.append("createVolume", instanceId);
    filter.append("active", false);
    filter.append("markedForExpiration", false);
    RestResult rr = restClient.post("StorageCenter/ScReplay/GetList", filter.toJson());
    if (checkResults(rr)) {
        return gson.fromJson(rr.getResult(), ScReplay[].class);
    }
    return new ScReplay[0];
}
Also used : RestResult(com.emc.storageos.driver.dellsc.scapi.rest.RestResult) PayloadFilter(com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter) ScReplay(com.emc.storageos.driver.dellsc.scapi.objects.ScReplay)

Aggregations

PayloadFilter (com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter)12 RestResult (com.emc.storageos.driver.dellsc.scapi.rest.RestResult)12 ScMappingProfile (com.emc.storageos.driver.dellsc.scapi.objects.ScMappingProfile)2 ScServerHba (com.emc.storageos.driver.dellsc.scapi.objects.ScServerHba)2 ScControllerPort (com.emc.storageos.driver.dellsc.scapi.objects.ScControllerPort)1 ScReplay (com.emc.storageos.driver.dellsc.scapi.objects.ScReplay)1 ScReplayProfile (com.emc.storageos.driver.dellsc.scapi.objects.ScReplayProfile)1 ScServer (com.emc.storageos.driver.dellsc.scapi.objects.ScServer)1 ScServerOperatingSystem (com.emc.storageos.driver.dellsc.scapi.objects.ScServerOperatingSystem)1 ScStorageType (com.emc.storageos.driver.dellsc.scapi.objects.ScStorageType)1 ScVolume (com.emc.storageos.driver.dellsc.scapi.objects.ScVolume)1 ScVolumeConfiguration (com.emc.storageos.driver.dellsc.scapi.objects.ScVolumeConfiguration)1 ArrayList (java.util.ArrayList)1