public static NeutronRouter_Interface convertMDSalInterfaceToNeutronRouterInterface( Port routerInterface) { NeutronRouter_Interface neutronInterface = new NeutronRouter_Interface(); String id = String.valueOf(routerInterface.getUuid().getValue()); neutronInterface.setID(id); if (routerInterface.getTenantId() != null) { neutronInterface.setTenantID(routerInterface.getTenantId().getValue()); } neutronInterface.setSubnetUUID(routerInterface.getFixedIps().get(0).getSubnetId().getValue()); neutronInterface.setPortUUID(routerInterface.getUuid().getValue()); return neutronInterface; }
public static NeutronRouter_Interface convertMDSalInterfaceToNeutronRouterInterface( Port routerInterface) { NeutronRouter_Interface neutronInterface = new NeutronRouter_Interface(); String id = String.valueOf(routerInterface.getUuid().getValue()); neutronInterface.setID(id); if (routerInterface.getTenantId() != null) { neutronInterface.setTenantID(routerInterface.getTenantId().getValue()); } neutronInterface.setSubnetUUID(routerInterface.getFixedIps().get(0).getSubnetId().getValue()); neutronInterface.setPortUUID(routerInterface.getUuid().getValue()); return neutronInterface; }
@Deprecated private static org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.RegisterEndpointInputBuilder createBasicEndpointInputBuilder( Port port) { return new org.opendaylight.yang.gen.v1.urn.opendaylight.groupbasedpolicy.endpoint.rev140421.RegisterEndpointInputBuilder().setL2Context( new L2BridgeDomainId(port.getNetworkId().getValue())) .setMacAddress(new MacAddress(port.getMacAddress().getValue())) .setTenant(new TenantId(port.getTenantId().getValue())) .setTimestamp(System.currentTimeMillis()); }
private AddressEndpointRegBuilder createBasicL3AddrEpInputBuilder(Port port, NetworkDomainId networkContainment, @Nullable List<EndpointGroupId> endpointGroupsToAdd, Neutron neutron) { Optional<FixedIps> firstFixedIps = PortUtils.resolveFirstFixedIps(port); if (!firstFixedIps.isPresent()) { throw new IllegalStateException("Failed to resolve FixedIps for port " + port.getKey() + ". Cannot register L3 Address endpoint."); } ContextId resolveL3ContextForPort = resolveL3ContextForPort(port, port.getFixedIps().get(0), neutron); AddressEndpointRegBuilder addrEpbuilder = new AddressEndpointRegBuilder().setAddressType(MacAddressType.class) .setAddress(MappingUtils.ipAddressToStringIpPrefix(firstFixedIps.get().getIpAddress())) .setAddressType(IpPrefixType.class) .setContextType(MappingUtils.L3_CONTEXT) .setContextId(resolveL3ContextForPort) .setTenant(new TenantId(port.getTenantId().getValue())) .setTimestamp(System.currentTimeMillis()); List<EndpointGroupId> epgs = concatEndpointGroups(port.getSecurityGroups(), endpointGroupsToAdd); addrEpbuilder.setEndpointGroup(epgs); if (networkContainment != null) { addrEpbuilder.setNetworkContainment(new NetworkContainmentBuilder().setContainment( new NetworkDomainContainmentBuilder().setNetworkDomainId(networkContainment) .setNetworkDomainType(MappingUtils.SUBNET) .build()).build()); } return addrEpbuilder; }
if (port.getTenantId() != null) { result.setTenantID(String.valueOf(port.getTenantId().getValue()).replace("-", ""));
if (port.getTenantId() != null) { result.setTenantID(String.valueOf(port.getTenantId().getValue()).replace("-", ""));
if (port.getTenantId() != null) { result.setTenantID(String.valueOf(port.getTenantId().getValue()).replace("-", ""));
if (port.getTenantId() != null) { result.setTenantID(String.valueOf(port.getTenantId().getValue()).replace("-", ""));
if (port.getTenantId() != null) { result.setTenantID(port.getTenantId());
private AddressEndpointRegBuilder createBasicMacAddrEpInputBuilder(Port port, NetworkDomainId networkContainment, @Nullable List<EndpointGroupId> endpointGroupsToAdd) { AddressEndpointRegBuilder addrEpbuilder = new AddressEndpointRegBuilder().setAddressType(MacAddressType.class) .setAddress(port.getMacAddress().getValue()) .setAddressType(MacAddressType.class) .setContextType(MappingUtils.L2_BRDIGE_DOMAIN) .setContextId(new ContextId(port.getNetworkId().getValue())) .setTenant(new TenantId(port.getTenantId().getValue())) .setTimestamp(System.currentTimeMillis()); List<EndpointGroupId> epgs = concatEndpointGroups(port.getSecurityGroups(), endpointGroupsToAdd); addrEpbuilder.setEndpointGroup(epgs); if (networkContainment != null) { addrEpbuilder.setNetworkContainment(new NetworkContainmentBuilder().setContainment( new NetworkDomainContainmentBuilder().setNetworkDomainId(networkContainment) .setNetworkDomainType(MappingUtils.SUBNET) .build()).build()); } return addrEpbuilder; }
TenantId tenantId = new TenantId(port.getTenantId().getValue()); Optional<Subnet> potentialRouterPortSubnet = SubnetUtils.findSubnet(portIpWithSubnet.getSubnetId(), oldNeutron.getSubnets());
TenantId tenantId = new TenantId(port.getTenantId().getValue()); Optional<Subnet> potentialRouterPortSubnet = SubnetUtils.findSubnet(portIpWithSubnet.getSubnetId(), neutron.getSubnets()); if (!potentialRouterPortSubnet.isPresent()) {