Update portmapping YANG model
[transportpce.git] / renderer / src / main / java / org / opendaylight / transportpce / renderer / openroadminterface / OpenRoadmOtnInterface221.java
index 997a76c0945e456ecb12c33385bc8807c4bc9ea5..6f06784626e5ea9d7dd8841339b1b3150233acbc 100644 (file)
@@ -10,20 +10,18 @@ package org.opendaylight.transportpce.renderer.openroadminterface;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.IntStream;
-
 import org.opendaylight.transportpce.common.mapping.PortMapping;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaces;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev200128.network.nodes.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210315.mapping.Mapping;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.interfaces.grp.InterfaceBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev181019.interfaces.grp.InterfaceKey;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev171215.AdminStates;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev181019.Interface1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev181019.Interface1Builder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.ethernet.interfaces.rev181019.ethernet.container.EthernetBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.EthernetCsmacd;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.InterfaceType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OtnOdu;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.EthernetCsmacd;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.InterfaceType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.OtnOdu;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev171215.ODU0;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev171215.ODU2;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev171215.ODU2e;
@@ -34,6 +32,8 @@ import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.odu.container.OduBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.opu.OpuBuilder;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.parent.odu.allocation.ParentOduAllocationBuilder;
+import org.opendaylight.yangtools.yang.common.Uint16;
+import org.opendaylight.yangtools.yang.common.Uint32;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -42,98 +42,96 @@ public class OpenRoadmOtnInterface221 {
 
     private final PortMapping portMapping;
     private final OpenRoadmInterfaces openRoadmInterfaces;
-    private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmOtnInterface221.class);
+    private static final Logger LOG = LoggerFactory
+            .getLogger(OpenRoadmOtnInterface221.class);
 
-    public  OpenRoadmOtnInterface221(PortMapping portMapping, OpenRoadmInterfaces openRoadmInterfaces) {
+    public OpenRoadmOtnInterface221(PortMapping portMapping,
+            OpenRoadmInterfaces openRoadmInterfaces) {
         this.portMapping = portMapping;
         this.openRoadmInterfaces = openRoadmInterfaces;
     }
 
-    public String createOpenRoadmEth1GInterface(String nodeId, String logicalConnPoint)
-            throws OpenRoadmInterfaceException {
+    public String createOpenRoadmEth1GInterface(String nodeId,
+            String logicalConnPoint) throws OpenRoadmInterfaceException {
         Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
         if (portMap == null) {
-            throw new OpenRoadmInterfaceException(String.format(
-                "Unable to get mapping from PortMapping for node % and logical connection port %s",
-                nodeId, logicalConnPoint));
+            throwException(nodeId, logicalConnPoint);
         }
 
         // Ethernet interface specific data
-        EthernetBuilder ethIfBuilder = new EthernetBuilder();
-        //ethIfBuilder.setAutoNegotiation(EthAttributes.AutoNegotiation.Disabled);
-        ethIfBuilder.setSpeed(1000L);
-        InterfaceBuilder ethInterfaceBldr =
-            createGenericInterfaceBuilder(portMap, EthernetCsmacd.class, logicalConnPoint + "-ETHERNET1G");
+        EthernetBuilder ethIfBuilder = new EthernetBuilder()
+                .setSpeed(Uint32.valueOf(1000));
+        InterfaceBuilder ethInterfaceBldr = createGenericInterfaceBuilder(
+                portMap, EthernetCsmacd.class,
+                logicalConnPoint + "-ETHERNET1G");
         // Create Interface1 type object required for adding as augmentation
-        Interface1Builder ethIf1Builder = new  Interface1Builder();
-        ethInterfaceBldr.addAugmentation(Interface1.class, ethIf1Builder.setEthernet(ethIfBuilder.build()).build());
+        Interface1Builder ethIf1Builder = new Interface1Builder();
+        ethInterfaceBldr.addAugmentation(ethIf1Builder.setEthernet(ethIfBuilder.build()).build());
         // Post interface on the device
         this.openRoadmInterfaces.postOTNInterface(nodeId, ethInterfaceBldr);
         // Post the equipment-state change on the device circuit-pack
-        this.openRoadmInterfaces.postOTNEquipmentState(nodeId, portMap.getSupportingCircuitPackName(), true);
-        this.portMapping.updateMapping(nodeId,portMap);
+        this.openRoadmInterfaces.postOTNEquipmentState(nodeId,
+                portMap.getSupportingCircuitPackName(), true);
+        this.portMapping.updateMapping(nodeId, portMap);
         String ethernetInterfaceName = ethInterfaceBldr.getName();
 
         return ethernetInterfaceName;
     }
 
+    private void throwException(String nodeId, String logicalConnPoint)
+            throws OpenRoadmInterfaceException {
+        throw new OpenRoadmInterfaceException(String.format(
+                "Unable to get mapping from PortMapping for node % and logical connection port %s",
+                nodeId, logicalConnPoint));
+    }
+
     private InterfaceBuilder createGenericInterfaceBuilder(Mapping portMap,
             Class<? extends InterfaceType> type, String key) {
-        InterfaceBuilder interfaceBuilder = new InterfaceBuilder()
-            //.setDescription("  TBD   ")
-            //.setCircuitId("   TBD    ")
-            .setSupportingCircuitPackName(portMap.getSupportingCircuitPackName())
-            .setSupportingPort(portMap.getSupportingPort())
-            .setAdministrativeState(AdminStates.InService)
-            //TODO get rid of unchecked cast warning
-            .setType(
-                (Class<? extends org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev170626.InterfaceType>)
-                type
-            )
-            .setName(key)
-            .withKey(new InterfaceKey(key));
-        return interfaceBuilder;
+        return new InterfaceBuilder()
+                // .setDescription(" TBD ")
+                // .setCircuitId(" TBD ")
+                .setSupportingCircuitPackName(
+                        portMap.getSupportingCircuitPackName())
+                .setSupportingPort(portMap.getSupportingPort())
+                .setAdministrativeState(AdminStates.InService)
+                // TODO get rid of unchecked cast warning
+                .setType(type).setName(key).withKey(new InterfaceKey(key));
     }
 
-    public String createOpenRoadmEth10GInterface(String nodeId, String logicalConnPoint)
-            throws OpenRoadmInterfaceException {
+    public String createOpenRoadmEth10GInterface(String nodeId,
+            String logicalConnPoint) throws OpenRoadmInterfaceException {
         Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
         if (portMap == null) {
-            throw new OpenRoadmInterfaceException(
-                String.format(
-                    "Unable to get mapping from PortMapping for node % and logical connection port %s",
-                    nodeId, logicalConnPoint));
+            throwException(nodeId, logicalConnPoint);
         }
 
         // Ethernet interface specific data
         EthernetBuilder ethIfBuilder = new EthernetBuilder()
-            //.setAutoNegotiation(EthAttributes.AutoNegotiation.Disabled)
-            .setSpeed(10000L);
+                // .setAutoNegotiation(EthAttributes.AutoNegotiation.Disabled)
+                .setSpeed(Uint32.valueOf(10000));
         // Create Interface1 type object required for adding as augmentation
-        Interface1Builder ethIf1Builder = new  Interface1Builder();
-        InterfaceBuilder ethInterfaceBldr =
-            createGenericInterfaceBuilder(portMap, EthernetCsmacd.class, logicalConnPoint + "-ETHERNET10G")
-            .addAugmentation(Interface1.class, ethIf1Builder.setEthernet(ethIfBuilder.build()).build());
+        Interface1Builder ethIf1Builder = new Interface1Builder();
+        InterfaceBuilder ethInterfaceBldr = createGenericInterfaceBuilder(portMap, EthernetCsmacd.class,
+                logicalConnPoint + "-ETHERNET10G").addAugmentation(ethIf1Builder.setEthernet(ethIfBuilder.build())
+                        .build());
         // Post interface on the device
         this.openRoadmInterfaces.postOTNInterface(nodeId, ethInterfaceBldr);
         // Post the equipment-state change on the device circuit-pack
-        this.openRoadmInterfaces.postOTNEquipmentState(nodeId, portMap.getSupportingCircuitPackName(), true);
-        this.portMapping.updateMapping(nodeId,portMap);
+        this.openRoadmInterfaces.postOTNEquipmentState(nodeId,
+                portMap.getSupportingCircuitPackName(), true);
+        this.portMapping.updateMapping(nodeId, portMap);
         String ethernetInterfaceName = ethInterfaceBldr.getName();
 
         return ethernetInterfaceName;
     }
 
-
-    public String createOpenRoadmOdu2eInterface(
-            String nodeId, String logicalConnPoint, String serviceName,
-            String payLoad, boolean isNetworkPort, int tribPortNumber, int tribSlotIndex)
+    public String createOpenRoadmOdu2eInterface(String nodeId,
+            String logicalConnPoint, String serviceName, String payLoad,
+            boolean isNetworkPort, int tribPortNumber, int tribSlotIndex)
             throws OpenRoadmInterfaceException {
         Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
         if (portMap == null) {
-            throw new OpenRoadmInterfaceException(String.format(
-                "Unable to get mapping from PortMapping for node % and logical connection port %s",
-                nodeId, logicalConnPoint));
+            throwException(nodeId, logicalConnPoint);
         }
         String supportingInterface = null;
 
@@ -145,34 +143,34 @@ public class OpenRoadmOtnInterface221 {
 
         if (supportingInterface == null) {
             throw new OpenRoadmInterfaceException(
-                "Interface Creation failed because of missing supported ODU4 on network end or Eth iface on client");
+                    "Interface Creation failed because of missing supported "
+                    + "ODU4 on network end or Ethernet on client");
         }
 
-        InterfaceBuilder oduInterfaceBldr =
-            createGenericInterfaceBuilder(portMap, OtnOdu.class, logicalConnPoint + "-ODU2e-" + serviceName)
-                .setSupportingInterface(supportingInterface);
+        InterfaceBuilder oduInterfaceBldr = createGenericInterfaceBuilder(
+                portMap, OtnOdu.class,
+                logicalConnPoint + "-ODU2e-" + serviceName)
+                        .setSupportingInterface(supportingInterface);
 
         // ODU interface specific data
-        OduBuilder oduIfBuilder = new OduBuilder()
-            .setRate(ODU2e.class)
-            .setOduFunction(ODUTTPCTP.class)
-            .setMonitoringMode(OduAttributes.MonitoringMode.Terminated);
-        LOG.debug("Inside the ODU2e creation {} {} {}",isNetworkPort,tribPortNumber,tribSlotIndex);
+        OduBuilder oduIfBuilder = new OduBuilder().setRate(ODU2e.class)
+                .setOduFunction(ODUTTPCTP.class)
+                .setMonitoringMode(OduAttributes.MonitoringMode.Terminated);
+        LOG.debug("Inside the ODU2e creation {} {} {}", isNetworkPort,
+                tribPortNumber, tribSlotIndex);
         if (isNetworkPort) {
-            List<Integer> tribSlots = new ArrayList<>();
-            int newIdx = tribSlotIndex;
+            List<Uint16> tribSlots = new ArrayList<>();
+            Uint16 newIdx = Uint16.valueOf(tribSlotIndex);
             tribSlots.add(newIdx);
-            IntStream.range(tribSlotIndex, tribSlotIndex + 8).forEach(
-                nbr -> tribSlots.add(nbr)
-            );
+            IntStream.range(tribSlotIndex, tribSlotIndex + 8)
+                    .forEach(nbr -> tribSlots.add(Uint16.valueOf(nbr)));
             ParentOduAllocationBuilder parentOduAllocationBuilder = new ParentOduAllocationBuilder()
-                .setTribPortNumber(tribPortNumber)
-                .setTribSlots(tribSlots);
+                    .setTribPortNumber(Uint16.valueOf(tribPortNumber))
+                    .setTribSlots(tribSlots);
             oduIfBuilder.setOduFunction(ODUCTP.class)
                     .setMonitoringMode(OduAttributes.MonitoringMode.Monitored)
                     .setParentOduAllocation(parentOduAllocationBuilder.build());
-        }
-        else {
+        } else {
             // Set Opu attributes
             OpuBuilder opuBldr = new OpuBuilder()
                     .setPayloadType(new PayloadTypeDef(payLoad))
@@ -181,11 +179,10 @@ public class OpenRoadmOtnInterface221 {
         }
         // Create Interface1 type object required for adding as augmentation
         // TODO look at imports of different versions of class
-        org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder oduIf1Builder =
-                new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder();
-        oduInterfaceBldr.addAugmentation(
-                org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1.class,
-                oduIf1Builder.setOdu(oduIfBuilder.build()).build());
+        org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder
+            oduIf1Builder = new
+                org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder();
+        oduInterfaceBldr.addAugmentation(oduIf1Builder.setOdu(oduIfBuilder.build()).build());
 
         // Post interface on the device
         this.openRoadmInterfaces.postOTNInterface(nodeId, oduInterfaceBldr);
@@ -193,8 +190,9 @@ public class OpenRoadmOtnInterface221 {
         return oduInterfaceBldr.getName();
     }
 
-    public String createOpenRoadmOdu0Interface(String nodeId, String logicalConnPoint,
-            String serviceName, String payLoad, boolean isNetworkPort, int tribPortNumber, int tribSlot)
+    public String createOpenRoadmOdu0Interface(String nodeId,
+            String logicalConnPoint, String serviceName, String payLoad,
+            boolean isNetworkPort, int tribPortNumber, int tribSlot)
             throws OpenRoadmInterfaceException {
         Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
         String supportingInterface = null;
@@ -205,26 +203,25 @@ public class OpenRoadmOtnInterface221 {
             supportingInterface = logicalConnPoint + "-ETHERNET1G";
         }
         if (portMap == null) {
-            throw new OpenRoadmInterfaceException(String.format(
-                "Unable to get mapping from PortMapping for node % and logical connection port %s",
-                nodeId, logicalConnPoint));
+            throwException(nodeId, logicalConnPoint);
         }
-        InterfaceBuilder oduInterfaceBldr =
-            createGenericInterfaceBuilder(portMap, OtnOdu.class, logicalConnPoint + "-ODU0-" + serviceName);
+        InterfaceBuilder oduInterfaceBldr = createGenericInterfaceBuilder(
+                portMap, OtnOdu.class,
+                logicalConnPoint + "-ODU0-" + serviceName);
         oduInterfaceBldr.setSupportingInterface(supportingInterface);
 
         // ODU interface specific data
-        OduBuilder oduIfBuilder = new OduBuilder()
-            .setRate(ODU0.class)
-            .setOduFunction(ODUTTPCTP.class)
-            .setMonitoringMode(OduAttributes.MonitoringMode.Terminated);
+        OduBuilder oduIfBuilder = new OduBuilder().setRate(ODU0.class)
+                .setOduFunction(ODUTTPCTP.class)
+                .setMonitoringMode(OduAttributes.MonitoringMode.Terminated);
         if (isNetworkPort) {
             LOG.debug("Network port is true");
-            List<Integer> tribSlots = new ArrayList<>();
-            tribSlots.add(tribSlot); //add trib slots
+            List<Uint16> tribSlots = new ArrayList<>();
+            // add trib slots
+            tribSlots.add(Uint16.valueOf(tribSlot));
             ParentOduAllocationBuilder parentOduAllocationBuilder = new ParentOduAllocationBuilder()
-                    //set trib port numbers
-                    .setTribPortNumber(tribPortNumber)
+                    // set trib port numbers
+                    .setTribPortNumber(Uint16.valueOf(tribPortNumber))
                     .setTribSlots(tribSlots);
             oduIfBuilder.setOduFunction(ODUCTP.class)
                     .setMonitoringMode(OduAttributes.MonitoringMode.Monitored)
@@ -233,8 +230,7 @@ public class OpenRoadmOtnInterface221 {
                     oduIfBuilder.getParentOduAllocation().getTribSlots(),
                     oduIfBuilder.getRate(),
                     oduIfBuilder.getParentOduAllocation().getTribPortNumber());
-        }
-        else {
+        } else {
             LOG.debug("Current port is a client port");
             OpuBuilder opuBldr = new OpuBuilder()
                     .setPayloadType(new PayloadTypeDef(payLoad))
@@ -243,11 +239,10 @@ public class OpenRoadmOtnInterface221 {
         }
         // Create Interface1 type object required for adding as augmentation
         // TODO look at imports of different versions of class
-        org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder oduIf1Builder =
-                new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder();
-        oduInterfaceBldr.addAugmentation(
-                org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1.class,
-                oduIf1Builder.setOdu(oduIfBuilder.build()).build());
+        org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder
+            oduIf1Builder = new
+            org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder();
+        oduInterfaceBldr.addAugmentation(oduIf1Builder.setOdu(oduIfBuilder.build()).build());
 
         // Post interface on the device
         this.openRoadmInterfaces.postOTNInterface(nodeId, oduInterfaceBldr);
@@ -255,46 +250,42 @@ public class OpenRoadmOtnInterface221 {
         return oduInterfaceBldr.getName();
     }
 
-
-    public String createOpenRoadmOdu2Interface(
-            String nodeId, String logicalConnPoint, String serviceName,
-            String payLoad, boolean isNetworkPort, int tribPortNumber, int tribSlotIndex)
+    public String createOpenRoadmOdu2Interface(String nodeId,
+            String logicalConnPoint, String serviceName, String payLoad,
+            boolean isNetworkPort, int tribPortNumber, int tribSlotIndex)
             throws OpenRoadmInterfaceException {
         Mapping portMap = this.portMapping.getMapping(nodeId, logicalConnPoint);
         String supportingInterface = null;
 
-        if (isNetworkPort) {
-            supportingInterface = portMap.getSupportingOdu4();
+        if (portMap != null) {
+            if (isNetworkPort) {
+                supportingInterface = portMap.getSupportingOdu4();
+            } else {
+                supportingInterface = portMap.getSupportingEthernet();
+            }
         } else {
-            supportingInterface = portMap.getSupportingEthernet();
+            throwException(nodeId, logicalConnPoint);
         }
-        if (portMap == null) {
-            throw new OpenRoadmInterfaceException(
-                String.format("Unable to get mapping from PortMapping for node % and logical connection port %s",
-                        nodeId, logicalConnPoint));
-        }
-        InterfaceBuilder oduInterfaceBldr =
-            createGenericInterfaceBuilder(portMap, OtnOdu.class, logicalConnPoint + "-ODU2-" + serviceName)
-                .setSupportingInterface(supportingInterface);
+        InterfaceBuilder oduInterfaceBldr = createGenericInterfaceBuilder(
+                portMap, OtnOdu.class,
+                logicalConnPoint + "-ODU2-" + serviceName)
+                        .setSupportingInterface(supportingInterface);
 
-        OduBuilder oduIfBuilder = new OduBuilder()
-            .setRate(ODU2.class)
-            .setOduFunction(ODUTTPCTP.class)
-            .setMonitoringMode(OduAttributes.MonitoringMode.Terminated);
+        OduBuilder oduIfBuilder = new OduBuilder().setRate(ODU2.class)
+                .setOduFunction(ODUTTPCTP.class)
+                .setMonitoringMode(OduAttributes.MonitoringMode.Terminated);
         if (isNetworkPort) {
-            List<Integer> tribSlots = new ArrayList<>();
-            IntStream.range(tribSlotIndex, tribSlotIndex + 8).forEach(
-                nbr -> tribSlots.add(nbr)
-            );
+            List<Uint16> tribSlots = new ArrayList<>();
+            IntStream.range(tribSlotIndex, tribSlotIndex + 8)
+                    .forEach(nbr -> tribSlots.add(Uint16.valueOf(nbr)));
             ParentOduAllocationBuilder parentOduAllocationBuilder = new ParentOduAllocationBuilder()
-                    //set trib port numbers
-                    .setTribPortNumber(tribPortNumber)
+                    // set trib port numbers
+                    .setTribPortNumber(Uint16.valueOf(tribPortNumber))
                     .setTribSlots(tribSlots);
             oduIfBuilder.setOduFunction(ODUCTP.class)
                     .setMonitoringMode(OduAttributes.MonitoringMode.Monitored)
                     .setParentOduAllocation(parentOduAllocationBuilder.build());
-        }
-        else {
+        } else {
             // Set Opu attributes
             OpuBuilder opuBldr = new OpuBuilder()
                     .setPayloadType(new PayloadTypeDef(payLoad))
@@ -306,11 +297,10 @@ public class OpenRoadmOtnInterface221 {
         // TODO look at imports of different versions of class
         // Create Interface1 type object required for adding as augmentation
         // TODO look at imports of different versions of class
-        org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder oduIf1Builder =
-                new org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder();
-        oduInterfaceBldr.addAugmentation(
-                org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1.class,
-                oduIf1Builder.setOdu(oduIfBuilder.build()).build());
+        org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder
+            oduIf1Builder = new
+                org.opendaylight.yang.gen.v1.http.org.openroadm.otn.odu.interfaces.rev181019.Interface1Builder();
+        oduInterfaceBldr.addAugmentation(oduIf1Builder.setOdu(oduIfBuilder.build()).build());
 
         // Post interface on the device
         this.openRoadmInterfaces.postOTNInterface(nodeId, oduInterfaceBldr);