use of com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter 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.PayloadFilter 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.PayloadFilter in project coprhd-controller by CoprHD.
the class StorageCenterAPI method getServerOperatingSystems.
/**
* Gets the OS types.
*
* @param ssn The Storage Center system serial number.
* @param product The product to filter on or null.
* @return The OS types.
*/
public ScServerOperatingSystem[] getServerOperatingSystems(String ssn, String product) {
PayloadFilter filter = new PayloadFilter();
filter.append("scSerialNumber", ssn);
if (product != null && !product.isEmpty()) {
filter.append("product", product, ValueFilterType.INCLUDESSTRING);
}
RestResult rr = restClient.post("StorageCenter/ScServerOperatingSystem/GetList", filter.toJson());
if (checkResults(rr)) {
return gson.fromJson(rr.getResult(), ScServerOperatingSystem[].class);
}
return new ScServerOperatingSystem[0];
}
use of com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter in project coprhd-controller by CoprHD.
the class StorageCenterAPI method findReplayView.
/**
* Finds a view volume for a given replay.
*
* @param instanceId The replay instance ID.
* @return The volume or null if not found.
*/
public ScVolume findReplayView(String instanceId) {
PayloadFilter filter = new PayloadFilter();
filter.append("notes", instanceId);
RestResult rr = restClient.post("StorageCenter/ScVolumeConfiguration/GetList", filter.toJson());
if (checkResults(rr)) {
ScVolumeConfiguration[] config = gson.fromJson(rr.getResult(), ScVolumeConfiguration[].class);
rr = restClient.get(String.format("StorageCenter/ScVolume/%s", config[0].volume.instanceId));
if (checkResults(rr)) {
return gson.fromJson(rr.getResult(), ScVolume.class);
} else {
LOG.warn(rr.getErrorMsg());
}
} else {
LOG.warn(rr.getErrorMsg());
}
return null;
}
use of com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter in project coprhd-controller by CoprHD.
the class StorageCenterAPI method getServerHbas.
/**
* Gets all defined HBAs for a server definition.
*
* @param ssn The Storage Center serial number.
* @param serverInstanceId The server definition.
* @return The HBAs.
*/
public ScServerHba[] getServerHbas(String ssn, String serverInstanceId) {
PayloadFilter filter = new PayloadFilter();
filter.append("scSerialNumber", ssn);
filter.append("Server", serverInstanceId);
RestResult rr = restClient.post("StorageCenter/ScServerHba/GetList", filter.toJson());
if (checkResults(rr)) {
return gson.fromJson(rr.getResult(), ScServerHba[].class);
}
return new ScServerHba[0];
}
Aggregations