Search in sources :

Example 1 with InterfaceBfdStatusBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceBfdStatusBuilder in project genius by opendaylight.

the class OvsdbSouthboundTestUtil method updateTerminationPoint.

public static void updateTerminationPoint(DataBroker dataBroker, String interfaceName, Class<? extends InterfaceTypeBase> type) throws TransactionCommitFailedException {
    final OvsdbBridgeName ovsdbBridgeName = new OvsdbBridgeName("s2");
    final InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier("192.168.56.101", 6640, ovsdbBridgeName);
    InstanceIdentifier<TerminationPoint> tpId = createTerminationPointInstanceIdentifier(InstanceIdentifier.keyOf(bridgeIid.firstIdentifierOf(Node.class)), interfaceName);
    TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
    tpBuilder.setKey(InstanceIdentifier.keyOf(tpId));
    OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder = new OvsdbTerminationPointAugmentationBuilder();
    tpAugmentationBuilder.setName(interfaceName);
    if (type != null) {
        tpAugmentationBuilder.setInterfaceType(type);
    }
    List<InterfaceBfdStatus> interfaceBfdStatuses = Arrays.asList(new InterfaceBfdStatusBuilder().setBfdStatusKey("state").setBfdStatusValue("down").build());
    tpAugmentationBuilder.setInterfaceBfdStatus(interfaceBfdStatuses);
    tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
    WriteTransaction tx = dataBroker.newWriteOnlyTransaction();
    tx.merge(OPERATIONAL, tpId, tpBuilder.build(), true);
    tx.submit().checkedGet();
}
Also used : WriteTransaction(org.opendaylight.controller.md.sal.binding.api.WriteTransaction) InterfaceBfdStatusBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceBfdStatusBuilder) OvsdbBridgeName(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName) Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) OvsdbTerminationPointAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentationBuilder) InterfaceBfdStatus(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceBfdStatus) TerminationPointBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder) TerminationPoint(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint)

Aggregations

WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)1 OvsdbBridgeName (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName)1 OvsdbTerminationPointAugmentationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentationBuilder)1 InterfaceBfdStatus (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceBfdStatus)1 InterfaceBfdStatusBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceBfdStatusBuilder)1 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)1 TerminationPoint (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint)1 TerminationPointBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointBuilder)1