use of com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter in project coprhd-controller by CoprHD.
the class StorageCenterAPI method getServerVolumeMapping.
/**
* Gets existing mapping profiles between a server and volume.
*
* @param volInstanceId The volume instance ID.
* @param serverInstanceId The server instance ID.
* @return The mapping profiles between the two.
*/
public ScMappingProfile[] getServerVolumeMapping(String volInstanceId, String serverInstanceId) {
PayloadFilter filter = new PayloadFilter();
filter.append("volume", volInstanceId);
filter.append("server", serverInstanceId);
RestResult rr = restClient.post("StorageCenter/ScMappingProfile/GetList", filter.toJson());
if (checkResults(rr)) {
return gson.fromJson(rr.getResult(), ScMappingProfile[].class);
}
return new ScMappingProfile[0];
}
use of com.emc.storageos.driver.dellsc.scapi.rest.PayloadFilter in project coprhd-controller by CoprHD.
the class StorageCenterAPI method getTargetPorts.
/**
* Gets all controller target ports.
*
* @param ssn The Storage Center serial number.
* @param type The type of port to get or Null for all types.
* @return The controller ports.
*/
public ScControllerPort[] getTargetPorts(String ssn, String type) {
PayloadFilter filter = new PayloadFilter();
filter.append("scSerialNumber", ssn);
if (type != null && type.length() > 0) {
filter.append("transportType", type);
}
RestResult rr = restClient.post("StorageCenter/ScControllerPort/GetList", filter.toJson());
if (checkResults(rr)) {
List<ScControllerPort> ports = new ArrayList<>();
ScControllerPort[] scPorts = gson.fromJson(rr.getResult(), ScControllerPort[].class);
for (ScControllerPort port : scPorts) {
if (port.purpose.startsWith("FrontEnd") && !"FrontEndReserved".equals(port.purpose)) {
ports.add(port);
}
}
return ports.toArray(new ScControllerPort[0]);
}
return new ScControllerPort[0];
}
Aggregations