Search in sources :

Example 1 with HwvtepGlobalRef

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalRef in project netvirt by opendaylight.

the class NodeConnectedHandlerUtils method addPsNode.

CheckedFuture<Void, TransactionCommitFailedException> addPsNode(InstanceIdentifier<Node> path, InstanceIdentifier<Node> parentPath, List<String> portNameList, WriteTransaction transaction) throws Exception {
    NodeBuilder nodeBuilder = null;
    nodeBuilder = prepareOperationalNode(path);
    PhysicalSwitchAugmentationBuilder physicalSwitchAugmentationBuilder = new PhysicalSwitchAugmentationBuilder();
    physicalSwitchAugmentationBuilder.setManagedBy(new HwvtepGlobalRef(parentPath));
    physicalSwitchAugmentationBuilder.setPhysicalSwitchUuid(getUUid("d1s3"));
    physicalSwitchAugmentationBuilder.setHwvtepNodeName(new HwvtepNodeName("s3"));
    physicalSwitchAugmentationBuilder.setHwvtepNodeDescription("description");
    List<TunnelIps> tunnelIps = new ArrayList<>();
    IpAddress ip = new IpAddress("192.168.122.30".toCharArray());
    tunnelIps.add(new TunnelIpsBuilder().setKey(new TunnelIpsKey(ip)).setTunnelIpsKey(ip).build());
    physicalSwitchAugmentationBuilder.setTunnelIps(tunnelIps);
    nodeBuilder.addAugmentation(PhysicalSwitchAugmentation.class, physicalSwitchAugmentationBuilder.build());
    PhysicalSwitchHelper.dId = parentPath;
    nodeBuilder.setTerminationPoint(PhysicalSwitchHelper.addPhysicalSwitchTerminationPoints(path, transaction, portNameList));
    return TestUtil.submitNode(OPERATIONAL, path, nodeBuilder.build(), transaction);
}
Also used : PhysicalSwitchAugmentationBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentationBuilder) TunnelIpsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelIpsBuilder) TunnelIpsKey(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelIpsKey) TunnelIps(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelIps) HwvtepGlobalRef(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalRef) ArrayList(java.util.ArrayList) IpAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress) HwvtepNodeName(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName) NodeBuilder(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)

Example 2 with HwvtepGlobalRef

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalRef in project netvirt by opendaylight.

the class NodeConnectedHandler method mergeOpManagedByAttributes.

/**
 * Merge data to Physical switch from HA node path .
 *
 * @param psAugmentation  Physical Switch Augmation of Node
 * @param builder Physical Switch Augmentation Builder
 * @param haNodePath HA node Path
 */
public void mergeOpManagedByAttributes(PhysicalSwitchAugmentation psAugmentation, PhysicalSwitchAugmentationBuilder builder, InstanceIdentifier<Node> haNodePath) {
    builder.setManagedBy(new HwvtepGlobalRef(haNodePath));
    builder.setHwvtepNodeName(psAugmentation.getHwvtepNodeName());
    builder.setHwvtepNodeDescription(psAugmentation.getHwvtepNodeDescription());
    builder.setTunnelIps(psAugmentation.getTunnelIps());
    builder.setPhysicalSwitchUuid(HwvtepHAUtil.getUUid(psAugmentation.getHwvtepNodeName().getValue()));
}
Also used : HwvtepGlobalRef(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalRef)

Example 3 with HwvtepGlobalRef

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalRef in project netvirt by opendaylight.

the class NodeCopier method mergeOpManagedByAttributes.

public void mergeOpManagedByAttributes(PhysicalSwitchAugmentation psAugmentation, PhysicalSwitchAugmentationBuilder builder, InstanceIdentifier<Node> haNodePath) {
    builder.setManagedBy(new HwvtepGlobalRef(haNodePath));
    if (psAugmentation != null) {
        builder.setHwvtepNodeName(psAugmentation.getHwvtepNodeName());
        builder.setHwvtepNodeDescription(psAugmentation.getHwvtepNodeDescription());
        builder.setTunnelIps(psAugmentation.getTunnelIps());
        if (psAugmentation.getHwvtepNodeName() != null) {
            builder.setPhysicalSwitchUuid(HwvtepHAUtil.getUUid(psAugmentation.getHwvtepNodeName().getValue()));
        }
    }
}
Also used : HwvtepGlobalRef(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalRef)

Example 4 with HwvtepGlobalRef

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalRef in project netvirt by opendaylight.

the class TestComparators method comparePhysicalSwitches.

public static void comparePhysicalSwitches(Node d1ps, Node haps, InstanceIdentifier<Node> d1psnodePath, InstanceIdentifier<Node> haPsnodePath, ReadWriteTransaction readWriteTransaction, String switchName, Node d1, Node ha) throws ReadFailedException {
    // Compare Physical Augmentation data
    PhysicalSwitchAugmentation d1PsAug = d1ps.getAugmentation(PhysicalSwitchAugmentation.class);
    PhysicalSwitchAugmentation haPsAug = haps.getAugmentation(PhysicalSwitchAugmentation.class);
    HwvtepGlobalRef managerd1Ps = d1PsAug.getManagedBy();
    assertEquals("Hwvtep node name should be same", d1PsAug.getHwvtepNodeName().getValue(), haPsAug.getHwvtepNodeName().getValue());
    assertEquals("Managers should be equal  for d1 ", d1ps.getNodeId().getValue(), managerd1Ps.getValue().firstKeyOf(Node.class).getNodeId().getValue() + "/physicalswitch/" + switchName);
    HwvtepGlobalRef managerhaPs = haPsAug.getManagedBy();
    assertEquals("Managers should be equal for ha ", haps.getNodeId().getValue(), managerhaPs.getValue().firstKeyOf(Node.class).getNodeId().getValue() + "/physicalswitch/" + switchName);
    assertEquals("Should have equal number TunnelIps", d1PsAug.getTunnelIps().size(), haPsAug.getTunnelIps().size());
    if (d1PsAug.getTunnelIps().size() == haPsAug.getTunnelIps().size()) {
        assertTrue(d1PsAug.getTunnelIps().containsAll(haPsAug.getTunnelIps()));
    }
    // Compare Termination point
    assertTerminationPoint(DataProvider.getPortNameListD1(), d1psnodePath, haPsnodePath, readWriteTransaction, d1, ha);
}
Also used : Node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node) PhysicalSwitchAugmentation(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentation) HwvtepGlobalRef(org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalRef)

Aggregations

HwvtepGlobalRef (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalRef)4 ArrayList (java.util.ArrayList)1 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)1 HwvtepNodeName (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName)1 PhysicalSwitchAugmentation (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentation)1 PhysicalSwitchAugmentationBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentationBuilder)1 TunnelIps (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelIps)1 TunnelIpsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelIpsBuilder)1 TunnelIpsKey (org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelIpsKey)1 Node (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node)1 NodeBuilder (org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeBuilder)1