use of com.emc.storageos.driver.dellsc.scapi.rest.RestResult in project coprhd-controller by CoprHD.
the class StorageCenterAPI method getMappingProfileMaps.
/**
* Gets the individual maps created for a mapping profile.
*
* @param instanceId The mapping profile instance ID.
* @return The mappings.
* @throws StorageCenterAPIException
*/
public ScMapping[] getMappingProfileMaps(String instanceId) throws StorageCenterAPIException {
RestResult rr = restClient.get(String.format("StorageCenter/ScMappingProfile/%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);
}
use of com.emc.storageos.driver.dellsc.scapi.rest.RestResult 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];
}
use of com.emc.storageos.driver.dellsc.scapi.rest.RestResult in project coprhd-controller by CoprHD.
the class StorageCenterAPI method createClusterServer.
/**
* Creates a new cluster server definition.
*
* @param ssn The Storage Center serial number.
* @param clusterName The cluster name.
* @param osId The OS instance ID.
* @return The created server.
* @throws StorageCenterAPIException
*/
public ScServer createClusterServer(String ssn, String clusterName, String osId) throws StorageCenterAPIException {
Parameters params = new Parameters();
params.add("Name", clusterName);
params.add("StorageCenter", ssn);
params.add("Notes", NOTES_STRING);
params.add("OperatingSystem", osId);
RestResult rr = restClient.post("StorageCenter/ScServerCluster", params.toJson());
if (!checkResults(rr)) {
String error = String.format("Error creating cluster server '%s': %s", clusterName, rr.getErrorMsg());
throw new StorageCenterAPIException(error);
}
return gson.fromJson(rr.getResult(), ScServer.class);
}
use of com.emc.storageos.driver.dellsc.scapi.rest.RestResult in project coprhd-controller by CoprHD.
the class StorageCenterAPI method getReplayProfileVolumes.
/**
* Gets all volumes that are part of a replay profile.
*
* @param instanceId The replay profile instance ID.
* @return The member volumes.
* @throws StorageCenterAPIException
*/
public ScVolume[] getReplayProfileVolumes(String instanceId) throws StorageCenterAPIException {
RestResult rr = restClient.get(String.format("StorageCenter/ScReplayProfile/%s/VolumeList", instanceId));
if (checkResults(rr)) {
return gson.fromJson(rr.getResult(), ScVolume[].class);
}
String message = "Unknown";
if (rr.getErrorMsg().length() > 0) {
message = rr.getErrorMsg();
}
message = String.format("Error getting replay profile member volumes: %s", message);
throw new StorageCenterAPIException(message);
}
use of com.emc.storageos.driver.dellsc.scapi.rest.RestResult in project coprhd-controller by CoprHD.
the class StorageCenterAPI method getScConfig.
/**
* Gets SC configuration settings.
*
* @param ssn The system serial number.
* @return The configuration settings.
* @throws StorageCenterAPIException
*/
public ScConfiguration getScConfig(String ssn) throws StorageCenterAPIException {
RestResult rr = restClient.get(String.format("StorageCenter/ScConfiguration/%s", ssn));
if (checkResults(rr)) {
return gson.fromJson(rr.getResult(), ScConfiguration.class);
}
String message = String.format("Error getting Storage Center configuration: %s", rr.getErrorMsg());
throw new StorageCenterAPIException(message);
}
Aggregations