private void handleInterfaceEventAdd(final String neutronPortUuid, Long dpId, final Uuid interfaceUuid) { neutronPortToDpIdCache.put(neutronPortUuid, new ImmutablePair<>(dpId, interfaceUuid)); LOG.debug("handleInterfaceEvent add cache entry NeutronPortUuid {} : dpid {}, ifUuid {}", neutronPortUuid, dpId, interfaceUuid.getValue()); }
public void unregisterEpFromLneLayer2(Uuid tenantId, NodeId fabricId, NodeId lswId, Uuid epUuid) { VContainerConfigMgr vcMgr = this.vcConfigDataMgrList.get(tenantId); if (vcMgr == null) { LOG.error("FABMGR: ERROR: unregisterEpFromLneLayer2: vcMgr is null: tenantId={}", tenantId.getValue()); return; // -----> } if (fabricId == null) { LOG.error("FABMGR: ERROR: unregisterEpFromLneLayer2: vfabricId is null: {}", tenantId.getValue()); return; // ----> } this.netNodeServiceProvider.unregisterEndpoint(tenantId, fabricId, lswId, epUuid); }
public void removeAcl(Uuid tenantId, String fabricId, NodeId nodeId, String aclName) { VContainerConfigMgr vcMgr = this.vcConfigDataMgrList.get(tenantId); if (vcMgr == null) { LOG.error("FABMGR: ERROR: removeAcl: vcMgr is null: tenantId={}", tenantId.getValue()); return; // -----> } this.netNodeServiceProvider.removeAcl(fabricId, nodeId, aclName); }
public void removeLrLswGateway(Uuid tenantId, String fabricId, NodeId lrId, IpAddress gatewayIpAddr) { VContainerConfigMgr vcMgr = this.vcConfigDataMgrList.get(tenantId); if (vcMgr == null) { LOG.error("FABMGR: ERROR: removeLrLswGateway: vcMgr is null: tenantId={}", tenantId.getValue()); return; // -----> } this.netNodeServiceProvider.removeLrLswGateway(fabricId, lrId, gatewayIpAddr); }
private static List<EndpointGroupId> resolveEpgIdsFromSecGroups(@Nullable List<Uuid> securityGroups) { List<EndpointGroupId> epgIds = new ArrayList<>(); if ((securityGroups == null || securityGroups.isEmpty())) { return epgIds; } for (Uuid secGrp : securityGroups) { epgIds.add(new EndpointGroupId(secGrp.getValue())); } return epgIds; }
private void removeSnatEntries(Networks original, Uuid networkUuid) { List<Uuid> routerUuids = original.getRouterIds(); for (Uuid routerUuid : routerUuids) { Long routerId = NatUtil.getVpnId(dataBroker, routerUuid.getValue()); if (routerId == NatConstants.INVALID_ID) { LOG.error("NAT Service : Invalid routerId returned for routerName {}", routerUuid.getValue()); return; } List<String> externalIps = NatUtil.getExternalIpsForRouter(dataBroker,routerId); externalRouterListener.handleDisableSnatInternetVpn(routerUuid.getValue(), networkUuid, externalIps, false, original.getVpnid().getValue()); } }
public void createAcl(Uuid tenantId, String fabricId, NodeId nodeId, String aclName) { VContainerConfigMgr vcMgr = this.vcConfigDataMgrList.get(tenantId); if (vcMgr == null) { LOG.error("FABMGR: ERROR: createAcl: vcMgr is null: tenantId={}", tenantId.getValue()); return; // -----> } if (!vcMgr.getLdNodeConfigDataMgr().isVFabricAvailable(fabricId)) { LOG.error("FABMGR: ERROR: createAcl: vfabricId is null: {}", tenantId.getValue()); return; // ----> } this.netNodeServiceProvider.createAcl(fabricId, nodeId, aclName); }
private void handleInterfaceEventDelete(final OvsdbTerminationPointAugmentation intf, final Long dpId) { // Remove entry from neutronPortToDpIdCache based on interface uuid for (Map.Entry<String, Pair<Long, Uuid>> entry : neutronPortToDpIdCache.entrySet()) { final String currPortUuid = entry.getKey(); if (intf.getInterfaceUuid().equals(entry.getValue().getRight())) { LOG.debug("handleInterfaceEventDelete remove cache entry NeutronPortUuid {} : dpid {}, ifUuid {}", currPortUuid, dpId, intf.getInterfaceUuid().getValue()); neutronPortToDpIdCache.remove(currPortUuid); break; } } }
public String getBridgeUuid(Node node, String name) { String uuid = null; OvsdbBridgeAugmentation ovsdbBridgeAugmentation = readBridge(node, name); if (ovsdbBridgeAugmentation != null) { uuid = ovsdbBridgeAugmentation.getBridgeUuid().getValue(); } return uuid; }
static String getAssociatedExternalNetwork(DataBroker dataBroker, String routerId) { InstanceIdentifier<Routers> id = buildRouterIdentifier(routerId); Optional<Routers> routerData = read(dataBroker, LogicalDatastoreType.CONFIGURATION, id); if (routerData.isPresent()) { Uuid networkId = routerData.get().getNetworkId(); if(networkId != null) { return networkId.getValue(); } } return null; }
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 SecurityGroupDeletedImpl(SecurityGroup secGroup) { Date date= new Date(); timeStamp = new Timestamp(date.getTime()); securityGroup = new NeutronSecurityGroup(); securityGroup.setSecurityGroupID(secGroup.getUuid().getValue()); securityGroup.setSecurityGroupName(secGroup.getName()); securityGroup.setSecurityTenantID(secGroup.getTenantId().getValue()); } @Override
public SecurityGroupUpdatedImpl(SecurityGroup secGroup) { Date date= new Date(); timeStamp = new Timestamp(date.getTime()); securityGroup = new NeutronSecurityGroup(); securityGroup.setSecurityGroupID(secGroup.getUuid().getValue()); securityGroup.setSecurityGroupName(secGroup.getName()); securityGroup.setSecurityTenantID(secGroup.getTenantId().getValue()); } @Override
public static L2gateway getNeutronL2gateway(DataBroker broker, Uuid l2GatewayId) { LOG.debug("getNeutronL2gateway for {}", l2GatewayId.getValue()); InstanceIdentifier<L2gateway> inst = InstanceIdentifier.create(Neutron.class).child(L2gateways.class) .child(L2gateway.class, new L2gatewayKey(l2GatewayId)); Optional<L2gateway> l2Gateway = MDSALUtil.read(broker, LogicalDatastoreType.CONFIGURATION, inst); if (l2Gateway.isPresent()) { return l2Gateway.get(); } return null; }
private boolean isNexthopTheOtherVpnLinkEndpoint(String nexthop, String thisVpnUuid, InterVpnLink interVpnLink) { return interVpnLink != null && ( (interVpnLink.getFirstEndpoint().getVpnUuid().getValue().equals(thisVpnUuid) && interVpnLink.getSecondEndpoint().getIpAddress().getValue().equals(nexthop)) || (interVpnLink.getSecondEndpoint().getVpnUuid().getValue().equals(thisVpnUuid ) && interVpnLink.getFirstEndpoint().getIpAddress().getValue().equals(nexthop)) ); }
public boolean changeActionOfNeutronSecurityRule(SecurityRule secRule, ActionChoice action, Neutron neutron, ReadWriteTransaction rwTx) { addSfcChainActionInstance(action, new TenantId(secRule.getTenantId().getValue()), rwTx); LOG.trace("Changing to action {} for secuirity group rule {}", action, secRule); return addNeutronSecurityRuleWithAction(secRule, neutron, action, rwTx); }
private void unregisterEndpointAndRemoveMapping(UnregisterEndpointInput baseEpUnreg, Port port, ReadWriteTransaction rwTx) { boolean isUnregisteredBaseEndpoint = epRegistrator.unregisterEndpoint(baseEpUnreg); if (isUnregisteredBaseEndpoint) { UniqueId portId = new UniqueId(port.getUuid().getValue()); PortByBaseEndpointKey portByBaseEndpointKey = new PortByBaseEndpointKey(port.getMacAddress().getValue(), MacAddressType.class, new ContextId(port.getNetworkId().getValue()), MappingUtils.L2_BRDIGE_DOMAIN); LOG.trace("Removing Port-BaseEndpoint mapping for port {} (device owner {}) and endpoint {}", port.getUuid().getValue(), port.getDeviceOwner(), portByBaseEndpointKey); removeBaseEndpointMappings(portByBaseEndpointKey, portId, rwTx); } }
private void qosExtension(Port port, NeutronPort result) { final QosPortExtension qos = port.getAugmentation(QosPortExtension.class); if(qos != null && qos.getQosPolicyId() != null) { result.setQosPolicyId(qos.getQosPolicyId().getValue()); } }
private String getQueueUuid(OvsdbQueueRef queueRef, OvsdbNodeAugmentation operNode) { QueuesKey queueKey = queueRef.getValue().firstKeyOf(Queues.class); if (operNode.getQueues() != null && !operNode.getQueues().isEmpty()) { for (Queues queue : operNode.getQueues()) { if (queue.getQueueId().equals(queueKey.getQueueId())) { return queue.getQueueUuid().getValue(); } } } return SouthboundConstants.QUEUE_NAMED_UUID_PREFIX + TransactUtils.bytesToHexString(queueKey.getQueueId().getValue().getBytes()); }
private ElanInstance createElanInstance(Network input) { String elanInstanceName = input.getUuid().getValue(); Class<? extends SegmentTypeBase> segmentType = NeutronvpnUtils.getSegmentTypeFromNeutronNetwork(input); String segmentationId = NeutronUtils.getSegmentationIdFromNeutronNetwork(input); String physicalNetworkName = NeutronvpnUtils.getPhysicalNetworkName(input); ElanInstance elanInstance = createElanInstance(elanInstanceName, segmentType, segmentationId, physicalNetworkName); InstanceIdentifier<ElanInstance> id = createElanInstanceIdentifier(elanInstanceName); MDSALUtil.syncWrite(dataBroker, LogicalDatastoreType.CONFIGURATION, id, elanInstance); return elanInstance; }