Search in sources :

Example 31 with Global

use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Global in project netvirt by opendaylight.

the class NodeConnectedHandler method readAndCopyChildPSOpToHAPS.

/**
 * Merge data of child PS node to HA ps node .
 *
 * @param childGlobalNode Ha Global Child node
 * @param haNodePath Ha node path
 * @param tx  Transaction
 * @throws ReadFailedException  Exception thrown if read fails
 */
void readAndCopyChildPSOpToHAPS(Node childGlobalNode, InstanceIdentifier<Node> haNodePath, ReadWriteTransaction tx) throws ReadFailedException {
    if (childGlobalNode == null || childGlobalNode.getAugmentation(HwvtepGlobalAugmentation.class) == null) {
        return;
    }
    List<Switches> switches = childGlobalNode.getAugmentation(HwvtepGlobalAugmentation.class).getSwitches();
    if (switches == null) {
        return;
    }
    for (Switches ps : switches) {
        Node childPsNode = HwvtepHAUtil.readNode(tx, OPERATIONAL, (InstanceIdentifier<Node>) ps.getSwitchRef().getValue());
        if (childPsNode != null) {
            InstanceIdentifier<Node> haPsPath = HwvtepHAUtil.convertPsPath(childPsNode, haNodePath);
            copyChildPSOpToHAPS(childPsNode, haNodePath, haPsPath, tx);
        }
    }
}
Also used : Switches(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.Switches) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) HwvtepGlobalAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation)

Example 32 with Global

use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Global in project genius by opendaylight.

the class IdManager method createGlobalPool.

private IdPool createGlobalPool(WriteTransaction tx, String poolName, long low, long high, long blockSize) throws ReadFailedException {
    IdPool idPool;
    InstanceIdentifier<IdPool> idPoolInstanceIdentifier = idUtils.getIdPoolInstance(poolName);
    Optional<IdPool> existingIdPool = singleTxDB.syncReadOptional(CONFIGURATION, idPoolInstanceIdentifier);
    if (!existingIdPool.isPresent()) {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Creating new global pool {}", poolName);
        }
        idPool = idUtils.createGlobalPool(poolName, low, high, blockSize);
        tx.put(CONFIGURATION, idPoolInstanceIdentifier, idPool, true);
    } else {
        idPool = existingIdPool.get();
        if (LOG.isDebugEnabled()) {
            LOG.debug("GlobalPool exists {}", idPool);
        }
    }
    return idPool;
}
Also used : IdPool(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.idmanager.rev160406.id.pools.IdPool)

Example 33 with Global

use of org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Global in project genius by opendaylight.

the class ItmTunnelAggregationHelper method initTunnelAggregationConfig.

private void initTunnelAggregationConfig(ItmConfig itmConfig) {
    // Load balancing of VxLAN feature is guarded by a global configuration option in the ITM,
    // only when the feature is enabled, the logical tunnel interfaces should be created.
    boolean tunnelAggregationConfigEnabled = false;
    List<TunnelAggregation> tunnelsConfig = itmConfig != null ? itmConfig.getTunnelAggregation() : null;
    if (tunnelsConfig != null) {
        for (TunnelAggregation tnlCfg : tunnelsConfig) {
            Class<? extends TunnelTypeBase> tunType = ItmUtils.getTunnelType(tnlCfg.getKey().getTunnelType());
            if (tunType.isAssignableFrom(TunnelTypeVxlan.class)) {
                tunnelAggregationConfigEnabled = tnlCfg.isEnabled();
                LOG.info("MULTIPLE_VxLAN_TUNNELS: tunnelAggregationEnabled {}", tunnelAggregationConfigEnabled);
                break;
            }
        }
    }
    tunnelAggregationEnabled = tunnelAggregationConfigEnabled;
}
Also used : TunnelAggregation(org.opendaylight.yang.gen.v1.urn.opendaylight.genius.itm.config.rev160406.itm.config.TunnelAggregation)

Aggregations

ByteBuf (io.netty.buffer.ByteBuf)9 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)9 HwvtepGlobalAugmentation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation)6 ArrayList (java.util.ArrayList)4 Test (org.junit.Test)4 Global (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Global)4 AsNumber (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber)4 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)4 ReadFailedException (org.opendaylight.controller.md.sal.common.api.data.ReadFailedException)3 HwvtepGlobalAugmentationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder)3 Managers (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.Managers)3 NodeId (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId)3 NodeBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)3 Optional (com.google.common.base.Optional)2 List (java.util.List)2 Set (java.util.Set)2 Collectors (java.util.stream.Collectors)2 DataBroker (org.opendaylight.controller.md.sal.binding.api.DataBroker)2 ReadWriteTransaction (org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction)2 Neighbors (org.opendaylight.yang.gen.v1.http.openconfig.net.yang.bgp.rev151009.bgp.top.bgp.Neighbors)2