use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.graceful.restart.Config in project netvirt by opendaylight.
the class NeutronvpnNatManager method removeExternalNetwork.
public void removeExternalNetwork(Network net) {
Uuid extNetId = net.getUuid();
// Create and add Networks object for this External Network to the ExternalNetworks list
InstanceIdentifier<Networks> netsIdentifier = InstanceIdentifier.builder(ExternalNetworks.class).child(Networks.class, new NetworksKey(extNetId)).build();
try {
Optional<Networks> optionalNets = SingleTransactionDataBroker.syncReadOptional(dataBroker, LogicalDatastoreType.CONFIGURATION, netsIdentifier);
LOG.trace("Removing Networks node {}", extNetId.getValue());
if (!optionalNets.isPresent()) {
LOG.error("External Network {} not available in the datastore", extNetId.getValue());
return;
}
// Delete Networks object from the ExternalNetworks list
LOG.trace("Deleting External Network {}", extNetId.getValue());
SingleTransactionDataBroker.syncDelete(dataBroker, LogicalDatastoreType.CONFIGURATION, netsIdentifier);
LOG.trace("Deleted External Network {} successfully from CONFIG Datastore", extNetId.getValue());
} catch (TransactionCommitFailedException | ExecutionException | InterruptedException ex) {
LOG.error("Deletion of External Network {} failed", extNetId.getValue(), ex);
}
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.graceful.restart.Config in project netvirt by opendaylight.
the class NeutronvpnManager method createL3InternalVpn.
public void createL3InternalVpn(Uuid vpnId, String name, Uuid tenantId, List<String> rdList, List<String> irtList, List<String> ertList, Uuid routerId, List<Uuid> networksList) {
IpVersionChoice ipVersChoices = neutronvpnUtils.getIpVersionChoicesFromRouterUuid(routerId);
// Update VPN Instance node
updateVpnInstanceNode(vpnId, rdList, irtList, ertList, false, /*isL2Vpn*/
0, /*l3vni*/
ipVersChoices);
// Update local vpn-subnet DS
updateVpnMaps(vpnId, name, routerId, tenantId, networksList);
if (routerId != null) {
Uuid existingVpn = neutronvpnUtils.getVpnForRouter(routerId, true);
if (existingVpn != null) {
// use case when a cluster is rebooted and router add DCN is received, triggering #createL3InternalVpn
// if before reboot, router was already associated to VPN, should not proceed associating router to
// internal VPN. Adding to RouterInterfacesMap is also not needed since it's a config DS and will be
// preserved upon reboot.
// For a non-reboot case #associateRouterToInternalVPN already takes care of adding to
// RouterInterfacesMap via #createVPNInterface call.
LOG.info("Associating router to Internal VPN skipped for VPN {} due to router {} already associated " + "to external VPN {}", vpnId.getValue(), routerId.getValue(), existingVpn.getValue());
return;
}
associateRouterToInternalVpn(vpnId, routerId);
}
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.graceful.restart.Config in project bgpcep by opendaylight.
the class RibImpl method createRib.
private RIBImpl createRib(final Global global, final String bgpInstanceName, final BGPTableTypeRegistryConsumer tableTypeRegistry) {
this.afiSafi = getAfiSafiWithDefault(global.getAfiSafis(), true);
final Config globalConfig = global.getConfig();
this.asNumber = globalConfig.getAs();
this.routerId = globalConfig.getRouterId();
this.clusterId = getGlobalClusterIdentifier(globalConfig);
final BGPPeerTrackerImpl peerTracker = new BGPPeerTrackerImpl();
final Map<TablesKey, PathSelectionMode> pathSelectionModes = OpenConfigMappingUtil.toPathSelectionMode(this.afiSafi, tableTypeRegistry, peerTracker).entrySet().stream().collect(Collectors.toMap(entry -> new TablesKey(entry.getKey().getAfi(), entry.getKey().getSafi()), Map.Entry::getValue));
final BGPRibRoutingPolicy ribPolicy = this.policyProvider.buildBGPRibPolicy(this.asNumber.getValue(), this.routerId, this.clusterId, RoutingPolicyUtil.getApplyPolicy(global.getApplyPolicy()));
final CodecsRegistryImpl codecsRegistry = CodecsRegistryImpl.create(codecTreeFactory, this.extensions.getClassLoadingStrategy());
return new RIBImpl(new RibId(bgpInstanceName), this.asNumber, new BgpId(this.routerId), this.extensions, this.dispatcher, codecsRegistry, this.domBroker, this.dataBroker, ribPolicy, peerTracker, toTableTypes(this.afiSafi, tableTypeRegistry), pathSelectionModes);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.graceful.restart.Config in project bgpcep by opendaylight.
the class PCEPTopologyDeployerImpl method createTopologyProvider.
private synchronized void createTopologyProvider(final Topology topology) {
if (!filterPcepTopologies(topology.getTopologyTypes())) {
return;
}
final TopologyId topologyId = topology.getTopologyId();
if (this.pcepTopologyServices.containsKey(topology.getTopologyId())) {
LOG.warn("Topology Provider {} already exist. New instance won't be created", topologyId);
return;
}
LOG.info("Creating Topology {}", topologyId);
LOG.trace("Topology {}.", topology);
final SessionConfig config = topology.getAugmentation(PcepTopologyTypeConfig.class).getSessionConfig();
final InstructionScheduler instructionScheduler = this.instructionSchedulerFactory.createInstructionScheduler(topologyId.getValue());
final PCEPTopologyConfiguration dependencies = new PCEPTopologyConfiguration(config, topology);
final PCEPTopologyProviderBean pcepTopologyProviderBean = (PCEPTopologyProviderBean) this.container.getComponentInstance(PCEPTopologyProviderBean.class.getSimpleName());
this.pcepTopologyServices.put(topologyId, pcepTopologyProviderBean);
pcepTopologyProviderBean.start(dependencies, instructionScheduler);
}
use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.multiprotocol.rev151009.bgp.common.afi.safi.list.afi.safi.graceful.restart.Config in project bgpcep by opendaylight.
the class PCEPTopologyProviderUtil method contructSpeakersId.
static SpeakerIdMapping contructSpeakersId(final Topology topology) {
final SpeakerIdMapping ret = SpeakerIdMapping.getSpeakerIdMap();
topology.getNode().stream().filter(Objects::nonNull).filter(node -> node.getAugmentation(PcepNodeConfig.class) != null).filter(node -> node.getAugmentation(PcepNodeConfig.class).getSessionConfig() != null).filter(node -> node.getAugmentation(PcepNodeConfig.class).getSessionConfig().getAugmentation(PcepNodeSyncConfig.class) != null).forEach(node -> {
final PcepNodeConfig config = node.getAugmentation(PcepNodeConfig.class);
final PcepNodeSyncConfig nodeSyncConfig = config.getSessionConfig().getAugmentation(PcepNodeSyncConfig.class);
final InetAddress address = InetAddresses.forString(node.getNodeId().getValue());
ret.put(address, nodeSyncConfig.getSpeakerEntityIdValue());
});
return ret;
}
Aggregations