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];
}
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];
}
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);
}
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);
}
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);
}
Aggregations