use of com.emc.storageos.vnxe.models.VNXeHostInitiator in project coprhd-controller by CoprHD.
the class VNXUnityArrayAffinityDiscoverer method findHostURI.
/**
* Find host URI from host initiators on array
*
* @param initiators
* @param apiClient
* @param dbClient
* @return host URI or null
*/
private URI findHostURI(List<VNXeBase> initiators, VNXeApiClient apiClient, DbClient dbClient) {
if (initiators != null && !initiators.isEmpty()) {
for (VNXeBase init : initiators) {
VNXeHostInitiator vnxeInitiator = apiClient.getHostInitiator(init.getId());
String portwwn = vnxeInitiator.getPortWWN();
if (HostInitiatorTypeEnum.INITIATOR_TYPE_ISCSI.equals(vnxeInitiator.getType())) {
portwwn = vnxeInitiator.getInitiatorId();
}
if (portwwn == null || portwwn.isEmpty()) {
continue;
}
Initiator initiator = NetworkUtil.getInitiator(portwwn, dbClient);
if (initiator != null && !initiator.getInactive()) {
URI hostURI = initiator.getHost();
if (!NullColumnValueGetter.isNullURI(hostURI)) {
return hostURI;
}
}
}
}
return null;
}
use of com.emc.storageos.vnxe.models.VNXeHostInitiator in project coprhd-controller by CoprHD.
the class ApiClientTest method getHostInitiator.
// @Test
public void getHostInitiator() {
HostInitiatorRequest req = new HostInitiatorRequest(_client);
VNXeHostInitiator res = req.get("HostInitiator_4");
System.out.println(res.getPortWWN());
System.out.println(res.getNodeWWN());
}
Aggregations