use of com.vmware.photon.controller.model.adapters.vsphere.ProvisionContext.NetworkInterfaceStateWithDetails in project photon-model by vmware.
the class VSphereAdapterInstanceService method findNic.
private NetworkInterfaceStateWithDetails findNic(ProvisionContext ctx, String key, String value) {
NetworkInterfaceStateWithDetails nic = null;
nic = ctx.nics.stream().filter(nics -> nics.subnet != null && nics.subnet.customProperties.containsKey(key) && nics.subnet.customProperties.get(key).contains(value)).findFirst().orElse(null);
if (nic == null) {
nic = ctx.nics.stream().filter(nics -> nics.network != null && nics.network.customProperties.containsKey(key) && nics.network.customProperties.get(key).contains(value)).findFirst().orElse(null);
}
return nic;
}
Aggregations