Search in sources :

Example 1 with RestResult

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

the class StorageCenterAPI method getFaultDomains.

/**
 * Gets all fault domains for a system.
 *
 * @param ssn The system serial number.
 * @return The fault domains.
 */
public ScFaultDomain[] getFaultDomains(String ssn) {
    RestResult rr = restClient.get(String.format("StorageCenter/StorageCenter/%s/FaultDomainList", ssn));
    if (checkResults(rr)) {
        return gson.fromJson(rr.getResult(), ScFaultDomain[].class);
    }
    LOG.warn(String.format("Error getting Storage Center configuration: %s", rr.getErrorMsg()));
    return new ScFaultDomain[0];
}
Also used : RestResult(com.emc.storageos.driver.dellsc.scapi.rest.RestResult) ScFaultDomain(com.emc.storageos.driver.dellsc.scapi.objects.ScFaultDomain)

Example 2 with RestResult

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

the class StorageCenterAPI method getServerDefinitions.

/**
 * Gets all server definitions on the array.
 *
 * @param ssn The Storage Center system serial number.
 * @return The server definitions.
 */
public ScServer[] getServerDefinitions(String ssn) {
    PayloadFilter filter = new PayloadFilter();
    filter.append("scSerialNumber", ssn);
    RestResult rr = restClient.post("StorageCenter/ScServer/GetList", filter.toJson());
    if (checkResults(rr)) {
        return gson.fromJson(rr.getResult(), ScServer[].class);
    }
    return new ScServer[0];
}
Also used : ScServer(com.emc.storageos.driver.dellsc.scapi.objects.ScServer) RestResult(com.emc.storageos.driver.dellsc.scapi.rest.RestResult) PayloadFilter(com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter)

Example 3 with RestResult

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

the class StorageCenterAPI method getConsistencyGroup.

/**
 * Gets a replay profile with the given ID.
 *
 * @param instanceId The replay profile instance ID.
 * @return The replay profile.
 * @throws StorageCenterAPIException
 */
public ScReplayProfile getConsistencyGroup(String instanceId) throws StorageCenterAPIException {
    RestResult rr = restClient.get(String.format("StorageCenter/ScReplayProfile/%s", instanceId));
    if (checkResults(rr)) {
        return gson.fromJson(rr.getResult(), ScReplayProfile.class);
    }
    String message = String.format("Error getting replay profile : %s", rr.getErrorMsg());
    throw new StorageCenterAPIException(message);
}
Also used : RestResult(com.emc.storageos.driver.dellsc.scapi.rest.RestResult)

Example 4 with RestResult

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

the class StorageCenterAPI method findMappingProfiles.

/**
 * Finds mapping between a server and volume.
 *
 * @param serverId The server instance ID.
 * @param volumeId The volume instance ID.
 * @return The mapping profiles.
 * @throws StorageCenterAPIException
 */
public ScMappingProfile[] findMappingProfiles(String serverId, String volumeId) throws StorageCenterAPIException {
    PayloadFilter filter = new PayloadFilter();
    filter.append("server", serverId);
    filter.append("volume", volumeId);
    RestResult rr = restClient.post("StorageCenter/ScMappingProfile/GetList", filter.toJson());
    if (checkResults(rr)) {
        return gson.fromJson(rr.getResult(), ScMappingProfile[].class);
    }
    String message = String.format("Error getting mapping profiles from server %s and volume %s: %s", serverId, volumeId, rr.getErrorMsg());
    throw new StorageCenterAPIException(message);
}
Also used : RestResult(com.emc.storageos.driver.dellsc.scapi.rest.RestResult) PayloadFilter(com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter) ScMappingProfile(com.emc.storageos.driver.dellsc.scapi.objects.ScMappingProfile)

Example 5 with RestResult

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

the class StorageCenterAPI method getVolumeMaps.

/**
 * Gets the individual maps for a volume.
 *
 * @param instanceId The volume instance ID.
 * @return The mappings.
 * @throws StorageCenterAPIException
 */
public ScMapping[] getVolumeMaps(String instanceId) throws StorageCenterAPIException {
    RestResult rr = restClient.get(String.format("StorageCenter/ScVolume/%s/MappingList", instanceId));
    if (checkResults(rr)) {
        return gson.fromJson(rr.getResult(), ScMapping[].class);
    }
    String message = String.format("Error getting volume maps: %s", rr.getErrorMsg());
    throw new StorageCenterAPIException(message);
}
Also used : RestResult(com.emc.storageos.driver.dellsc.scapi.rest.RestResult) ScMapping(com.emc.storageos.driver.dellsc.scapi.objects.ScMapping)

Aggregations

RestResult (com.emc.storageos.driver.dellsc.scapi.rest.RestResult)44 Parameters (com.emc.storageos.driver.dellsc.scapi.rest.Parameters)16 PayloadFilter (com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter)12 ScVolume (com.emc.storageos.driver.dellsc.scapi.objects.ScVolume)4 ScServerHba (com.emc.storageos.driver.dellsc.scapi.objects.ScServerHba)3 ScVolumeConfiguration (com.emc.storageos.driver.dellsc.scapi.objects.ScVolumeConfiguration)3 ArrayList (java.util.ArrayList)3 ScControllerPort (com.emc.storageos.driver.dellsc.scapi.objects.ScControllerPort)2 ScMapping (com.emc.storageos.driver.dellsc.scapi.objects.ScMapping)2 ScMappingProfile (com.emc.storageos.driver.dellsc.scapi.objects.ScMappingProfile)2 ScObject (com.emc.storageos.driver.dellsc.scapi.objects.ScObject)2 ScReplay (com.emc.storageos.driver.dellsc.scapi.objects.ScReplay)2 ScServer (com.emc.storageos.driver.dellsc.scapi.objects.ScServer)2 ScStorageType (com.emc.storageos.driver.dellsc.scapi.objects.ScStorageType)2 ScFaultDomain (com.emc.storageos.driver.dellsc.scapi.objects.ScFaultDomain)1 ScReplayConsistencyGroup (com.emc.storageos.driver.dellsc.scapi.objects.ScReplayConsistencyGroup)1 ScReplayProfile (com.emc.storageos.driver.dellsc.scapi.objects.ScReplayProfile)1 ScServerOperatingSystem (com.emc.storageos.driver.dellsc.scapi.objects.ScServerOperatingSystem)1