use of com.emc.storageos.driver.dellsc.scapi.objects.ScControllerPort in project coprhd-controller by CoprHD.
the class StorageCenterAPI method getFaultDomainPorts.
/**
* Gets the virtual ports in a fault domain.
*
* @param instanceId The fault domain instance ID.
* @param True to get virtual ports, false to get physical.
* @return The controller ports.
*/
public ScControllerPort[] getFaultDomainPorts(String instanceId, boolean virtualPorts) {
String portType = virtualPorts ? "Virtual" : "Physical";
RestResult rr = restClient.get(String.format("StorageCenter/ScFaultDomain/%s/%sPortList", instanceId, portType));
if (checkResults(rr)) {
return gson.fromJson(rr.getResult(), ScControllerPort[].class);
}
LOG.warn(String.format("Error getting controller ports for fault domain %s: %s", instanceId, rr.getErrorMsg()));
return new ScControllerPort[0];
}
use of com.emc.storageos.driver.dellsc.scapi.objects.ScControllerPort 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