protected static Port getNeutronPort(DataBroker broker, Uuid portId) { Port prt = null; prt = portMap.get(portId); if (prt != null) { return prt; } logger.debug("getNeutronPort for {}", portId.getValue()); InstanceIdentifier<Port> inst = InstanceIdentifier.create(Neutron.class).child(Ports.class).child(Port.class, new PortKey(portId)); Optional<Port> port = read(broker, LogicalDatastoreType.CONFIGURATION, inst); if (port.isPresent()) { prt = port.get(); } return prt; }
OvsdbPortMetadata ovsdbPortMetadata = ovsdbMdsalHelper.getOvsdbPortMetadata( neutronPortEntry.getValue().getKey().getUuid(), ovsdbTopology);
public InstanceIdentifier<Port> getNeutronPortPath(Uuid portId) { return InstanceIdentifier .create(Neutron.class) .child(Ports.class) .child(Port.class,new PortKey(portId)); }
private InstanceIdentifier<Port> getNeutronPortPath(Uuid portId) { return portsIid.builder().child(Port.class, new PortKey(portId)).build(); }
/** * Read the neutron port associated with the given UUID in the * configuration datastore. * * @param id The UUID for the neutron port. * @return The neutron port if fonud. * {@code null} if not fonud. */ private Port readPort(String id) { try { Uuid uuid = new Uuid(id); InstanceIdentifier<Port> path = InstanceIdentifier. builder(Neutron.class). child(Ports.class). child(Port.class, new PortKey(uuid)). build(); Optional<Port> opt = MdsalUtils.read( txHolder.get(), LogicalDatastoreType.CONFIGURATION, path); if (opt.isPresent()) { return opt.get(); } LOG.debug("Neutron port not found: id={}", id); } catch (Exception e) { LOG.error("Failed to read neutron port: id=" + id, e); } return null; } }
Uuid portUid = new Uuid(parentInt); InstanceIdentifier<Port> pathPort = InstanceIdentifier.create(Neutron.class).child(Ports.class) .child(Port.class, new PortKey(portUid)); Port port = mdsalUtils.read(LogicalDatastoreType.CONFIGURATION, pathPort);
InstanceIdentifier<Port> inst = InstanceIdentifier.create(Neutron.class) .child(Ports.class) .child(Port.class, new PortKey(portUuid)); Optional<Port> port = VpnUtil.read(dataBroker, LogicalDatastoreType.CONFIGURATION, inst); if (port.isPresent()) {