Search in sources :

Example 16 with TopologyId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId in project bgpcep by opendaylight.

the class PCEPTopologyDeployerImpl method removeTopologyProvider.

private synchronized void removeTopologyProvider(final Topology topology) {
    if (!filterPcepTopologies(topology.getTopologyTypes())) {
        return;
    }
    final TopologyId topologyId = topology.getTopologyId();
    closeTopology(this.pcepTopologyServices.remove(topologyId), topologyId);
}
Also used : TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId)

Example 17 with TopologyId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId in project bgpcep by opendaylight.

the class PcepStateUtils method displayNodeState.

/**
 * Display to stream operational state, rib Id is mandatory.
 *
 * @param dataBroker data broker
 * @param stream     where to print
 * @param topologyId mandatory, Topology where Node pertains
 * @param nodeId     mandatory, State per given Node Id will be printed
 */
public static void displayNodeState(@NonNull final DataBroker dataBroker, @NonNull final PrintStream stream, @NonNull final String topologyId, @NonNull final String nodeId) {
    final Node node = readNodeFromDataStore(dataBroker, topologyId, nodeId);
    if (node == null) {
        stream.println(String.format("Node [%s] not found", nodeId));
        return;
    }
    final PcepTopologyNodeStatsAug state = node.getAugmentation(PcepTopologyNodeStatsAug.class);
    if (state == null) {
        stream.println(String.format("State not found for [%s]", nodeId));
        return;
    }
    final PcepSessionState nodeState = state.getPcepSessionState();
    displayNodeState(topologyId, nodeId, nodeState, stream);
}
Also used : PcepTopologyNodeStatsAug(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.stats.rev171113.PcepTopologyNodeStatsAug) PcepSessionState(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.stats.rev171113.pcep.session.state.grouping.PcepSessionState) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)

Example 18 with TopologyId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId in project netvirt by opendaylight.

the class NodeConnectedHandlerTest method getInstanceIdentifier.

public static InstanceIdentifier<Node> getInstanceIdentifier(String haUUidVal) {
    String nodeString = "hwvtep://uuid/" + UUID.nameUUIDFromBytes(haUUidVal.getBytes()).toString();
    NodeId nodeId = new NodeId(new Uri(nodeString));
    NodeKey nodeKey = new NodeKey(nodeId);
    TopologyKey topoKey = new TopologyKey(new TopologyId(new Uri("hwvtep:1")));
    return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topoKey).child(Node.class, nodeKey).build();
}
Also used : TopologyKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri) NodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey) TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId)

Example 19 with TopologyId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId in project netvirt by opendaylight.

the class NodeConnectedHandlerTest method createInstanceIdentifier.

public static InstanceIdentifier<Node> createInstanceIdentifier(String nodeIdString) {
    NodeId nodeId = new NodeId(new Uri(nodeIdString));
    NodeKey nodeKey = new NodeKey(nodeId);
    TopologyKey topoKey = new TopologyKey(new TopologyId(new Uri("hwvtep:1")));
    return InstanceIdentifier.builder(NetworkTopology.class).child(Topology.class, topoKey).child(Node.class, nodeKey).build();
}
Also used : TopologyKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) NodeId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId) Uri(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri) NodeKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey) TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId)

Example 20 with TopologyId

use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId in project netvirt by opendaylight.

the class StateManager method initializeNetvirtTopology.

private void initializeNetvirtTopology() {
    final TopologyId topologyId = new TopologyId("netvirt:1");
    InstanceIdentifier<Topology> path = InstanceIdentifier.create(NetworkTopology.class).child(Topology.class, new TopologyKey(topologyId));
    TopologyBuilder tpb = new TopologyBuilder();
    tpb.setTopologyId(topologyId);
    try {
        txRunner.callWithNewWriteOnlyTransactionAndSubmit(tx -> tx.put(LogicalDatastoreType.OPERATIONAL, path, tpb.build())).get();
    } catch (InterruptedException | ExecutionException e) {
        LOG.error("StateManager error initializing netvirt topology", e);
    }
}
Also used : IFibManager(org.opendaylight.netvirt.fibmanager.api.IFibManager) Logger(org.slf4j.Logger) ManagedNewTransactionRunner(org.opendaylight.genius.infra.ManagedNewTransactionRunner) LogicalDatastoreType(org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType) IVpnManager(org.opendaylight.netvirt.vpnmanager.api.IVpnManager) TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId) LoggerFactory(org.slf4j.LoggerFactory) IElanService(org.opendaylight.netvirt.elanmanager.api.IElanService) Singleton(javax.inject.Singleton) INeutronVpnManager(org.opendaylight.netvirt.neutronvpn.interfaces.INeutronVpnManager) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) DataBroker(org.opendaylight.controller.md.sal.binding.api.DataBroker) ExecutionException(java.util.concurrent.ExecutionException) Inject(javax.inject.Inject) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) ManagedNewTransactionRunnerImpl(org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl) IBgpManager(org.opendaylight.netvirt.bgpmanager.api.IBgpManager) PostConstruct(javax.annotation.PostConstruct) TopologyKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey) TopologyBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder) TopologyKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey) TopologyBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) NetworkTopology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology) Topology(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology) ExecutionException(java.util.concurrent.ExecutionException) TopologyId(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId)

Aggregations

TopologyId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId)18 TopologyKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey)12 NetworkTopology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology)11 Topology (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology)7 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)6 NodeKey (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey)6 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)5 ExecutionException (java.util.concurrent.ExecutionException)4 ArrayList (java.util.ArrayList)2 Before (org.junit.Before)2 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)2 TransactionChainListener (org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener)2 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)2 Uri (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri)2 Tunnels (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.Tunnels)2 TunnelsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelsBuilder)2 TunnelsKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelsKey)2 BfdParams (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.tunnel.attributes.BfdParams)2 PcepTopologyNodeStatsAug (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.topology.pcep.stats.rev171113.PcepTopologyNodeStatsAug)2 TopologyBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyBuilder)2