[ONOS-4879][ONOS-5024][ONOS-5025]TE Topology NBI

The APP introduces IETF TE Topology YANG models as RESTCONF NBI,
and it works as an adapter for data conversion between
YMS(YANG generated JAVA classes) and TE Topology Core subsystem.

The APP implements the following interfaces:
IetfNetworkService Interface
IetfTopologyService Interface
IetfNetworkTopologyService Interface

Change-Id: I761ff684bde4b64ca42bb1b0d5b1ddfb8a2377fd
diff --git a/apps/pom.xml b/apps/pom.xml
index c1175e3..ee70c83 100644
--- a/apps/pom.xml
+++ b/apps/pom.xml
@@ -79,6 +79,7 @@
         <module>tetopology</module>
         <module>rabbitmq</module>
         <module>learning-switch</module>
+        <module>tenbi</module>
     </modules>
 
 
diff --git a/apps/tenbi/pom.xml b/apps/tenbi/pom.xml
new file mode 100644
index 0000000..0f59a82
--- /dev/null
+++ b/apps/tenbi/pom.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016-present Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-apps</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-app-tenbi</artifactId>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>topology</module>
+        <module>yangmodel</module>
+        <module>utils</module>
+    </modules>
+
+    <description>TE YANG NBI Application</description>
+</project>
+
diff --git a/apps/tenbi/topology/app.xml b/apps/tenbi/topology/app.xml
new file mode 100644
index 0000000..3e18f2d
--- /dev/null
+++ b/apps/tenbi/topology/app.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2015 Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<app name="org.onosproject.tenbi.topology" origin="HUAWEI" version="${project.version}"
+     featuresRepo="mvn:${project.groupId}/${project.artifactId}/${project.version}/xml/features"
+     features="${project.artifactId}">
+    <description>${project.description}</description>
+    <artifact>mvn:${project.groupId}/${project.artifactId}/${project.version}</artifact>
+    <artifact>mvn:${project.groupId}/onos-app-tenbi-yangmodel/${project.version}</artifact>
+</app>
+
diff --git a/apps/tenbi/topology/features.xml b/apps/tenbi/topology/features.xml
new file mode 100644
index 0000000..0915481
--- /dev/null
+++ b/apps/tenbi/topology/features.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  ~ Copyright 2015 Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="${project.artifactId}-${project.version}">
+    <repository>mvn:${project.groupId}/onos-app-tenbi-yangmodel/${project.version}/xml/features</repository>
+    <feature name="${project.artifactId}" version="${project.version}" description="${project.description}">
+        <feature>onos-api</feature>
+        <feature>onos-app-tenbi-yangmodel</feature>
+        <bundle>mvn:${project.groupId}/${project.artifactId}/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/onos-app-tetopology/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/onos-app-yms-api/${project.version}</bundle>
+        <bundle>mvn:${project.groupId}/onos-app-tenbi-utils/${project.version}</bundle>
+    </feature>
+</features>
diff --git a/apps/tenbi/topology/pom.xml b/apps/tenbi/topology/pom.xml
new file mode 100644
index 0000000..6fc1cb2
--- /dev/null
+++ b/apps/tenbi/topology/pom.xml
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-app-tenbi</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-app-tenbi-topology</artifactId>
+    <packaging>bundle</packaging>
+
+    <description>IETF TE Topology NBI</description>
+
+    <properties>
+        <onos.app.name>tenbi.topology</onos.app.name>
+        <onos.app.origin>HUAWEI</onos.app.origin>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-app-tenbi-yangmodel</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+         <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-app-tenbi-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onlab-junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+         <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-app-tetopology</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-app-yms-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+</project>
diff --git a/apps/tenbi/topology/src/main/java/org/onosproject/tenbi/topology/impl/TeTopologyNbiManager.java b/apps/tenbi/topology/src/main/java/org/onosproject/tenbi/topology/impl/TeTopologyNbiManager.java
new file mode 100644
index 0000000..799f4ed
--- /dev/null
+++ b/apps/tenbi/topology/src/main/java/org/onosproject/tenbi/topology/impl/TeTopologyNbiManager.java
@@ -0,0 +1,162 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.tenbi.topology.impl;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import org.apache.felix.scr.annotations.Activate;
+import org.apache.felix.scr.annotations.Component;
+import org.apache.felix.scr.annotations.Deactivate;
+import org.apache.felix.scr.annotations.Reference;
+import org.apache.felix.scr.annotations.ReferenceCardinality;
+import org.apache.felix.scr.annotations.Service;
+import org.onosproject.event.AbstractListenerManager;
+import org.onosproject.tetopology.management.api.TeTopologyService;
+import org.onosproject.teyang.api.OperationType;
+import org.onosproject.teyang.utils.topology.NetworkConverter;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.IetfNetwork;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.IetfNetworkOpParam;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.IetfNetworkService;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.Networks;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.NetworksState;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208.IetfNetworkTopology;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .IetfNetworkTopologyOpParam;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .IetfNetworkTopologyService;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.IetfTeTopology;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.IetfTeTopologyOpParam;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .IetfTeTopologyService;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.IetfTeTopologyEvent;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.IetfTeTopologyEventListener;
+import org.onosproject.yms.ymsm.YmsService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The IETF TE Topology NBI Manager implementation.
+ */
+@Component(immediate = true)
+@Service
+public class TeTopologyNbiManager
+    extends  AbstractListenerManager<IetfTeTopologyEvent, IetfTeTopologyEventListener>
+    implements IetfNetworkService, IetfNetworkTopologyService, IetfTeTopologyService {
+
+    private final Logger log = LoggerFactory.getLogger(getClass());
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected TeTopologyService teTopologyService;
+
+    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
+    protected YmsService ymsService;
+
+    @Activate
+    protected void activate() {
+        // Register 3 services with YMS.
+        ymsService.registerService(this, IetfNetworkService.class, null);
+        ymsService.registerService(this, IetfNetworkTopologyService.class, null);
+        ymsService.registerService(this, IetfTeTopologyService.class, null);
+
+        log.info("Started");
+    }
+
+    @Deactivate
+    protected void deactivate() {
+        // Unregister 3 services.
+        ymsService.unRegisterService(this, IetfNetworkService.class);
+        ymsService.unRegisterService(this, IetfNetworkTopologyService.class);
+        ymsService.unRegisterService(this, IetfTeTopologyService.class);
+
+        log.info("Stopped");
+    }
+
+    @Override
+    public IetfNetwork getIetfNetwork(IetfNetworkOpParam ietfNetwork) {
+        log.info("getIetfNetwork: input {}", ietfNetwork);
+
+        checkNotNull(ietfNetwork, "getIetfNetwork: ietfNetwork cannot be null");
+
+        // Get the entire data tree from TE Subsystem core.
+        org.onosproject.tetopology.management.api.Networks teNetworks = teTopologyService.getNetworks();
+
+        // Convert the TE Subsystem core data into YANG Objects.
+        Networks networks = NetworkConverter.teSubsystem2YangNetworks(teNetworks, OperationType.QUERY);
+        NetworksState networkStates = NetworkConverter.teSubsystem2YangNetworkStates(teNetworks, OperationType.QUERY);
+
+        IetfNetworkOpParam.IetfNetworkBuilder builder =  new IetfNetworkOpParam.IetfNetworkBuilder();
+        IetfNetwork newNetwork = builder.networks(networks)
+                                        .networksState(networkStates)
+                                        .onosYangNodeOperationType(IetfNetworkOpParam.OnosYangNodeOperationType.NONE)
+                                        .build();
+
+        // processSubtreeFiltering() filters the entire data tree based on the
+        // user's query and returns the filtered data.
+        return ietfNetwork.processSubtreeFiltering(newNetwork, false);
+    }
+
+    @Override
+    public void setIetfNetwork(IetfNetworkOpParam ietfNetwork) {
+        // In H release, topology is discovered from south, no NBI Set is supported.
+    }
+
+    @Override
+    public IetfTeTopology getIetfTeTopology(IetfTeTopologyOpParam ietfTeTopology) {
+        // unused method.
+        return ietfTeTopology;
+    }
+
+    @Override
+    public void setIetfTeTopology(IetfTeTopologyOpParam ietfTeTopology) {
+        // unused methods.
+    }
+
+    @Override
+    public IetfTeTopology getAugmentedIetfTeTopologyTeLinkEvent(IetfTeTopologyOpParam ietfTeTopology) {
+        // unused methods.
+        return ietfTeTopology;
+    }
+
+    @Override
+    public void setAugmentedIetfTeTopologyTeLinkEvent(IetfTeTopologyOpParam augmentedIetfTeTopologyTeLinkEvent) {
+        // unused methods.
+    }
+
+    @Override
+    public IetfNetworkTopology getIetfNetworkTopology(IetfNetworkTopologyOpParam ietfNetworkTopology) {
+        // unused methods.
+       return ietfNetworkTopology;
+    }
+
+    @Override
+    public void setIetfNetworkTopology(IetfNetworkTopologyOpParam ietfNetworkTopology) {
+        // unused methods.
+    }
+
+    @Override
+    public IetfNetwork getAugmentedIetfNetworkNetworks(IetfNetworkOpParam ietfNetwork) {
+        // unused methods.
+        return ietfNetwork;
+    }
+
+    @Override
+    public void setAugmentedIetfNetworkNetworks(IetfNetworkOpParam augmentedIetfNetworkNetworks) {
+        // unused methods.
+    }
+
+}
diff --git a/apps/tenbi/topology/src/main/java/org/onosproject/tenbi/topology/impl/package-info.java b/apps/tenbi/topology/src/main/java/org/onosproject/tenbi/topology/impl/package-info.java
new file mode 100644
index 0000000..7b4ad9c
--- /dev/null
+++ b/apps/tenbi/topology/src/main/java/org/onosproject/tenbi/topology/impl/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * The implementations of IETF TE Topology YANG NBI.
+ */
+package org.onosproject.tenbi.topology.impl;
diff --git a/apps/tenbi/utils/pom.xml b/apps/tenbi/utils/pom.xml
new file mode 100644
index 0000000..6e60759
--- /dev/null
+++ b/apps/tenbi/utils/pom.xml
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-app-tenbi</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-app-tenbi-utils</artifactId>
+    <packaging>bundle</packaging>
+
+    <description>IETF TE NBI Utilities</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-app-tenbi-yangmodel</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onlab-junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-app-tetopology</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+     </dependencies>
+
+</project>
diff --git a/apps/tenbi/utils/src/main/java/org/onosproject/teyang/api/OperationType.java b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/api/OperationType.java
new file mode 100644
index 0000000..c7d4a48
--- /dev/null
+++ b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/api/OperationType.java
@@ -0,0 +1,99 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.teyang.api;
+
+/**
+ * The operation type.
+ */
+public enum OperationType {
+
+    /**
+     * The configuration data identified by the element
+     * containing this attribute is merged with the configuration
+     * at the corresponding level in the configuration datastore.
+     */
+    MERGE,
+
+    /**
+     * The configuration data identified by the element
+     * containing this attribute replaces any related configuration
+     * in the configuration datastore. If no such configuration
+     * data exists in the configuration datastore, it is created.
+     */
+    REPLACE,
+
+    /**
+     * The configuration data identified by the element
+     * containing this attribute is added to the configuration if
+     * and only if the configuration data does not already exist in
+     * the configuration datastore.  If the configuration data
+     * exists, an error is returned.
+     */
+    CREATE,
+
+    /**
+     * The configuration data identified by the element
+     * containing this attribute is deleted from the configuration
+     * if and only if the configuration data currently exists in
+     * the configuration datastore.  If the configuration data does
+     * not exist, an error is returned".
+     */
+    DELETE,
+
+    /**
+     * The configuration data identified by the element
+     * containing this attribute is deleted from the configuration
+     * if the configuration data currently exists in the
+     * configuration datastore.  If the configuration data does not
+     * exist, the "remove" operation is silently ignored by the
+     * server.
+     */
+    REMOVE,
+
+    /**
+     * The node is used as a containment node to reach the child node,
+     * There is no change in the data store for the values of this node in the
+     * edit request.
+     */
+    NONE,
+
+//    /**
+//     * The YANG based request is to edit a config node / subtree in the data
+//     * store.
+//     */
+//    EDIT_CONFIG,
+//
+//    /**
+//     * The YANG based request is to query a config node / subtree in the data
+//     * store.
+//     */
+//    QUERY_CONFIG,
+//
+    /**
+     * The YANG based request is to query a node / subtree in the data store.
+     */
+    QUERY,
+
+//    /**
+//     * The YANG based request is to execute an RPC defined in YANG.
+//     */
+//    RPC,
+//
+//    /**
+//     * The YANG based request is to execute an RPC defined in YANG.
+//     */
+//    NOTIFICATION
+}
diff --git a/apps/tenbi/utils/src/main/java/org/onosproject/teyang/api/package-info.java b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/api/package-info.java
new file mode 100644
index 0000000..882d04d
--- /dev/null
+++ b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/api/package-info.java
@@ -0,0 +1,19 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * The utility APIs.
+ */
+package org.onosproject.teyang.api;
diff --git a/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/EnumConverter.java b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/EnumConverter.java
new file mode 100644
index 0000000..49b69a6
--- /dev/null
+++ b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/EnumConverter.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.teyang.utils.topology;
+
+import org.onosproject.tetopology.management.api.node.TeStatus;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.TeAdminStatus;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.TeOperStatus;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.teadminstatus.TeAdminStatusEnum;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.teoperstatus.TeOperStatusEnum;
+
+/**
+ * The Enum conversion functions.
+ */
+public final class EnumConverter {
+
+    // no instantiation
+    private EnumConverter() {
+    }
+
+    /**
+     * Converts YANG Operation Status Enum to TE Topology TeStatus Enum.
+     *
+     * @param opStatus YANG Operation Status
+     * @return the equivalent Enum from TE Topology TeStatus or null if not
+     *         found
+     */
+    public static TeStatus yang2TeSubsystemOpStatus(TeOperStatus opStatus) {
+        switch (opStatus.enumeration()) {
+        case DOWN:
+            return TeStatus.DOWN;
+        case UP:
+            return TeStatus.UP;
+        case MAINTENANCE:
+            return TeStatus.MAINTENANCE;
+        case PREPARING_MAINTENANCE:
+            return TeStatus.PREPARING_MAINTENANCE;
+        case TESTING:
+            return TeStatus.TESTING;
+        case UNKNOWN:
+            return TeStatus.UNKNOWN;
+        default:
+            return null;
+        }
+    }
+
+    /**
+     * Converts YANG TeAdminStatus Enum to TE Topology TeStatus Enum.
+     *
+     * @param adminStatus YANG Admin Status
+     * @return the equivalent Enum from TE Topology TeStatus or null if not
+     *         found
+     */
+    public static TeStatus yang2TeSubsystemAdminStatus(TeAdminStatus adminStatus) {
+        switch (adminStatus.enumeration()) {
+        case DOWN:
+            return TeStatus.DOWN;
+        case UP:
+            return TeStatus.UP;
+        case TESTING:
+            return TeStatus.TESTING;
+        case MAINTENANCE:
+            return TeStatus.MAINTENANCE;
+        case PREPARING_MAINTENANCE:
+            return TeStatus.PREPARING_MAINTENANCE;
+        default:
+            return TeStatus.UNKNOWN;
+        }
+    }
+
+    /**
+     * Converts TE Topology TeStatus Enum to YANG TeAdminStatus Enum.
+     *
+     * @param adminStatus TE Topology admin status
+     * @return the equivalent Enum from YANG TeAdminStatus or null if not found
+     */
+    public static TeAdminStatus teSubsystem2YangAdminStatus(TeStatus adminStatus) {
+        switch (adminStatus) {
+        case DOWN:
+            return TeAdminStatus.of(TeAdminStatusEnum.DOWN);
+        case UP:
+            return TeAdminStatus.of(TeAdminStatusEnum.UP);
+        case TESTING:
+            return TeAdminStatus.of(TeAdminStatusEnum.TESTING);
+        case MAINTENANCE:
+            return TeAdminStatus.of(TeAdminStatusEnum.MAINTENANCE);
+        case PREPARING_MAINTENANCE:
+            return TeAdminStatus.of(TeAdminStatusEnum.PREPARING_MAINTENANCE);
+        case UNKNOWN:
+            return null;
+        default:
+            return null;
+        }
+    }
+
+    /**
+     * Converts TE Topology TeStatus Enum to YANG TeOperStatus Enum.
+     *
+     * @param opStatus TE Topology operation status
+     * @return the equivalent Enum from YANG TeOperStatus or null if not found
+     */
+    public static TeOperStatus teSubsystem2YangOperStatus(TeStatus opStatus) {
+        switch (opStatus) {
+        case DOWN:
+            return TeOperStatus.of(TeOperStatusEnum.DOWN);
+        case UP:
+            return TeOperStatus.of(TeOperStatusEnum.UP);
+        case TESTING:
+            return TeOperStatus.of(TeOperStatusEnum.TESTING);
+        case MAINTENANCE:
+            return TeOperStatus.of(TeOperStatusEnum.MAINTENANCE);
+        case PREPARING_MAINTENANCE:
+            return TeOperStatus.of(TeOperStatusEnum.PREPARING_MAINTENANCE);
+        case UNKNOWN:
+            return TeOperStatus.of(TeOperStatusEnum.UNKNOWN);
+        default:
+            return null;
+        }
+    }
+
+}
diff --git a/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/LinkConverter.java b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/LinkConverter.java
new file mode 100644
index 0000000..24518d8
--- /dev/null
+++ b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/LinkConverter.java
@@ -0,0 +1,980 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.teyang.utils.topology;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.KeyId;
+import org.onosproject.tetopology.management.api.link.ExternalDomain;
+import org.onosproject.tetopology.management.api.link.LinkProtectionType;
+import org.onosproject.tetopology.management.api.link.NetworkLinkKey;
+import org.onosproject.tetopology.management.api.link.PathElement;
+import org.onosproject.tetopology.management.api.link.TeLink;
+import org.onosproject.tetopology.management.api.link.UnderlayBackupPath;
+import org.onosproject.tetopology.management.api.link.UnderlayPath;
+import org.onosproject.tetopology.management.api.node.TeNetworkTopologyId;
+import org.onosproject.tetopology.management.api.node.TerminationPointKey;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.NetworkId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.NodeId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.LinkId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.TpId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.augmentedndnetwork.DefaultLink;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.augmentedndnetwork.DefaultLink.LinkBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.augmentedndnetwork.Link;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.augmentedndnetwork.link.DefaultDestination;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.augmentedndnetwork.link.DefaultSource;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.augmentedndnetwork.link.DefaultSupportingLink;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+                .ietfnetworktopology.networks.network.augmentedndnetwork.link.Destination
+                .DestinationBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.augmentedndnetwork.link.Source.SourceBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.augmentedndnetwork.link.SupportingLink;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.augmentedndnetwork.link.SupportingLink
+               .SupportingLinkBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.augmentednwnetworks.te.templates.linktemplate
+               .telinkattributes.LinkProtectionTypeEnum;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.AugmentedNtLink;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.DefaultAugmentedNtLink;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.DefaultAugmentedNtLink.AugmentedNtLinkBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.DefaultTe;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.DefaultTe.TeBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.Config;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+.ietftetopology.networks.network.link.augmentedntlink.te.Config.ConfigBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.DefaultConfig;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.DefaultState;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.State;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+.ietftetopology.networks.network.link.augmentedntlink.te.State.StateBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.DefaultTeLinkAttributes;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.TeLinkAttributes;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.TeLinkAttributes
+               .TeLinkAttributesBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .DefaultExternalDomain;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .DefaultExternalDomain.ExternalDomainBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes.DefaultTeSrlgs;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes.DefaultUnderlay;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .DefaultUnreservedBandwidth;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes.TeSrlgs
+               .TeSrlgsBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes.Underlay;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes.Underlay
+               .UnderlayBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .UnreservedBandwidth;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .UnreservedBandwidth.UnreservedBandwidthBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .underlay.DefaultUnderlayBackupPath;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.ietftetopology
+               .networks.network.link.augmentedntlink.te.config.telinkattributes.underlay
+               .DefaultUnderlayBackupPath.UnderlayBackupPathBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .underlay.DefaultUnderlayPrimaryPath;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .underlay.DefaultUnderlayTrailDes.UnderlayTrailDesBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .underlay.DefaultUnderlayTrailSrc.UnderlayTrailSrcBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .underlay.UnderlayPrimaryPath;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .underlay.UnderlayPrimaryPath.UnderlayPrimaryPathBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+               .underlay.underlayprimarypath.DefaultPathElement;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.Srlg;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.TeLinkAccessType;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.TeNodeId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.TeTopologyId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.TeTpId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705
+               .ietftetypes.telinkaccesstype.TeLinkAccessTypeEnum;
+
+import com.google.common.collect.Lists;
+
+/**
+ * The conversion functions.
+ */
+public final class LinkConverter {
+    private static final String
+        E_NULL_TELINK_UNDERLAY_PATH = "TeSubsystem link underlayPath object cannot be null";
+    private static final String
+        E_NULL_TELINK_DATA = "TeSubsystem teLink data cannot be null";
+    private static final String
+        E_NULL_TELINK = "TeSubsystem teLink object cannot be null";
+    private static final String
+        E_NULL_YANG_TELINK_CONFIG = "YANG telink config object cannot be null";
+    private static final String
+        E_NULL_YANG_TELINK = "YANG Link object cannot be null";
+
+    // no instantiation
+    private LinkConverter() {
+    }
+
+    private static UnderlayBuilder te2YangConfigUnderlayPrimaryPath(
+            UnderlayBuilder yangBuilder,
+            org.onosproject.tetopology.management.api.link.UnderlayPrimaryPath tePath) {
+        UnderlayPrimaryPathBuilder pathBuilder =
+                                       DefaultUnderlayPrimaryPath.builder();
+        if (tePath.pathElements() != null) {
+            for (PathElement pathElementTe : tePath.pathElements()) {
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                   .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                   .config.telinkattributes.underlay.underlayprimarypath.PathElement
+                   .PathElementBuilder pathElementYangBuilder = DefaultPathElement.builder();
+                // FIXME: pathElementTe does not have any getter or
+                // setter at the moment --> pathElementYangBuilder =
+                // pathElementYangBuilder.pathElementId(pathElementTe.getPathElementId());
+                pathBuilder = pathBuilder.addToPathElement(pathElementYangBuilder.build());
+            }
+        }
+        pathBuilder = pathBuilder.networkIdRef(NetworkId.fromString(
+                                               tePath.ref().getNetworkId().toString()))
+                                 .teTopologyIdRef(TeTopologyId.fromString(
+                                               tePath.ref().getTopologyId().topologyId()));
+        return yangBuilder.underlayPrimaryPath(pathBuilder.build());
+    }
+
+    private static UnderlayBuilder te2YangConfigUnderlayBackupPaths(
+            UnderlayBuilder yangBuilder,
+            List<org.onosproject.tetopology.management.api.link.UnderlayBackupPath> tePaths) {
+
+        for (UnderlayBackupPath tePath : tePaths) {
+            UnderlayBackupPathBuilder pathBuilder = DefaultUnderlayBackupPath.builder();
+            pathBuilder = pathBuilder.index(tePath.index());
+            pathBuilder = pathBuilder.networkIdRef(NetworkId.fromString(
+                                                        tePath.ref().getNetworkId().toString()))
+                                     .teTopologyIdRef(TeTopologyId.fromString(
+                                                        tePath.ref().getTopologyId().topologyId()));
+            for (PathElement backupPathElementTe : tePath.pathElements()) {
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                   .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                   .config.telinkattributes.underlay.underlaybackuppath.PathElement
+                   .PathElementBuilder elementBuilder =
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                   .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                   .config.telinkattributes.underlay.underlaybackuppath.DefaultPathElement.builder();
+                // FIXME: backupPathElementTe does not have any
+                // getter or setter at the moment -->
+                // elementBuilder =
+                // elementBuilder.pathElementId(backupPathElementTe.getPathElementId());
+                pathBuilder = pathBuilder.addToPathElement(elementBuilder.build());
+            }
+            yangBuilder = yangBuilder.addToUnderlayBackupPath(pathBuilder.build());
+        }
+
+        return yangBuilder;
+    }
+
+    /**
+     * TE Link underlay path Config object conversion from TE Topology subsystem to YANG.
+     *
+     * @param  tePath TE underlay path object
+     * @return Link underlay path Config YANG object
+     */
+    private static Underlay teSubsystem2YangConfigUnderlayPath(UnderlayPath tePath) {
+        checkNotNull(tePath, E_NULL_TELINK_UNDERLAY_PATH);
+        UnderlayBuilder builder =
+                DefaultUnderlay.builder().underlayProtectionType(tePath.protectionType());
+
+        if (tePath.primaryPath() != null) {
+            builder = te2YangConfigUnderlayPrimaryPath(builder, tePath.primaryPath());
+        }
+        if (tePath.trailSrc() != null) {
+            builder = builder.underlayTrailSrc(
+                                  new UnderlayTrailSrcBuilder()
+                                          .networkRef(NetworkId.fromString(
+                                                  tePath.trailSrc().networkId().toString()))
+                                          .nodeRef(NodeId.fromString(
+                                                  tePath.trailSrc().nodeId().toString()))
+                                          .tpRef(TpId.fromString(
+                                                  tePath.trailSrc().tpId().toString()))
+                                          .build());
+        }
+        if (tePath.trailDes() != null) {
+            builder = builder.underlayTrailDes(
+                                  new UnderlayTrailDesBuilder()
+                                          .networkRef(NetworkId.fromString(
+                                                  tePath.trailDes().networkId().toString()))
+                                          .nodeRef(NodeId.fromString(
+                                                  tePath.trailDes().nodeId().toString()))
+                                          .tpRef(TpId.fromString(
+                                                  tePath.trailDes().tpId().toString()))
+                                          .build());
+        }
+        if (tePath.backupPaths() != null) {
+            builder = te2YangConfigUnderlayBackupPaths(builder, tePath.backupPaths());
+        }
+
+        return builder.build();
+    }
+
+    private static org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                      .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                      .state.telinkattributes.Underlay.UnderlayBuilder
+            te2YangStateUnderlayPrimaryPath(
+                   org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                      .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                      .state.telinkattributes.Underlay.UnderlayBuilder yangBuilder,
+                   org.onosproject.tetopology.management.api.link.UnderlayPrimaryPath tePath) {
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+            .ietftetopology.networks.network.link.augmentedntlink.te.state.telinkattributes
+            .underlay.UnderlayPrimaryPath.UnderlayPrimaryPathBuilder pathBuilder =
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+            .ietftetopology.networks.network.link.augmentedntlink.te.state.telinkattributes
+            .underlay.DefaultUnderlayPrimaryPath.builder();
+        if (tePath.pathElements() != null) {
+            for (PathElement pathElementTe : tePath.pathElements()) {
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                   .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                   .state.telinkattributes.underlay.underlayprimarypath.PathElement
+                   .PathElementBuilder pathElementYangBuilder =
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                   .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                   .state.telinkattributes.underlay.underlayprimarypath.DefaultPathElement
+                   .builder();
+                // FIXME: pathElementTe does not have any getter or
+                // setter at the moment --> pathElementYangBuilder =
+                // pathElementYangBuilder.pathElementId(pathElementTe.getPathElementId());
+                pathBuilder = pathBuilder.addToPathElement(pathElementYangBuilder.build());
+            }
+        }
+        pathBuilder = pathBuilder.networkIdRef(NetworkId.fromString(
+                                               tePath.ref().getNetworkId().toString()))
+                                 .teTopologyIdRef(TeTopologyId.fromString(
+                                               tePath.ref().getTopologyId().topologyId()));
+        return yangBuilder.underlayPrimaryPath(pathBuilder.build());
+    }
+
+    private static org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                      .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                      .state.telinkattributes.Underlay.UnderlayBuilder
+           te2YangStateUnderlayBackupPaths(
+                   org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                   .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                   .state.telinkattributes.Underlay.UnderlayBuilder yangBuilder,
+            List<org.onosproject.tetopology.management.api.link.UnderlayBackupPath> tePaths) {
+
+        for (UnderlayBackupPath tePath : tePaths) {
+            org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+            .ietftetopology.networks.network.link.augmentedntlink.te.state.telinkattributes
+            .underlay.UnderlayBackupPath.UnderlayBackupPathBuilder
+            pathBuilder = org.onosproject.yang.gen.v1.urn.ietf.params.xml
+            .ns.yang.ietf.te.topology.rev20160708.ietftetopology.networks.network.link.augmentedntlink
+            .te.state.telinkattributes.underlay.DefaultUnderlayBackupPath
+                    .builder();
+
+            pathBuilder = pathBuilder.index(tePath.index());
+            pathBuilder = pathBuilder.networkIdRef(NetworkId.fromString(
+                                                        tePath.ref().getNetworkId().toString()))
+                                     .teTopologyIdRef(TeTopologyId.fromString(
+                                                        tePath.ref().getTopologyId().topologyId()));
+            for (PathElement backupPathElementTe : tePath.pathElements()) {
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                   .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                   .state.telinkattributes.underlay.underlaybackuppath.PathElement
+                   .PathElementBuilder elementBuilder =
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                   .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                   .state.telinkattributes.underlay.underlaybackuppath.DefaultPathElement.builder();
+                // FIXME: backupPathElementTe does not have any
+                // getter or setter at the moment -->
+                // elementBuilder =
+                // elementBuilder.pathElementId(backupPathElementTe.getPathElementId());
+                pathBuilder = pathBuilder.addToPathElement(elementBuilder.build());
+            }
+            yangBuilder = yangBuilder.addToUnderlayBackupPath(pathBuilder.build());
+        }
+
+        return yangBuilder;
+    }
+
+    /**
+     * TE Link underlay path State object conversion from TE Topology subsystem to YANG.
+     *
+     * @param tePath TE underlay object
+     * @return Link underlay path State YANG object
+     */
+    private static org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                       .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te
+                       .state.telinkattributes.Underlay
+                   teSubsystem2YangStateUnderlayPath(UnderlayPath tePath) {
+        checkNotNull(tePath, E_NULL_TELINK_UNDERLAY_PATH);
+
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+            .ietftetopology.networks.network.link.augmentedntlink.te.state.telinkattributes
+            .Underlay.UnderlayBuilder builder =
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+            .ietftetopology.networks.network.link.augmentedntlink.te.state.telinkattributes
+            .DefaultUnderlay.builder().underlayProtectionType(tePath.protectionType());
+
+        if (tePath.primaryPath() != null) {
+            builder = te2YangStateUnderlayPrimaryPath(builder, tePath.primaryPath());
+
+        }
+        if (tePath.trailSrc() != null) {
+            builder = builder.underlayTrailSrc(
+                          new org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te
+                                  .topology.rev20160708.ietftetopology.networks.network.link
+                                  .augmentedntlink.te.state.telinkattributes.underlay
+                                  .DefaultUnderlayTrailSrc.UnderlayTrailSrcBuilder()
+                              .networkRef(NetworkId.fromString(
+                                              tePath.trailSrc().networkId().toString()))
+                              .nodeRef(NodeId.fromString(
+                                              tePath.trailSrc().nodeId().toString()))
+                              .tpRef(TpId.fromString(
+                                              tePath.trailSrc().tpId().toString()))
+                              .build());
+        }
+        if (tePath.trailDes() != null) {
+            builder = builder.underlayTrailDes(
+                          new org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te
+                                   .topology.rev20160708.ietftetopology.networks.network.link
+                                   .augmentedntlink.te.state.telinkattributes.underlay
+                                   .DefaultUnderlayTrailDes.UnderlayTrailDesBuilder()
+                              .networkRef(NetworkId.fromString(
+                                              tePath.trailDes().networkId().toString()))
+                              .nodeRef(NodeId.fromString(
+                                              tePath.trailDes().nodeId().toString()))
+                              .tpRef(TpId.fromString(
+                                              tePath.trailDes().tpId().toString()))
+                              .build());
+        }
+        if (tePath.backupPaths() != null) {
+            builder = te2YangStateUnderlayBackupPaths(builder, tePath.backupPaths());
+        }
+
+        return builder.build();
+    }
+
+    /**
+     * TE Link Config object conversion from TE Topology subsystem to YANG.
+     *
+     * @param teLink TE link object
+     * @return TE Link Config YANG object
+     */
+    private static Config teLink2YangConfig(TeLink teLink) {
+        checkNotNull(teLink, E_NULL_TELINK_DATA);
+
+        TeLinkAttributesBuilder attrBuilder = DefaultTeLinkAttributes.builder();
+        if (teLink.linkIndex() != null) {
+            attrBuilder = attrBuilder.linkIndex(teLink.linkIndex());
+        }
+        if (teLink.name() != null) {
+            attrBuilder = attrBuilder.name(teLink.name());
+        }
+        if (teLink.adminStatus() != null) {
+            attrBuilder = attrBuilder
+                    .adminStatus(EnumConverter
+                            .teSubsystem2YangAdminStatus(teLink
+                            .adminStatus()));
+        }
+        if (teLink.accessType() != null) {
+            attrBuilder = attrBuilder
+                    .accessType(teSubsystem2YangTeLinkAccess(teLink
+                            .accessType()));
+        }
+        if (teLink.linkProtectionType() != null) {
+            attrBuilder = attrBuilder
+                    .linkProtectionType(teSubsystem2YangLinkProtectionType(teLink
+                            .linkProtectionType()));
+        }
+        if (teLink.maxLinkBandwidth() != null) {
+            attrBuilder = attrBuilder.maxLinkBandwidth(teLink.maxLinkBandwidth());
+        }
+        if (teLink.maxResvLinkBandwidth() != null) {
+            attrBuilder = attrBuilder.maxResvLinkBandwidth(teLink.maxResvLinkBandwidth());
+        }
+        attrBuilder = attrBuilder.teDefaultMetric(teLink.teDefaultMetric());
+        if (teLink.teSrlgs() != null) {
+            TeSrlgsBuilder teSrlgsBuilder = DefaultTeSrlgs.builder();
+            for (Long srlgLongVal : teLink.teSrlgs()) {
+                teSrlgsBuilder = teSrlgsBuilder.addToValue(new Srlg(srlgLongVal));
+            }
+            attrBuilder = attrBuilder.teSrlgs(teSrlgsBuilder.build());
+        }
+        attrBuilder = attrBuilder.isAbstract(teLink.isAbstract());
+        if (teLink.underlayPath() != null) {
+            attrBuilder = attrBuilder.underlay(
+                              teSubsystem2YangConfigUnderlayPath(teLink.underlayPath()));
+        }
+        if (teLink.externalDomain() != null) {
+            ExternalDomainBuilder edBuilder =
+                    DefaultExternalDomain.builder()
+                                         .plugId(teLink.externalDomain().plugId())
+                                         .remoteTeLinkTpId(TeTpId.fromString(
+                                                  teLink.externalDomain().remoteTeLinkTpId().toString()))
+                                         .remoteTeNodeId(TeNodeId.fromString(
+                                                  teLink.externalDomain().remoteTeNodeId().toString()));
+            attrBuilder = attrBuilder.externalDomain(edBuilder.build());
+        }
+
+        if (teLink.unreservedBandwidths() != null) {
+            for (org.onosproject.tetopology.management.api.link.UnreservedBandwidth unResBwTe :
+                        teLink.unreservedBandwidths()) {
+                UnreservedBandwidthBuilder urBuilder =
+                        DefaultUnreservedBandwidth.builder()
+                                                  .bandwidth(unResBwTe.bandwidth())
+                                                  .priority(unResBwTe.priority());
+                attrBuilder = attrBuilder.addToUnreservedBandwidth(urBuilder.build());
+            }
+        }
+
+        ConfigBuilder yangConfigBuilder = DefaultConfig.builder()
+                                                       .teLinkAttributes(attrBuilder.build());
+        return yangConfigBuilder.build();
+    }
+
+    private static LinkProtectionTypeEnum
+                        teSubsystem2YangLinkProtectionType(LinkProtectionType linkProtectionType) {
+        switch (linkProtectionType) {
+        case ENHANCED:
+            return LinkProtectionTypeEnum.ENHANCED;
+        case EXTRA_TRAFFIC:
+            return LinkProtectionTypeEnum.EXTRA_TRAFFIC;
+        case SHARED:
+            return LinkProtectionTypeEnum.SHARED;
+        case UNPROTECTED:
+            return LinkProtectionTypeEnum.UNPROTECTED;
+        case YANGAUTOPREFIX1_FOR_1:
+            return LinkProtectionTypeEnum.YANGAUTOPREFIX1_FOR_1;
+        case YANGAUTOPREFIX1_PLUS_1:
+            return LinkProtectionTypeEnum.YANGAUTOPREFIX1_PLUS_1;
+        default:
+            return null;
+        }
+    }
+
+    private static TeLinkAccessType teSubsystem2YangTeLinkAccess(
+                       org.onosproject.tetopology.management.api.link.TeLinkAccessType accessType) {
+        switch (accessType) {
+        case MULTI_ACCESS:
+            return TeLinkAccessType.of(TeLinkAccessTypeEnum.MULTI_ACCESS);
+        case POINT_TO_POINT:
+            return TeLinkAccessType.of(TeLinkAccessTypeEnum.POINT_TO_POINT);
+        default:
+            return null;
+        }
+    }
+
+    /**
+     * TE Link State object conversion from TE Topology subsystem to YANG.
+     *
+     * @param teLink TE link object
+     * @return TE Link State YANG object
+     */
+    private static State teLink2YangState(TeLink teLink) {
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+            .ietftetopology.networks.network.link.augmentedntlink.te.state.TeLinkAttributes
+            .TeLinkAttributesBuilder attrBuilder =
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+            .ietftetopology.networks.network.link.augmentedntlink.te.state.DefaultTeLinkAttributes
+            .builder()
+            .teDefaultMetric(teLink.teDefaultMetric())
+            .isAbstract(teLink.isAbstract());
+        if (teLink.linkIndex() != null) {
+            attrBuilder = attrBuilder.linkIndex(teLink.linkIndex());
+        }
+        if (teLink.name() != null) {
+            attrBuilder = attrBuilder.name(teLink.name());
+        }
+        if (teLink.adminStatus() != null) {
+            attrBuilder = attrBuilder
+                    .adminStatus(EnumConverter
+                            .teSubsystem2YangAdminStatus(teLink
+                            .adminStatus()));
+        }
+        if (teLink.accessType() != null) {
+            attrBuilder = attrBuilder
+                    .accessType(teSubsystem2YangTeLinkAccess(teLink
+                            .accessType()));
+        }
+        if (teLink.linkProtectionType() != null) {
+            attrBuilder = attrBuilder
+                    .linkProtectionType(teSubsystem2YangStateLinkProtectionType(teLink
+                            .linkProtectionType()));
+        }
+        if (teLink.maxLinkBandwidth() != null) {
+            attrBuilder = attrBuilder.maxLinkBandwidth(teLink.maxLinkBandwidth());
+        }
+        if (teLink.maxResvLinkBandwidth() != null) {
+            attrBuilder = attrBuilder.maxResvLinkBandwidth(teLink.maxResvLinkBandwidth());
+        }
+        if (teLink.teSrlgs() != null) {
+            org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                .ietftetopology.networks.network.link.augmentedntlink.te.state.telinkattributes
+                .TeSrlgs.TeSrlgsBuilder srlgsBuilder =
+            org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                .ietftetopology.networks.network.link.augmentedntlink.te.state.telinkattributes
+                .DefaultTeSrlgs.builder();
+            for (Long srlgLongVal : teLink.teSrlgs()) {
+                srlgsBuilder = srlgsBuilder.addToValue(new Srlg(srlgLongVal));
+            }
+            attrBuilder = attrBuilder.teSrlgs(srlgsBuilder.build());
+        }
+        if (teLink.underlayPath() != null) {
+            attrBuilder = attrBuilder.underlay(teSubsystem2YangStateUnderlayPath(teLink.underlayPath()));
+        }
+        if (teLink.externalDomain() != null) {
+            org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                    .ietftetopology.networks.network.link.augmentedntlink.te.state.telinkattributes
+                    .ExternalDomain.ExternalDomainBuilder edBuilder =
+            org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                    .ietftetopology.networks.network.link.augmentedntlink.te.state.telinkattributes
+                    .DefaultExternalDomain.builder()
+                                          .plugId(teLink.externalDomain().plugId())
+                                          .remoteTeLinkTpId(TeTpId.fromString(
+                                                  teLink.externalDomain().remoteTeLinkTpId().toString()))
+                                          .remoteTeNodeId(TeNodeId.fromString(
+                                                  teLink.externalDomain().remoteTeNodeId().toString()));
+            attrBuilder = attrBuilder.externalDomain(edBuilder.build());
+        }
+        if (teLink.unreservedBandwidths() != null) {
+            for (org.onosproject.tetopology.management.api.link.UnreservedBandwidth unResBwTe :
+                    teLink.unreservedBandwidths()) {
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                    .ietftetopology.networks.network.link.augmentedntlink.te.state.telinkattributes
+                    .UnreservedBandwidth.UnreservedBandwidthBuilder urBuilder =
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                    .ietftetopology.networks.network.link.augmentedntlink.te.state.telinkattributes
+                    .DefaultUnreservedBandwidth.builder()
+                                               .bandwidth(unResBwTe.bandwidth())
+                                               .priority(unResBwTe.priority());
+                attrBuilder = attrBuilder.addToUnreservedBandwidth(urBuilder.build());
+            }
+        }
+
+        StateBuilder yangStateBuilder = DefaultState.builder()
+                                                    .teLinkAttributes(attrBuilder.build());
+        if (teLink.opStatus() != null) {
+            yangStateBuilder = yangStateBuilder
+                    .operStatus(EnumConverter
+                            .teSubsystem2YangOperStatus(teLink
+                            .opStatus()));
+        }
+
+        return yangStateBuilder.build();
+    }
+
+    private static org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.
+        rev20160708.ietftetopology.networks.network.link.augmentedntlink.te.state.informationsourceentry.
+        LinkProtectionTypeEnum teSubsystem2YangStateLinkProtectionType(LinkProtectionType linkProtectionType) {
+        switch (linkProtectionType) {
+        case ENHANCED:
+            return org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.
+                    rev20160708.ietftetopology.networks.network.link.augmentedntlink.te.state.informationsourceentry.
+                    LinkProtectionTypeEnum.ENHANCED;
+        case EXTRA_TRAFFIC:
+            return org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.
+                    rev20160708.ietftetopology.networks.network.link.augmentedntlink.te.state.informationsourceentry.
+                    LinkProtectionTypeEnum.EXTRA_TRAFFIC;
+        case SHARED:
+            return org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.
+                    rev20160708.ietftetopology.networks.network.link.augmentedntlink.te.state.informationsourceentry.
+                    LinkProtectionTypeEnum.SHARED;
+        case UNPROTECTED:
+            return org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.
+                    rev20160708.ietftetopology.networks.network.link.augmentedntlink.te.state.informationsourceentry.
+                    LinkProtectionTypeEnum.UNPROTECTED;
+        case YANGAUTOPREFIX1_FOR_1:
+            return org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.
+                    rev20160708.ietftetopology.networks.network.link.augmentedntlink.te.state.informationsourceentry.
+                    LinkProtectionTypeEnum.YANGAUTOPREFIX1_FOR_1;
+        case YANGAUTOPREFIX1_PLUS_1:
+            return org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.
+                    rev20160708.ietftetopology.networks.network.link.augmentedntlink.te.state.informationsourceentry.
+                    LinkProtectionTypeEnum.YANGAUTOPREFIX1_PLUS_1;
+        default:
+            return null;
+        }
+    }
+
+    /**
+     * Link object conversion from TE Topology subsystem to YANG.
+     *
+     * @param teLink TE subsystem link object
+     * @return YANG link object
+     */
+    public static Link teSubsystem2YangLink(
+            org.onosproject.tetopology.management.api.link.NetworkLink teLink) {
+        checkNotNull(teLink, E_NULL_TELINK);
+
+        LinkId linkId = LinkId.fromString(teLink.linkId().toString());
+        LinkBuilder builder = DefaultLink.builder().linkId(linkId);
+        if (teLink.getSupportingLinkIds() != null) {
+            List<SupportingLink> slinks = Lists.newArrayList();
+            SupportingLinkBuilder spLinkBuilder = DefaultSupportingLink.builder();
+            for (NetworkLinkKey linkKey : teLink.getSupportingLinkIds()) {
+                slinks.add(spLinkBuilder.networkRef(NetworkId.fromString(
+                                                    linkKey.networkId().toString()))
+                                        .linkRef(LinkId.fromString(
+                                                    linkKey.linkId().toString()))
+                                        .build());
+            }
+            builder = builder.supportingLink(slinks);
+        }
+        if (teLink.getSource() != null) {
+            SourceBuilder sourceBuilder = DefaultSource
+                                              .builder()
+                                              .sourceNode(NodeId.fromString(
+                                                   teLink.getSource().nodeId().toString()))
+                                              .sourceTp(TpId.fromString(
+                                                   teLink.getSource().tpId().toString()));
+            builder = builder.source(sourceBuilder.build());
+        }
+        if (teLink.getDestination() != null) {
+            DestinationBuilder destBuilder = DefaultDestination
+                                                 .builder()
+                                                 .destNode(NodeId.fromString(
+                                                      teLink.getDestination().nodeId().toString()))
+                                                 .destTp(TpId.fromString(
+                                                      teLink.getDestination().tpId().toString()));
+            builder = builder.destination(destBuilder.build());
+        }
+
+        if (teLink.getTe() != null) {
+            TeLink teData = teLink.getTe();
+            TeBuilder yangTeBuilder = DefaultTe.builder()
+                                               .config(teLink2YangConfig(teData))
+                                               .state(teLink2YangState(teData));
+            AugmentedNtLinkBuilder linkAugmentBuilder =
+                    DefaultAugmentedNtLink.builder()
+                                          .te(yangTeBuilder.build());
+            builder.addYangAugmentedInfo(linkAugmentBuilder.build(), AugmentedNtLink.class);
+        }
+
+        return builder.build();
+    }
+
+    private static org.onosproject.tetopology.management.api.link.UnderlayPath
+           yang2TeSubsystemUnderlayPrimaryPath(
+                            org.onosproject.tetopology.management.api.link.UnderlayPath teUnderlay,
+                            UnderlayPrimaryPath yangpath) {
+        org.onosproject.tetopology.management.api.link.UnderlayPrimaryPath teUnderlayPrimaryPath =
+                new org.onosproject.tetopology.management.api.link.UnderlayPrimaryPath();
+        teUnderlayPrimaryPath.setRef(new TeNetworkTopologyId(KeyId.keyId(
+                                             yangpath.networkIdRef().toString()),
+                                     new org.onosproject.tetopology.management.api.TeTopologyId(
+                                             yangpath.providerIdRef().uint32(),
+                                             yangpath.clientIdRef().uint32(),
+                                             yangpath.teTopologyIdRef().toString())));
+
+        List<PathElement> pathElementList = Lists.newArrayList();
+        for (org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+                .underlay.underlayprimarypath.PathElement pathElementConfigYang :
+                    yangpath.pathElement()) {
+            //PathElement tePathElement = new PathElement();
+            // FIXME: tePathElement does not have any getter
+            // or setter at the moment -->
+            // tePathElement.set...
+            // TODO: construct the tePathElement object
+            // properly using pathElementConfigYang
+            //pathElementList.add(tePathElement);
+        }
+        teUnderlayPrimaryPath.setPathElement(pathElementList);
+        teUnderlay.setPrimaryPath(teUnderlayPrimaryPath);
+
+        return teUnderlay;
+    }
+
+    private static org.onosproject.tetopology.management.api.link.UnderlayPath
+            yang2TeSubsystemUnderlayBackupPaths(
+                     org.onosproject.tetopology.management.api.link.UnderlayPath teUnderlay,
+                     List<org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te
+                             .topology.rev20160708.ietftetopology.networks.network.link
+                             .augmentedntlink.te.config.telinkattributes.underlay
+                             .UnderlayBackupPath> yangpaths) {
+        List<UnderlayBackupPath> underlayBackupPathsList = Lists.newArrayList();
+        for (org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                .ietftetopology.networks.network.link.augmentedntlink.te.config.telinkattributes
+                    .underlay.UnderlayBackupPath yangConfig : yangpaths) {
+            UnderlayBackupPath ubp = new UnderlayBackupPath();
+            ubp.setIndex(yangConfig.index());
+            ubp.setRef(new TeNetworkTopologyId(KeyId.keyId(yangConfig.networkIdRef().toString()),
+                                               new org.onosproject.tetopology.management.api.TeTopologyId(
+                                                       yangConfig.providerIdRef().uint32(),
+                                                       yangConfig.clientIdRef().uint32(),
+                                                       yangConfig.teTopologyIdRef().toString()
+                                              )));
+            List<PathElement> backupPathElementList = Lists.newArrayList();
+            for (org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                    .rev20160708.ietftetopology.networks.network.link.augmentedntlink.te.config
+                    .telinkattributes.underlay.underlaybackuppath.PathElement
+                        pathElementBackupYang : yangConfig.pathElement()) {
+                //PathElement tePathElementBackup = new PathElement();
+                // FIXME: tePathElement does not have any
+                // getter or setter at the moment -->
+                // tePathElement.set...
+                // TODO: construct the tePathElement object
+                // properly using pathElementBackupYang
+                //backupPathElementList.add(tePathElementBackup);
+            }
+            ubp.setPathElement(backupPathElementList);
+        }
+        teUnderlay.setBackupPath(underlayBackupPathsList);
+
+        return teUnderlay;
+    }
+
+    /**
+     * TE Link underlay path Config object conversion from YANG to TE Topology subsystem.
+     *
+     * @param yangLinkAtrr YANG link Config YANG object
+     * @return teSubsystem TE underlay path object
+     */
+    private static org.onosproject.tetopology.management.api.link.UnderlayPath
+                    yang2TeSubsystemUnderlayPath(TeLinkAttributes yangLinkAtrr) {
+        checkNotNull(yangLinkAtrr, E_NULL_YANG_TELINK_CONFIG);
+
+        org.onosproject.tetopology.management.api.link.UnderlayPath teUnderlay =
+                new org.onosproject.tetopology.management.api.link.UnderlayPath();
+
+        teUnderlay.setProtectionType(yangLinkAtrr.underlay().underlayProtectionType());
+
+        if (yangLinkAtrr.underlay().underlayPrimaryPath() != null) {
+            teUnderlay = yang2TeSubsystemUnderlayPrimaryPath(teUnderlay,
+                                    yangLinkAtrr.underlay().underlayPrimaryPath());
+        }
+
+        if (yangLinkAtrr.underlay().underlayBackupPath() != null) {
+            teUnderlay = yang2TeSubsystemUnderlayBackupPaths(teUnderlay,
+                    yangLinkAtrr.underlay().underlayBackupPath());
+        }
+
+        if (yangLinkAtrr.underlay().underlayTrailSrc() != null) {
+            teUnderlay.setTrailSrc(new TerminationPointKey(
+                                            KeyId.keyId(yangLinkAtrr.underlay().underlayTrailSrc()
+                                                            .networkRef().uri().toString()),
+                                            KeyId.keyId(yangLinkAtrr.underlay().underlayTrailSrc()
+                                                            .nodeRef().uri().toString()),
+                                            KeyId.keyId(yangLinkAtrr.underlay().underlayTrailSrc()
+                                                            .tpRef().uri().toString())));
+        }
+
+        if (yangLinkAtrr.underlay().underlayTrailDes() != null) {
+            teUnderlay.setTrailDes(new TerminationPointKey(
+                                            KeyId.keyId(yangLinkAtrr.underlay().underlayTrailDes()
+                                                            .networkRef().uri().toString()),
+                                            KeyId.keyId(yangLinkAtrr.underlay().underlayTrailDes()
+                                                            .nodeRef().uri().toString()),
+                                            KeyId.keyId(yangLinkAtrr.underlay().underlayTrailDes()
+                                                            .tpRef().uri().toString())));
+        }
+
+        return teUnderlay;
+    }
+
+    private static TeLink yang2TeLinkAttributes(TeLinkAttributes yangLinkAtrr,
+                                                State opState) {
+        TeLink te = new TeLink(yangLinkAtrr.linkIndex());
+        if (yangLinkAtrr.name() != null) {
+            te.setName(yangLinkAtrr.name());
+        }
+        if (yangLinkAtrr.adminStatus() != null) {
+            te.setAdminStatus(EnumConverter.yang2TeSubsystemAdminStatus(
+                                                yangLinkAtrr.adminStatus()));
+        }
+        if (opState != null && opState.operStatus() != null) {
+            te.setOpStatus(EnumConverter.yang2TeSubsystemOpStatus(
+                                             opState.operStatus()));
+        }
+        if (yangLinkAtrr.accessType() != null) {
+            te.setAccessType(yang2TeSubsystemAccessType(
+                                 yangLinkAtrr.accessType()));
+        }
+        if (yangLinkAtrr.linkProtectionType() != null) {
+            te.setLinkProtectionType(yang2TeSubsystemLinkProtectionType(
+                                         yangLinkAtrr.linkProtectionType()));
+        }
+        if (yangLinkAtrr.maxLinkBandwidth() != null) {
+            te.setMaxLinkBandwidth(yangLinkAtrr.maxLinkBandwidth());
+        }
+        if (yangLinkAtrr.maxResvLinkBandwidth() != null) {
+            te.setMaxResvLinkBandwidth(yangLinkAtrr.maxResvLinkBandwidth());
+        }
+        te.setTeDefaultMetric(yangLinkAtrr.teDefaultMetric());
+        te.setIsAbstract(yangLinkAtrr.isAbstract());
+        if (yangLinkAtrr.teSrlgs() != null) {
+            List<Long> srlgs = Lists.newArrayList();
+            for (Srlg srlgConfigYang : yangLinkAtrr.teSrlgs().value()) {
+                srlgs.add(srlgConfigYang.uint32());
+            }
+            te.setTeSrlgs(srlgs);
+        }
+        if (yangLinkAtrr.externalDomain() != null) {
+            te.setExternalDomain(new ExternalDomain(
+                    KeyId.keyId(yangLinkAtrr.externalDomain()
+                                    .remoteTeNodeId().toString()),
+                    KeyId.keyId(yangLinkAtrr.externalDomain()
+                                    .remoteTeLinkTpId().toString()),
+                    yangLinkAtrr.externalDomain().plugId()));
+        }
+        if (yangLinkAtrr.underlay() != null) {
+            te.setUnderlayPath(yang2TeSubsystemUnderlayPath(yangLinkAtrr));
+        }
+        if (yangLinkAtrr.unreservedBandwidth() != null) {
+            List<org.onosproject.tetopology.management.api.link.UnreservedBandwidth>
+                    unreservedBandwidths = Lists.newArrayList();
+            for (UnreservedBandwidth urBwYang : yangLinkAtrr.unreservedBandwidth()) {
+                org.onosproject.tetopology.management.api.link.UnreservedBandwidth unResBw =
+                        new org.onosproject.tetopology.management.api.link.UnreservedBandwidth(
+                                urBwYang.priority(),
+                                urBwYang.bandwidth());
+                unreservedBandwidths.add(unResBw);
+            }
+            te.setUnreservedBandwidths(unreservedBandwidths);
+        }
+        return te;
+    }
+
+    private static LinkProtectionType
+        yang2TeSubsystemLinkProtectionType(LinkProtectionTypeEnum linkProtectionType) {
+        switch (linkProtectionType) {
+        case ENHANCED:
+            return LinkProtectionType.ENHANCED;
+        case EXTRA_TRAFFIC:
+            return LinkProtectionType.EXTRA_TRAFFIC;
+        case SHARED:
+            return LinkProtectionType.SHARED;
+        case UNPROTECTED:
+            return LinkProtectionType.UNPROTECTED;
+        case YANGAUTOPREFIX1_FOR_1:
+            return LinkProtectionType.YANGAUTOPREFIX1_FOR_1;
+        case YANGAUTOPREFIX1_PLUS_1:
+            return LinkProtectionType.YANGAUTOPREFIX1_PLUS_1;
+        default:
+            return null;
+        }
+    }
+
+    private static org.onosproject.tetopology.management.api.link.TeLinkAccessType
+        yang2TeSubsystemAccessType(TeLinkAccessType accessType) {
+        switch (accessType.enumeration()) {
+        case MULTI_ACCESS:
+            return org.onosproject.tetopology.management.api.link.TeLinkAccessType.MULTI_ACCESS;
+        case POINT_TO_POINT:
+            return org.onosproject.tetopology.management.api.link.TeLinkAccessType.POINT_TO_POINT;
+        default:
+            return null;
+        }
+    }
+
+    /**
+     * Link object conversion from YANG to TE Topology subsystem.
+     *
+     * @param yangLink YANG link object
+     * @param networkId YANG networkId object
+     * @return TE subsystem link object
+     */
+    public static org.onosproject.tetopology.management.api.link.NetworkLink
+            yang2TeSubsystemLink(Link yangLink, NetworkId networkId) {
+        checkNotNull(yangLink, E_NULL_YANG_TELINK);
+
+        org.onosproject.tetopology.management.api.link.DefaultNetworkLink link =
+                new org.onosproject.tetopology.management.api.link.DefaultNetworkLink(
+                        KeyId.keyId(yangLink.linkId().uri().toString()));
+
+        if (yangLink.supportingLink() != null) {
+            List<NetworkLinkKey> spLinkIds = Lists.newArrayList();
+            for (SupportingLink yangSpLink : yangLink.supportingLink()) {
+                NetworkLinkKey linkKey = new NetworkLinkKey(KeyId.keyId(yangSpLink.networkRef().uri().toString()),
+                                                            KeyId.keyId(yangSpLink.linkRef().uri().toString()));
+                spLinkIds.add(linkKey);
+            }
+            link.setSupportingLinkIds(spLinkIds);
+        }
+
+        if (yangLink.source() != null) {
+            TerminationPointKey source = new TerminationPointKey(
+                                                 KeyId.keyId(networkId.uri().toString()),
+                                                 KeyId.keyId(yangLink.source().sourceNode().uri().toString()),
+                                                 KeyId.keyId(yangLink.source().sourceTp().uri().toString()));
+            link.setSource(source);
+        }
+
+        if (yangLink.destination() != null) {
+            TerminationPointKey destination = new TerminationPointKey(
+                                                      KeyId.keyId(networkId.uri().toString()),
+                                                      KeyId.keyId(yangLink.destination().destNode().uri().toString()),
+                                                      KeyId.keyId(yangLink.destination().destTp().uri().toString()));
+            link.setDestination(destination);
+        }
+
+        if (yangLink.yangAugmentedInfoMap() != null && !yangLink.yangAugmentedInfoMap().isEmpty()) {
+
+            AugmentedNtLink yangLinkAugment =
+                    (AugmentedNtLink) yangLink.yangAugmentedInfo(AugmentedNtLink.class);
+            if (yangLinkAugment != null &&
+                    yangLinkAugment.te() != null &&
+                    yangLinkAugment.te().config() != null) {
+                TeLinkAttributes yangLinkAtrr =
+                        yangLinkAugment.te().config().teLinkAttributes();
+                if (yangLinkAtrr != null && yangLinkAtrr.linkIndex() != null) {
+                    TeLink te = yang2TeLinkAttributes(yangLinkAtrr, yangLinkAugment.te().state());
+                    link.setTe(te);
+                }
+            }
+        }
+        return link;
+    }
+
+}
diff --git a/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/NetworkConverter.java b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/NetworkConverter.java
new file mode 100644
index 0000000..f529d6a
--- /dev/null
+++ b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/NetworkConverter.java
@@ -0,0 +1,532 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.teyang.utils.topology;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+import static com.google.common.base.Preconditions.checkState;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.KeyId;
+import org.onosproject.tetopology.management.api.link.NetworkLink;
+import org.onosproject.tetopology.management.api.node.NetworkNode;
+import org.onosproject.teyang.api.OperationType;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.DefaultNetworks;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.DefaultNetworks.OnosYangNodeOperationType;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.DefaultNetworksState;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.NetworkId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.Networks;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.NetworksState;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.networks.DefaultNetwork;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.networks.Network;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.networks.Network.NetworkBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.networks.network.DefaultNetworkTypes;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.networks.network.DefaultSupportingNetwork;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.networks.network.DefaultSupportingNetwork.SupportingNetworkBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.networks.network.NetworkTypes;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.networks.network.Node;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+        .ietfnetwork.networks.network.SupportingNetwork;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+        .ietfnetworktopology.networks.network.AugmentedNdNetwork;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+        .ietfnetworktopology.networks.network.DefaultAugmentedNdNetwork;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208.ietfnetworktopology.networks.network.DefaultAugmentedNdNetwork.AugmentedNdNetworkBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+        .ietfnetworktopology.networks.network.augmentedndnetwork.Link;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+        .ietftetopology.networks.network.AugmentedNwNetwork;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+        .ietftetopology.networks.network.DefaultAugmentedNwNetwork;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+        .ietftetopology.networks.network.augmentednwnetwork.DefaultTe;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+        .ietftetopology.networks.network.augmentednwnetwork.Te;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+        .ietftetopology.networks.network.networktypes.AugmentedNwNetworkTypes;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+        .ietftetopology.networks.network.networktypes.DefaultAugmentedNwNetworkTypes;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+        .ietftetopology.networks.network.networktypes.augmentednwnetworktypes.DefaultTeTopology;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+        .ietftetopology.networks.network.networktypes.augmentednwnetworktypes.TeTopology;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705
+        .ietftetypes.TeGlobalId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705
+        .ietftetypes.TeTopologyId;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import com.google.common.collect.Lists;
+
+
+/**
+ * Networks, Networks State conversion functions.
+ */
+public final class NetworkConverter {
+    private static final String
+        E_NULL_TE_NETWORKS = "TeSubsystem networks cannot be null";
+    private static final String
+        E_NULL_TE_NETWORK_LIST = "TeSubsystem network list cannot be null";
+    private static final String
+        E_NULL_TE_NETWORK = "TeSubsystem network cannot be null";
+    private static final String
+        E_NULL_TE_NETWORKID = "TeSubsystem networkId cannot be null";
+    private static final String
+        E_NULL_YANG_NETWORKS = "YANG networks cannot be null";
+    private static final String
+        E_NULL_YANG_NETWORK_LIST = "YANG network list cannot be null";
+    private static final String
+        E_NULL_YANG_NETWORK = "YANG network cannot be null";
+    private static final String
+        E_NULL_YANG_NETWORKID = "YANG networkId cannot be null";
+    private static final String
+        E_NULL_YANG_NETWORKSSTATE = "YANG networksState cannot be null";
+    private static final String
+        E_DIFF_YANG_NETWORKID = "YANG networkId must be same in Network and NetworkState";
+    private static final String
+        E_NULL_YANG_NETWORKSSTATE_NETWORK = "YANG networksState network cannot be null";
+    private static final String
+        E_NULL_YANG_NETWORKSSTATE_NETWORKREF = "YANG networksState networkRef cannot be null";
+
+    private static final Logger log = LoggerFactory.getLogger(NetworkConverter.class);
+
+    // no instantiation
+    private NetworkConverter() {
+    }
+
+    private static OnosYangNodeOperationType toNetworksOperationType(OperationType operation) {
+        switch (operation) {
+        case CREATE:
+            return OnosYangNodeOperationType.CREATE;
+
+        case DELETE:
+            return OnosYangNodeOperationType.DELETE;
+
+        case REMOVE:
+            return OnosYangNodeOperationType.REMOVE;
+
+        case MERGE:
+            return OnosYangNodeOperationType.MERGE;
+
+        case REPLACE:
+            return OnosYangNodeOperationType.REPLACE;
+
+        default:
+            return OnosYangNodeOperationType.NONE;
+        }
+    }
+
+    /**
+     * Networks object conversion from TE Topology subsystem to YANG.
+     *
+     * @param teSubsystem TE Topology subsystem networks object
+     * @param operation operation type
+     * @return Networks YANG object
+     */
+    public static Networks teSubsystem2YangNetworks(
+            org.onosproject.tetopology.management.api.Networks teSubsystem,
+            OperationType operation) {
+        checkNotNull(teSubsystem, E_NULL_TE_NETWORKS);
+        checkNotNull(teSubsystem.networks(), E_NULL_TE_NETWORK_LIST);
+        Networks.NetworksBuilder builder =
+                DefaultNetworks.builder().onosYangNodeOperationType(toNetworksOperationType(operation));
+        List<Network> networks = Lists.newArrayList();
+        for (org.onosproject.tetopology.management.api.Network teNetwork : teSubsystem.networks()) {
+            networks.add(teSubsystem2YangNetwork(teNetwork, operation));
+        }
+        builder.network(networks);
+        return builder.build();
+    }
+
+    private static DefaultNetworksState.OnosYangNodeOperationType
+                           toNetworksStateOperationType(OperationType operation) {
+        switch (operation) {
+        case CREATE:
+            return DefaultNetworksState.OnosYangNodeOperationType.CREATE;
+
+        case DELETE:
+            return DefaultNetworksState.OnosYangNodeOperationType.DELETE;
+
+        case REMOVE:
+            return DefaultNetworksState.OnosYangNodeOperationType.REMOVE;
+
+        case MERGE:
+            return DefaultNetworksState.OnosYangNodeOperationType.MERGE;
+
+        case REPLACE:
+            return DefaultNetworksState.OnosYangNodeOperationType.REPLACE;
+
+        default:
+            return DefaultNetworksState.OnosYangNodeOperationType.NONE;
+        }
+    }
+
+    /**
+     * Network States object conversion from TE Topology subsystem to YANG.
+     *
+     * @param teSubsystem TE Topology subsystem networks object
+     * @param operation operation type
+     * @return NetworkStates YANG object
+     */
+    public static NetworksState teSubsystem2YangNetworkStates(
+            org.onosproject.tetopology.management.api.Networks teSubsystem,
+            OperationType operation) {
+        checkNotNull(teSubsystem, "teSubsystem object cannot be null");
+        checkNotNull(teSubsystem.networks(), "TeSubsystem Networks object cannot be null");
+        NetworksState.NetworksStateBuilder builder =
+                DefaultNetworksState.builder().onosYangNodeOperationType(toNetworksStateOperationType(operation));
+        List<org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+                .ietfnetwork.networksstate.Network> networks = Lists.newArrayList();
+        for (org.onosproject.tetopology.management.api.Network teNetwork : teSubsystem.networks()) {
+            networks.add(teSubsystem2YangNetworkState(teNetwork, operation));
+        }
+        builder.network(networks);
+        return builder.build();
+    }
+
+    private static org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+            .ietfnetwork.networksstate.Network networkStateNetwork(Network network,
+                                                                   NetworksState yangNetworkStates) {
+        checkNotNull(network, "YANG Network object cannot be null");
+        checkNotNull(yangNetworkStates, "YANG NetworksState object cannot be null");
+        if (yangNetworkStates.network() == null) {
+            return null;
+        }
+
+        for (org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+                .ietfnetwork.networksstate.Network stateNetwork : yangNetworkStates.network()) {
+            if (stateNetwork.networkRef().equals(network.networkId())) {
+                return stateNetwork;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Networks object conversion from YANG to TE Topology subsystem.
+     *
+     * @param yangNetworks Networks YANG object
+     * @param yangNetworkStates NetworkStates YANG object
+     * @return teSubsystem TE Topology subsystem networks object
+     */
+    public static org.onosproject.tetopology.management.api.Networks yang2TeSubsystemNetworks(
+            Networks yangNetworks, NetworksState yangNetworkStates) {
+        checkNotNull(yangNetworks, E_NULL_YANG_NETWORKS);
+        checkNotNull(yangNetworks.network(), E_NULL_YANG_NETWORK_LIST);
+        checkNotNull(yangNetworkStates, E_NULL_YANG_NETWORKSSTATE);
+
+        org.onosproject.tetopology.management.api.DefaultNetworks defaultNetworks =
+                new org.onosproject.tetopology.management.api.DefaultNetworks();
+        List<org.onosproject.tetopology.management.api.Network> networks = Lists.newArrayList();
+        for (Network network : yangNetworks.network()) {
+            org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+                    .ietfnetwork.networksstate.Network stateNetwork =
+                            networkStateNetwork(network, yangNetworkStates);
+            org.onosproject.tetopology.management.api.Network teNetwork;
+            if (stateNetwork == null) {
+                log.info("networkId {} can't be found in yangNetworkStates",
+                          network.networkId());
+                teNetwork = yang2TeSubsystemNetwork(network);
+            } else {
+                teNetwork = yang2TeSubsystemNetwork(network, stateNetwork);
+            }
+            networks.add(teNetwork);
+        }
+
+        defaultNetworks.setNetworks(networks);
+        return defaultNetworks;
+    }
+
+    private static DefaultNetwork.OnosYangNodeOperationType toNetworkOperationType(OperationType operation) {
+        switch (operation) {
+        case CREATE:
+            return DefaultNetwork.OnosYangNodeOperationType.CREATE;
+
+        case DELETE:
+            return DefaultNetwork.OnosYangNodeOperationType.DELETE;
+
+        case REMOVE:
+            return DefaultNetwork.OnosYangNodeOperationType.REMOVE;
+
+        case MERGE:
+            return DefaultNetwork.OnosYangNodeOperationType.MERGE;
+
+        case REPLACE:
+            return DefaultNetwork.OnosYangNodeOperationType.REPLACE;
+
+        default:
+            return DefaultNetwork.OnosYangNodeOperationType.NONE;
+        }
+    }
+
+    private static NetworkBuilder te2YangSupportingNetwork(NetworkBuilder builder,
+                                                           List<KeyId> teSpptNetworkIds) {
+        List<SupportingNetwork> snws = Lists.newArrayList();
+        SupportingNetworkBuilder spNetworkBuilder = DefaultSupportingNetwork.builder();
+        for (KeyId teSpNwKey : teSpptNetworkIds) {
+            snws.add(spNetworkBuilder
+                    .networkRef(NetworkId.fromString(teSpNwKey.toString()))
+                    .build());
+        }
+        return builder.supportingNetwork(snws);
+    }
+
+    private static NetworkBuilder te2YangNodes(NetworkBuilder builder,
+                                               List<NetworkNode> teNodes) {
+        List<Node> nodeList = Lists.newArrayList();
+        // Add each node
+        for (org.onosproject.tetopology.management.api.node.NetworkNode node : teNodes) {
+            // Convert the te node to a YO.
+            nodeList.add(NodeConverter.teSubsystem2YangNode(node));
+        }
+        return builder.node(nodeList);
+    }
+
+    private static NetworkBuilder te2YangLinks(NetworkBuilder builder,
+                                               List<NetworkLink> teLinks) {
+        List<Link> linkList = Lists.newArrayList();
+        // Add each link
+        for (org.onosproject.tetopology.management.api.link.NetworkLink link : teLinks) {
+            // Convert the te link to a YO
+            linkList.add(LinkConverter.teSubsystem2YangLink(link));
+        }
+        AugmentedNdNetworkBuilder ndAugment = DefaultAugmentedNdNetwork.builder();
+        ndAugment.link(linkList);
+        builder.addYangAugmentedInfo(ndAugment.build(), AugmentedNdNetwork.class);
+        return builder;
+    }
+
+    private static NetworkBuilder te2YangNetworkType(NetworkBuilder builder,
+                org.onosproject.tetopology.management.api.TeTopologyId teTopologyId) {
+        NetworkTypes.NetworkTypesBuilder nwType = DefaultNetworkTypes.builder();
+        if (teTopologyId != null) {
+            // Set "te-topology" network type.
+            TeTopology.TeTopologyBuilder teTopology = DefaultTeTopology.builder();
+            AugmentedNwNetworkTypes.AugmentedNwNetworkTypesBuilder teNwType =
+                    DefaultAugmentedNwNetworkTypes.builder();
+            teNwType.teTopology(teTopology.build());
+            nwType.addYangAugmentedInfo(teNwType.build(), AugmentedNwNetworkTypes.class);
+        }
+        return builder.networkTypes(nwType.build());
+    }
+
+    private static NetworkBuilder te2YangTopologyIds(NetworkBuilder builder,
+            org.onosproject.tetopology.management.api.TeTopologyId teTopologyId) {
+        Te.TeBuilder teBuilder = DefaultTe.builder();
+        teBuilder.clientId(new TeGlobalId(teTopologyId.clientId()));
+        teBuilder.providerId(new TeGlobalId(teTopologyId.providerId()));
+        if (teTopologyId.topologyId() !=  null) {
+            teBuilder.teTopologyId(new TeTopologyId(teTopologyId.topologyId()));
+        }
+
+        AugmentedNwNetwork.AugmentedNwNetworkBuilder nwAugment = DefaultAugmentedNwNetwork
+                .builder();
+        nwAugment.te(teBuilder.build());
+        builder.addYangAugmentedInfo(nwAugment.build(),
+                                            AugmentedNwNetwork.class);
+        return builder;
+    }
+
+    /**
+     * Network object conversion from TE Topology subsystem to YANG.
+     *
+     * @param teSubsystem TE Topology subsystem network object
+     * @param operation operation type
+     * @return Network YANG object
+     */
+    public static Network teSubsystem2YangNetwork(
+            org.onosproject.tetopology.management.api.Network teSubsystem,
+            OperationType operation) {
+        checkNotNull(teSubsystem, E_NULL_TE_NETWORK);
+        checkNotNull(teSubsystem.networkId(), E_NULL_TE_NETWORKID);
+
+        // Generate a network builder with the specific networkId.
+        NetworkId networkId = NetworkId.fromString(teSubsystem.networkId().toString());
+        NetworkBuilder builder = DefaultNetwork.builder()
+                                               .onosYangNodeOperationType(
+                                                       toNetworkOperationType(operation))
+                                               .networkId(networkId);
+
+        // Supporting networks
+        if (teSubsystem.getSupportingNetworkIds() != null) {
+            builder = te2YangSupportingNetwork(builder, teSubsystem.getSupportingNetworkIds());
+        }
+
+        // Nodes
+        if (teSubsystem.getNodes() != null) {
+            builder = te2YangNodes(builder, teSubsystem.getNodes());
+        }
+
+        // Network types
+        builder = te2YangNetworkType(builder, teSubsystem.getTeTopologyId());
+
+        // Add links - link is the augmentation
+        if (teSubsystem.getLinks() != null) {
+            builder = te2YangLinks(builder, teSubsystem.getLinks());
+        }
+
+        // TE Topology IDs
+        if (teSubsystem.getTeTopologyId() != null) {
+            builder = te2YangTopologyIds(builder, teSubsystem.getTeTopologyId());
+        }
+
+        return builder.build();
+    }
+
+    /**
+     * Network State object conversion from TE Topology subsystem to YANG.
+     *
+     * @param teSubsystem TE Topology subsystem network object
+     * @param operation operation type
+     * @return Network YANG object
+     */
+    public static org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network
+                        .rev20151208.ietfnetwork.networksstate.Network
+            teSubsystem2YangNetworkState(
+                    org.onosproject.tetopology.management.api.Network teSubsystem,
+                    OperationType operation) {
+        checkNotNull(teSubsystem, E_NULL_TE_NETWORK);
+        checkNotNull(teSubsystem.networkId(), E_NULL_TE_NETWORKID);
+
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+                .ietfnetwork.networksstate.Network.NetworkBuilder stateBuilder =
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+                .ietfnetwork.networksstate.DefaultNetwork.builder();
+
+        if (teSubsystem.networkId() != null) {
+            stateBuilder.networkRef(NetworkId.fromString(teSubsystem.networkId().toString()));
+        }
+        stateBuilder.serverProvided(teSubsystem.isServerProvided());
+
+        // Operation type may be required.
+        return stateBuilder.build();
+    }
+
+
+    /**
+     * Network conversion from YANG to TE Topology subsystem.
+     *
+     * @param yangNetwork Network YANG object
+     * @return TE Topology subsystem defaultNetwork object
+     */
+    private static org.onosproject.tetopology.management.api.DefaultNetwork yang2TeDefaultNetwork(
+            Network yangNetwork) {
+        checkNotNull(yangNetwork, E_NULL_YANG_NETWORK);
+        checkNotNull(yangNetwork.networkId(), E_NULL_YANG_NETWORKID);
+        String networkId = yangNetwork.networkId().uri().string();
+        org.onosproject.tetopology.management.api.DefaultNetwork teNetwork =
+                new org.onosproject.tetopology.management.api.DefaultNetwork(KeyId.keyId(networkId));
+
+        // Supporting networks
+        if (yangNetwork.supportingNetwork() != null) {
+            List<KeyId> supportingNetworkIds = Lists.newArrayList();
+            for (SupportingNetwork supportNw : yangNetwork.supportingNetwork()) {
+                supportingNetworkIds.add(
+                        KeyId.keyId(supportNw.networkRef().uri().string()));
+            }
+            teNetwork.setSupportingNetworkIds(supportingNetworkIds);
+        }
+
+        // Nodes
+        if (yangNetwork.node() != null) {
+            List<org.onosproject.tetopology.management.api.node.NetworkNode>
+                teNodes = Lists.newArrayList();
+            for (Node node : yangNetwork.node()) {
+                // Convert the Yang Node to a TE node.
+                teNodes.add(NodeConverter.yang2TeSubsystemNode(node, yangNetwork.networkId()));
+            }
+            teNetwork.setNodes(teNodes);
+        }
+
+        // Links
+        if (yangNetwork.yangAugmentedInfo(AugmentedNdNetwork.class) != null) {
+            AugmentedNdNetwork augmentLink =
+                    (AugmentedNdNetwork) yangNetwork.yangAugmentedInfo(AugmentedNdNetwork.class);
+            List<org.onosproject.tetopology.management.api.link.NetworkLink>
+                teLinks = Lists.newArrayList();
+            for (Link link : augmentLink.link()) {
+                // Convert the Yang Link to a TE link.
+                teLinks.add(LinkConverter.yang2TeSubsystemLink(link, yangNetwork.networkId()));
+            }
+            teNetwork.setLinks(teLinks);
+        }
+
+        // TE Topology Ids
+        if (yangNetwork.yangAugmentedInfo(AugmentedNwNetwork.class) != null) {
+            AugmentedNwNetwork augmentTeIds =
+                    (AugmentedNwNetwork) yangNetwork.yangAugmentedInfo(AugmentedNwNetwork.class);
+            org.onosproject.tetopology.management.api.TeTopologyId teTopologyId =
+                    new org.onosproject.tetopology.management.api.TeTopologyId(
+                            augmentTeIds.te().clientId().uint32(),
+                            augmentTeIds.te().providerId().uint32(),
+                            augmentTeIds.te().teTopologyId().string());
+
+            teNetwork.setTeTopologyId(teTopologyId);
+        }
+
+        return teNetwork;
+    }
+
+    /**
+     * Network object conversion from YANG to TE Topology subsystem.
+     *
+     * @param yangNetwork Network YANG object
+     * @return network TE Topology subsystem networks object
+     */
+    public static org.onosproject.tetopology.management.api.Network yang2TeSubsystemNetwork(Network yangNetwork) {
+       return yang2TeDefaultNetwork(yangNetwork);
+    }
+
+    /**
+     * Network and State object conversion from YANG to TE Topology subsystem.
+     *
+     * @param yangNetwork Network YANG object
+     * @param yangNetworkState NetworkState YANG object
+     * @return teSubsystem TE Topology subsystem networks object
+     */
+    public static org.onosproject.tetopology.management.api.Network yang2TeSubsystemNetwork(Network yangNetwork,
+            org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork
+                    .networksstate.Network yangNetworkState) {
+        org.onosproject.tetopology.management.api.DefaultNetwork teNetwork =
+                yang2TeDefaultNetwork(yangNetwork);
+
+        checkNotNull(yangNetworkState, E_NULL_YANG_NETWORKSSTATE_NETWORK);
+        checkNotNull(yangNetworkState.networkRef(), E_NULL_YANG_NETWORKSSTATE_NETWORKREF);
+        String networkref = yangNetworkState.networkRef().uri().string();
+        checkState(teNetwork.networkId().toString().equals(networkref),
+                   E_DIFF_YANG_NETWORKID);
+
+        teNetwork.setServerProvided(yangNetworkState.serverProvided());
+
+        return teNetwork;
+    }
+}
+
+
diff --git a/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/NodeConverter.java b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/NodeConverter.java
new file mode 100644
index 0000000..0af2b13
--- /dev/null
+++ b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/NodeConverter.java
@@ -0,0 +1,567 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.teyang.utils.topology;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.KeyId;
+import org.onosproject.tetopology.management.api.node.InterfaceSwitchingCapability;
+import org.onosproject.tetopology.management.api.node.NetworkNodeKey;
+import org.onosproject.tetopology.management.api.node.TeNetworkTopologyId;
+import org.onosproject.tetopology.management.api.node.TeNode;
+import org.onosproject.tetopology.management.api.node.TerminationCapability;
+import org.onosproject.tetopology.management.api.node.TerminationPoint;
+import org.onosproject.tetopology.management.api.node.TerminationPointKey;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev20130715.ietfinettypes.DomainName;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.NetworkId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.NodeId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+               .ietfnetwork.networks.network.DefaultNode;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+               .ietfnetwork.networks.network.Node;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+               .ietfnetwork.networks.network.node.DefaultSupportingNode;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208
+               .ietfnetwork.networks.network.node.SupportingNode;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.TpId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.node.AugmentedNdNode;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.node.DefaultAugmentedNdNode;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.AugmentedNwNode;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.DefaultAugmentedNwNode;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.DefaultTe;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.DefaultTe.TeBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.Te;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.Config;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.DefaultConfig;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.DefaultState;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.DefaultTunnelTerminationPoint;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.State;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.TunnelTerminationPoint;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.config.DefaultTeNodeAttributes;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.config.TeNodeAttributes;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.config.tenodeattributes.ConnectivityMatrix;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.config.tenodeattributes
+                       .DefaultConnectivityMatrix;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+              .ietftetopology.networks.network.node.augmentednwnode.te.config.tenodeattributes.DefaultUnderlayTopology;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.config.tenodeattributes.UnderlayTopology;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.config.tenodeattributes
+                       .connectivitymatrix.DefaultFrom;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.config.tenodeattributes
+                       .connectivitymatrix.DefaultTo;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.augmentednwnode.te.tunnelterminationpoint
+                       .config.DefaultTerminationCapability;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.TeNodeId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.TeTopologyId;
+
+import com.google.common.collect.Lists;
+
+/**
+ * Node conversion functions.
+ */
+public final class NodeConverter {
+
+    private static final String E_NULL_TE_SUBSYSTEM_TE_NODE = "TeSubsystem teNode object cannot be null";
+    private static final String E_NULL_TE_SUBSYSTEM_TE_TUNNEL_TP = "TeSubsystem teTunnelTp object cannot be null";
+    private static final String E_NULL_TE_SUBSYSTEM_NODE = "TeSubsystem ndoe object cannot be null";
+    private static final String E_NULL_YANG_NODE = "Yang node object cannot be null";
+
+    // no instantiation
+    private NodeConverter() {
+    }
+
+    /**
+     * TE Node Config object conversion from TE Topology subsystem to YANG.
+     *
+     * @param teSubsystemTeNode TE node object
+     * @return TE Node Config YANG object
+     */
+    private static Config teNode2YangConfig(TeNode teSubsystemTeNode) {
+        checkNotNull(teSubsystemTeNode, E_NULL_TE_SUBSYSTEM_TE_NODE);
+
+        TeNodeAttributes.TeNodeAttributesBuilder teNodeAttributesConfigBuilder =
+                DefaultTeNodeAttributes.builder()
+                                       .isAbstract(teSubsystemTeNode.isAbstract());
+        if (teSubsystemTeNode.adminStatus() != null) {
+            teNodeAttributesConfigBuilder = teNodeAttributesConfigBuilder
+                    .adminStatus(EnumConverter
+                            .teSubsystem2YangAdminStatus(teSubsystemTeNode
+                            .adminStatus()));
+        }
+
+        if (teSubsystemTeNode.name() != null) {
+            teNodeAttributesConfigBuilder = teNodeAttributesConfigBuilder
+                    .name(DomainName.fromString(teSubsystemTeNode.name()));
+        }
+
+        if (teSubsystemTeNode.underlayTopology() != null) {
+            teNodeAttributesConfigBuilder = teNodeAttributesConfigBuilder
+                    .underlayTopology(teNode2YangUnderlayConfig(teSubsystemTeNode.underlayTopology()));
+        }
+
+        if (teSubsystemTeNode.connectivityMatrices() != null) {
+            ConnectivityMatrix.ConnectivityMatrixBuilder connectivityMatrixConfigBuilder =
+                    DefaultConnectivityMatrix.builder();
+            for (org.onosproject.tetopology.management.api.node.ConnectivityMatrix teCm : teSubsystemTeNode.
+                    connectivityMatrices()) {
+                connectivityMatrixConfigBuilder = connectivityMatrixConfigBuilder
+                        .id(teCm.id())
+                        .isAllowed(teCm.isAllowed())
+                        .from(new DefaultFrom.FromBuilder()
+                                .tpRef(TpId.fromString(teCm.from().tpId()
+                                        .toString()))
+                                .build())
+                        .to(new DefaultTo.ToBuilder()
+                                .tpRef(TpId.fromString(teCm.to().tpId()
+                                        .toString()))
+                                .build());
+                teNodeAttributesConfigBuilder = teNodeAttributesConfigBuilder
+                        .addToConnectivityMatrix(connectivityMatrixConfigBuilder
+                                .build());
+            }
+        }
+
+
+        Config.ConfigBuilder yangConfigBuilder = DefaultConfig.builder();
+        yangConfigBuilder = yangConfigBuilder.teNodeAttributes(teNodeAttributesConfigBuilder.build());
+
+        return yangConfigBuilder.build();
+    }
+
+    private static UnderlayTopology teNode2YangUnderlayConfig(TeNetworkTopologyId underlayTopology) {
+        UnderlayTopology.UnderlayTopologyBuilder underlayConfigBuilder = DefaultUnderlayTopology
+                .builder()
+                .networkIdRef(NetworkId.fromString(underlayTopology.getNetworkId().toString()))
+                .teTopologyIdRef(TeTopologyId
+                        .fromString(underlayTopology
+                                .getTopologyId().topologyId()));
+        return underlayConfigBuilder.build();
+    }
+
+    /**
+     * TE Node State object conversion from TE Topology subsystem to YANG.
+     *
+     * @param teSubsystemTeNode TE node object
+     * @return TE Node State YANG object
+     */
+    private static State teNode2YangState(TeNode teSubsystemTeNode) {
+        checkNotNull(teSubsystemTeNode, E_NULL_TE_SUBSYSTEM_TE_NODE);
+
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.ietftetopology
+                .networks.network.node.augmentednwnode.te.state.TeNodeAttributes
+                        .TeNodeAttributesBuilder teNodeAttributesStateBuilder =
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.ietftetopology
+                .networks.network.node.augmentednwnode.te.state.DefaultTeNodeAttributes.builder()
+                .isAbstract(teSubsystemTeNode.isAbstract());
+
+        if (teSubsystemTeNode.adminStatus() != null) {
+            teNodeAttributesStateBuilder = teNodeAttributesStateBuilder
+                    .adminStatus(EnumConverter
+                            .teSubsystem2YangAdminStatus(teSubsystemTeNode
+                            .adminStatus()));
+        }
+
+        if (teSubsystemTeNode.name() != null) {
+            teNodeAttributesStateBuilder = teNodeAttributesStateBuilder
+                    .name(DomainName.fromString(teSubsystemTeNode.name()));
+        }
+
+        if (teSubsystemTeNode.underlayTopology() != null) {
+            org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.ietftetopology
+                    .networks.network.node.augmentednwnode.te.state.tenodeattributes.UnderlayTopology.
+                            UnderlayTopologyBuilder underlayStateBuilder =
+            org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.ietftetopology
+                    .networks.network.node.augmentednwnode.te.state.tenodeattributes.DefaultUnderlayTopology
+                            .builder();
+            underlayStateBuilder = underlayStateBuilder
+                    .networkIdRef(NetworkId.fromString(teSubsystemTeNode
+                                                       .underlayTopology().getNetworkId().toString()))
+                    .teTopologyIdRef(TeTopologyId.fromString(teSubsystemTeNode
+                                                             .underlayTopology().getTopologyId().topologyId()));
+            teNodeAttributesStateBuilder = teNodeAttributesStateBuilder
+                    .underlayTopology(underlayStateBuilder.build());
+        }
+
+        if (teSubsystemTeNode.connectivityMatrices() != null) {
+            org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.ietftetopology
+            .networks.network.node.augmentednwnode.te.state.tenodeattributes.ConnectivityMatrix
+            .ConnectivityMatrixBuilder
+            connectivityMatrixStateBuilder = org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf
+            .te.topology.rev20160708.ietftetopology.networks.network.node.augmentednwnode
+            .te.state.tenodeattributes.DefaultConnectivityMatrix
+                    .builder();
+            for (org.onosproject.tetopology.management.api.node.ConnectivityMatrix teCm : teSubsystemTeNode
+                    .connectivityMatrices()) {
+                connectivityMatrixStateBuilder = connectivityMatrixStateBuilder
+                        .id(teCm.id())
+                        .isAllowed(teCm.isAllowed())
+                        .from(new org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                                .rev20160708.ietftetopology.networks.network.node.augmentednwnode.te.state
+                                .tenodeattributes.connectivitymatrix.DefaultFrom.FromBuilder()
+                                .tpRef(TpId.fromString(teCm.from().tpId()
+                                        .toString()))
+                                .build())
+                        .to(new org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                            .rev20160708.ietftetopology.networks.network.node.augmentednwnode.te.state
+                            .tenodeattributes.connectivitymatrix.DefaultTo.ToBuilder()
+                                .tpRef(TpId.fromString(teCm.to().tpId()
+                                        .toString()))
+                                .build());
+                teNodeAttributesStateBuilder = teNodeAttributesStateBuilder
+                        .addToConnectivityMatrix(connectivityMatrixStateBuilder
+                                .build());
+            }
+        }
+
+        State.StateBuilder yangStateBuilder = DefaultState.builder();
+        yangStateBuilder = yangStateBuilder.teNodeAttributes(teNodeAttributesStateBuilder.build());
+
+        if (teSubsystemTeNode.opStatus() != null) {
+            yangStateBuilder = yangStateBuilder.operStatus(EnumConverter
+                    .teSubsystem2YangOperStatus(teSubsystemTeNode
+                            .opStatus()));
+        }
+
+        return yangStateBuilder.build();
+    }
+
+    /**
+     * TE Node TunnelTerminationPoint object conversion from TE Topology subsystem to YANG.
+     *
+     * @param teTunnelTp TE TunnelTerminationPoint object
+     * @return TunnelTerminationPoint YANG object
+     */
+    private static TunnelTerminationPoint teSubsystem2YangTtp(
+                           org.onosproject.tetopology.management.api.node.TunnelTerminationPoint teTunnelTp) {
+        checkNotNull(teTunnelTp, E_NULL_TE_SUBSYSTEM_TE_TUNNEL_TP);
+
+        TunnelTerminationPoint.TunnelTerminationPointBuilder tunnelTpBuilder =
+                DefaultTunnelTerminationPoint.builder().tunnelTpId(teTunnelTp.getTunnelTpId());
+
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                .ietftetopology.networks.network.node.augmentednwnode.te.tunnelterminationpoint
+                        .Config.ConfigBuilder ttpConfigBuilder =
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                .ietftetopology.networks.network.node.augmentednwnode.te.tunnelterminationpoint
+                        .DefaultConfig.builder();
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                .ietftetopology.networks.network.node.augmentednwnode.te.tunnelterminationpoint
+                        .State.StateBuilder ttpStateBuilder =
+        org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                .ietftetopology.networks.network.node.augmentednwnode.te.tunnelterminationpoint
+                        .DefaultState.builder();
+
+        if (Long.valueOf(teTunnelTp.getInterLayerLockId()) != null) {
+            ttpConfigBuilder = ttpConfigBuilder.interLayerLockId(teTunnelTp.getInterLayerLockId());
+            ttpStateBuilder  = ttpStateBuilder.interLayerLockId(teTunnelTp.getInterLayerLockId());
+        }
+
+        if (teTunnelTp.getSwitchingCapabilities() != null) {
+            // FIXME: switchingCapabilities is a list in
+            // teSubsystem, but is not a list in yang. how to handle
+            // this?
+            for (InterfaceSwitchingCapability iscTe : teTunnelTp.getSwitchingCapabilities()) {
+                // ttpConfigBuilder =
+                // ttpConfigBuilder.switchingCapability(switchingCapability)
+                // ttpStateBuilder =
+                // ttpStateBuilder.switchingCapability(switchingCapability)
+            }
+        }
+
+        if (teTunnelTp.getTerminationCapabilities() != null) {
+            for (TerminationCapability tcap : teTunnelTp.getTerminationCapabilities()) {
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                        .ietftetopology.networks.network.node.augmentednwnode.te.tunnelterminationpoint.config
+                                .TerminationCapability.TerminationCapabilityBuilder
+                tcapConfigBuilder = DefaultTerminationCapability.builder();
+                // FIXME: at this moment, tcap does not have any getter or setter.
+                // add the following getLinkTpId possibly other attributes to Core data structure
+                // tcapConfigBuilder =
+                // tcapConfigBuilder.linkTp(TpId.fromString(tcap.getLinkTpId.toString()));
+                ttpConfigBuilder = ttpConfigBuilder.addToTerminationCapability(tcapConfigBuilder.build());
+
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                        .ietftetopology.networks.network.node.augmentednwnode.te.tunnelterminationpoint.state
+                                .TerminationCapability.TerminationCapabilityBuilder tcapStateBuilder =
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                        .ietftetopology.networks.network.node.augmentednwnode.te.tunnelterminationpoint.state
+                                .DefaultTerminationCapability.builder();
+                // FIXME: at this moment, tcap does not have any getter or setter.
+                // add the following getLinkTpId possibly other attributes to Core data structure
+                // tcapConfigBuilder =
+                // tcapConfigBuilder.linkTp(TpId.fromString(tcap.getLinkTpId.toString()));
+                ttpStateBuilder = ttpStateBuilder.addToTerminationCapability(tcapStateBuilder.build());
+            }
+        }
+
+        tunnelTpBuilder = tunnelTpBuilder.config(ttpConfigBuilder.build())
+                                         .state(ttpStateBuilder.build());
+
+        return tunnelTpBuilder.build();
+    }
+
+    /**
+     * Node object conversion from TE Topology subsystem to YANG.
+     *
+     * @param teSubsystem TE subsystem node object
+     * @return YANG node object
+     */
+    public static Node teSubsystem2YangNode(org.onosproject.tetopology.management.api.node.NetworkNode teSubsystem) {
+        checkNotNull(teSubsystem, E_NULL_TE_SUBSYSTEM_NODE);
+
+        NodeId nodeId = NodeId.fromString(teSubsystem.nodeId().toString());
+        Node.NodeBuilder builder = DefaultNode.builder().nodeId(nodeId);
+
+        if (teSubsystem.getSupportingNodeIds() != null) {
+            List<SupportingNode> sNodes = Lists.newArrayList();
+            SupportingNode.SupportingNodeBuilder spNodeBuilder = DefaultSupportingNode
+                    .builder();
+            for (NetworkNodeKey nodeKey : teSubsystem.getSupportingNodeIds()) {
+                sNodes.add(spNodeBuilder
+                        .networkRef(NetworkId
+                                .fromString(nodeKey.networkId().toString()))
+                        .nodeRef(NodeId.fromString(nodeKey.nodeId().toString()))
+                        .build());
+            }
+            builder = builder.supportingNode(sNodes);
+        }
+
+        if (teSubsystem.getTerminationPoints() != null) {
+            AugmentedNdNode.AugmentedNdNodeBuilder tpAugmentBuilder = DefaultAugmentedNdNode
+                    .builder();
+            List<TerminationPoint> teSubsystemTeTp = teSubsystem
+                    .getTerminationPoints();
+            for (TerminationPoint teTp : teSubsystemTeTp) {
+                tpAugmentBuilder.addToTerminationPoint(TerminationPointConverter
+                        .teSubsystem2YangTerminationPoint(teTp));
+            }
+            builder.addYangAugmentedInfo(tpAugmentBuilder.build(),
+                                         AugmentedNdNode.class);
+        }
+
+        if (teSubsystem.getTe() != null) {
+            AugmentedNwNode.AugmentedNwNodeBuilder nodeAugmentBuilder = DefaultAugmentedNwNode
+                    .builder();
+
+            TeNode teSubsystemTeNode = teSubsystem.getTe();
+
+            TeBuilder yangTeBuilder = DefaultTe.builder();
+
+            if (teSubsystemTeNode.teNodeId() != null) {
+                yangTeBuilder = yangTeBuilder.teNodeId(TeNodeId
+                        .fromString(teSubsystemTeNode.teNodeId().toString()));
+            }
+
+            // Set configuration data
+            // Set state data
+            yangTeBuilder = yangTeBuilder.config(teNode2YangConfig(teSubsystemTeNode))
+                                         .state(teNode2YangState(teSubsystemTeNode));
+
+            if (teSubsystemTeNode.tunnelTerminationPoints() != null) {
+                for (org.onosproject.tetopology.management.api.node.TunnelTerminationPoint
+                        teTunnelTp : teSubsystemTeNode.tunnelTerminationPoints()) {
+                    yangTeBuilder = yangTeBuilder.addToTunnelTerminationPoint(teSubsystem2YangTtp(teTunnelTp));
+                }
+            }
+
+            nodeAugmentBuilder = nodeAugmentBuilder.te(yangTeBuilder.build());
+            builder.addYangAugmentedInfo(nodeAugmentBuilder.build(),
+                                         AugmentedNwNode.class);
+        }
+        return builder.build();
+    }
+
+    /**
+     * Node object conversion from YANG to TE Topology subsystem.
+     *
+     * @param yangNode YANG node object
+     * @param yangNetworkId YANG networkId object
+     * @return TE subsystem node object
+     */
+    public static org.onosproject.tetopology.management.api.node.NetworkNode
+                      yang2TeSubsystemNode(Node yangNode, NetworkId yangNetworkId) {
+        checkNotNull(yangNode, E_NULL_YANG_NODE);
+
+        org.onosproject.tetopology.management.api.node.DefaultNetworkNode node =
+                new org.onosproject.tetopology.management.api.node.DefaultNetworkNode(
+                       KeyId.keyId(yangNode.nodeId().uri().string()));
+
+        if (yangNode.supportingNode() != null) {
+            List<NetworkNodeKey> spNodes = Lists.newArrayList();
+            for (SupportingNode yangSpNode : yangNode.supportingNode()) {
+                NetworkNodeKey nodeKey = new NetworkNodeKey(KeyId.keyId(yangSpNode.nodeRef().uri().toString()),
+                                                            KeyId.keyId(yangSpNode.networkRef().uri().toString()));
+                spNodes.add(nodeKey);
+            }
+            node.setSupportingNodeIds(spNodes);
+        }
+
+        if (yangNode.yangAugmentedInfoMap() != null
+                && !yangNode.yangAugmentedInfoMap().isEmpty()) {
+
+            AugmentedNdNode yangTpNodeAugment = (AugmentedNdNode) yangNode
+                    .yangAugmentedInfo(AugmentedNdNode.class);
+            if (yang2TeSubsystemTpNodeAugment(yangTpNodeAugment) != null) {
+                node.setTerminationPoints(yang2TeSubsystemTpNodeAugment(yangTpNodeAugment));
+            }
+
+            AugmentedNwNode yangNodeAugment = (AugmentedNwNode) yangNode
+                    .yangAugmentedInfo(AugmentedNwNode.class);
+            if (yangNodeAugment != null && yangNodeAugment.te() != null && yangNodeAugment.te().teNodeId() != null) {
+                Te yangNodeAugTe = yangNodeAugment.te();
+                TeNode teNode = yang2TeSubsystemNodeAugment(yangNodeAugTe, yangNetworkId, yangNode.nodeId());
+                node.setTe(teNode);
+            }
+        }
+
+        return node;
+    }
+
+    private static TeNode yang2TeSubsystemNodeConnectivityMatrix(TeNode teNode,
+            String networkId, String nodeId, List<ConnectivityMatrix> yangMatrix) {
+        List<org.onosproject.tetopology.management.api.node.ConnectivityMatrix> teCmList =
+                Lists.newArrayList();
+        for (ConnectivityMatrix cmYang : yangMatrix) {
+            Long id = cmYang.id();
+            TerminationPointKey from = new TerminationPointKey(
+                                           KeyId.keyId(networkId),
+                                           KeyId.keyId(nodeId),
+                                           KeyId.keyId(cmYang.from().tpRef().uri().toString()));
+            TerminationPointKey to = new TerminationPointKey(
+                                           KeyId.keyId(networkId),
+                                           KeyId.keyId(nodeId),
+                                           KeyId.keyId(cmYang.to().tpRef().uri().toString()));
+            boolean isAllowed = cmYang.isAllowed();
+            org.onosproject.tetopology.management.api.node.ConnectivityMatrix cmTe =
+                    new org.onosproject.tetopology.management.api.node.ConnectivityMatrix(
+                            id, from, to, isAllowed);
+            teCmList.add(cmTe);
+        }
+        teNode.setConnectivityMatrices(teCmList);
+        return teNode;
+    }
+
+    private static TeNode yang2TeSubsystemNodeUnderlayTopology(TeNode teNode,
+                                                               UnderlayTopology ut) {
+        TeNetworkTopologyId underlayTopology =
+                new TeNetworkTopologyId(KeyId.keyId(ut.networkIdRef().uri().toString()),
+                new org.onosproject.tetopology.management.api.TeTopologyId(
+                            ut.providerIdRef().uint32(),
+                            ut.clientIdRef().uint32(),
+                            ut.teTopologyIdRef().toString()));
+        teNode.setUnderlayTopology(underlayTopology);
+        return teNode;
+    }
+
+    private static TeNode yang2TeSubsystemTtp(TeNode teNode,
+                                              List<TunnelTerminationPoint> ttps) {
+        List<org.onosproject.tetopology.management.api.node.TunnelTerminationPoint> ttpTeList =
+                Lists.newArrayList();
+        for (TunnelTerminationPoint ttpYang : ttps) {
+            org.onosproject.tetopology.management.api.node.TunnelTerminationPoint ttpTe =
+                    new org.onosproject.tetopology.management.api.node.TunnelTerminationPoint(
+                            ttpYang.tunnelTpId());
+            ttpTe.setInterLayerLockId(ttpYang.config().interLayerLockId());
+            // FIXME: go through
+            // ttpYang.config().switchingCapability() and populate
+            // ttpTe.setSwitchingCapabilities(switchingCapabilities);
+            // FIXME: go through
+            // ttpYang.config().terminationCapability() and populate
+            // ttpTe.setTerminationCapability(terminationCapability);
+            ttpTeList.add(ttpTe);
+        }
+        teNode.setTunnelTerminationPoints(ttpTeList);
+
+        return teNode;
+    }
+
+    private static TeNode yang2TeSubsystemNodeAugment(Te yangNodeAugTe,
+            NetworkId yangNetworkId, NodeId yangNodeId) {
+        TeNode teNode = new TeNode(yangNodeAugTe.teNodeId().toString());
+        Config ynodeAugCfg = yangNodeAugTe.config();
+        if (ynodeAugCfg != null) {
+            TeNodeAttributes teNodeAttr = ynodeAugCfg.teNodeAttributes();
+            if (teNodeAttr != null) {
+                teNode.setAbstract(teNodeAttr.isAbstract());
+
+                if (teNodeAttr.adminStatus() != null) {
+                    teNode.setAdminStatus(EnumConverter.yang2TeSubsystemAdminStatus(
+                                                            ynodeAugCfg.teNodeAttributes().adminStatus()));
+                }
+
+                if (yangNodeAugTe.state() != null &&
+                        yangNodeAugTe.state().operStatus() != null) {
+                    teNode.setOpStatus(EnumConverter.yang2TeSubsystemOpStatus(
+                                                         yangNodeAugTe.state().operStatus()));
+                }
+
+                if (teNodeAttr.connectivityMatrix() != null) {
+                    teNode = yang2TeSubsystemNodeConnectivityMatrix(teNode,
+                                                                    yangNetworkId.uri().toString(),
+                                                                    yangNodeId.uri().toString(),
+                                                                    teNodeAttr.connectivityMatrix());
+                }
+
+                if (teNodeAttr.underlayTopology() != null) {
+                    teNode = yang2TeSubsystemNodeUnderlayTopology(teNode,
+                                                                  teNodeAttr.underlayTopology());
+                }
+            }
+        }
+
+        if (yangNodeAugTe.tunnelTerminationPoint() != null) {
+            teNode = yang2TeSubsystemTtp(teNode, yangNodeAugTe.tunnelTerminationPoint());
+        }
+        return teNode;
+    }
+
+    private static List<TerminationPoint> yang2TeSubsystemTpNodeAugment(AugmentedNdNode yangTpNodeAugment) {
+        if (yangTpNodeAugment.terminationPoint() != null) {
+            List<TerminationPoint> teTpList = Lists.newArrayList();
+            for (org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology
+                    .rev20151208.ietfnetworktopology.networks.network.node.augmentedndnode.TerminationPoint
+                    yangTpnode : yangTpNodeAugment.terminationPoint()) {
+                teTpList.add(TerminationPointConverter.yang2teSubsystemTerminationPoint(yangTpnode));
+            }
+            return teTpList;
+        }
+        return null;
+    }
+}
diff --git a/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/TerminationPointConverter.java b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/TerminationPointConverter.java
new file mode 100644
index 0000000..ec74b9e
--- /dev/null
+++ b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/TerminationPointConverter.java
@@ -0,0 +1,225 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.teyang.utils.topology;
+
+import static com.google.common.base.Preconditions.checkNotNull;
+
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.KeyId;
+import org.onosproject.tetopology.management.api.node.TeTerminationPoint;
+import org.onosproject.tetopology.management.api.node.TerminationPointKey;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.NetworkId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev20151208.ietfnetwork.NodeId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.TpId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.node.augmentedndnode.DefaultTerminationPoint;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.node.augmentedndnode.TerminationPoint;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.node.augmentedndnode.terminationpoint
+                       .DefaultSupportingTerminationPoint;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev20151208
+               .ietfnetworktopology.networks.network.node.augmentedndnode.terminationpoint
+                       .SupportingTerminationPoint;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.terminationpoint.augmentedntterminationpoint.DefaultTe;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.terminationpoint.augmentedntterminationpoint.Te.TeBuilder;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.terminationpoint.augmentedntterminationpoint.te.Config;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.terminationpoint.augmentedntterminationpoint.te.DefaultConfig;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.terminationpoint.augmentedntterminationpoint.te.DefaultState;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.terminationpoint.augmentedntterminationpoint.te.State;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.terminationpoint.augmentedntterminationpoint
+                       .te.config.DefaultInterfaceSwitchingCapability;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.terminationpoint.augmentedntterminationpoint
+                       .te.config.InterfaceSwitchingCapability;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.TeTpId;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.terminationpoint.AugmentedNtTerminationPoint;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+               .ietftetopology.networks.network.node.terminationpoint.DefaultAugmentedNtTerminationPoint;
+
+import com.google.common.collect.Lists;
+
+/**
+ * The termination point translations.
+ */
+public final class TerminationPointConverter {
+
+    private static final String E_NULL_TE_SUBSYSTEM_TP = "TeSubsystem terminationPoint object cannot be null";
+    private static final String E_NULL_YANG_TP = "YANG terminationPoint object cannot be null";
+
+    // no instantiation
+    private TerminationPointConverter() {
+    }
+
+    /**
+     * TerminationPoint object translation from TE Topology subsystem to YANG.
+     *
+     * @param teSubsystem TE Topology subsystem termination point object
+     * @return TerminationPoint YANG object
+     */
+    public static TerminationPoint teSubsystem2YangTerminationPoint(
+                                       org.onosproject.tetopology.management.api.node.TerminationPoint teSubsystem) {
+        checkNotNull(teSubsystem, E_NULL_TE_SUBSYSTEM_TP);
+
+        TpId tpId = TpId.fromString(teSubsystem.id().toString());
+        TerminationPoint.TerminationPointBuilder builder =
+                new DefaultTerminationPoint.TerminationPointBuilder().tpId(tpId);
+
+        if (teSubsystem.getSupportingTpIds() != null) {
+            List<SupportingTerminationPoint> tps = Lists.newArrayList();
+            SupportingTerminationPoint.SupportingTerminationPointBuilder
+                    spTpBuilder = DefaultSupportingTerminationPoint.builder();
+            for (TerminationPointKey tpKey : teSubsystem.getSupportingTpIds()) {
+                tps.add(spTpBuilder.networkRef(NetworkId.fromString(tpKey.networkId().toString()))
+                                   .nodeRef(NodeId.fromString(tpKey.nodeId().toString()))
+                                   .tpRef(TpId.fromString(tpKey.tpId().toString()))
+                                   .build());
+            }
+            builder = builder.supportingTerminationPoint(tps);
+        }
+
+        if (teSubsystem.getTe() != null) {
+            AugmentedNtTerminationPoint.AugmentedNtTerminationPointBuilder
+                    tpAugmentBuilder = DefaultAugmentedNtTerminationPoint.builder();
+
+            TeTerminationPoint teSubsystemTe = teSubsystem.getTe();
+            TeBuilder yangTeBuilder = DefaultTe.builder();
+
+            if (teSubsystemTe.teTpId() != null) {
+                yangTeBuilder = yangTeBuilder.teTpId(TeTpId.fromString(teSubsystemTe.teTpId().toString()));
+            }
+
+            Config yConfig = teSubsystem2YangTeAugConfig(teSubsystemTe);
+            yangTeBuilder = yangTeBuilder.config(yConfig);
+
+            State yState = teSubsystem2YangTeAugState(teSubsystemTe);
+            yangTeBuilder = yangTeBuilder.state(yState);
+
+            tpAugmentBuilder = tpAugmentBuilder.te(yangTeBuilder.build());
+            builder.addYangAugmentedInfo(tpAugmentBuilder.build(), AugmentedNtTerminationPoint.class);
+        }
+
+        return builder.build();
+    }
+
+    private static State teSubsystem2YangTeAugState(TeTerminationPoint teSubsystemTe) {
+        State.StateBuilder yangStateBuilder = DefaultState.builder();
+        yangStateBuilder.interLayerLockId(teSubsystemTe.getInterLayerLockId());
+
+        if (teSubsystemTe.interfaceSwitchingCapabilities() != null) {
+            for (org.onosproject.tetopology.management.api.node.InterfaceSwitchingCapability teIsc :
+                    teSubsystemTe.interfaceSwitchingCapabilities()) {
+                org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708
+                    .ietftetopology.networks.network.node.terminationpoint.augmentedntterminationpoint
+                        .te.state.InterfaceSwitchingCapability.InterfaceSwitchingCapabilityBuilder
+                isc = org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology
+                          .rev20160708.ietftetopology.networks.network.node.terminationpoint
+                              .augmentedntterminationpoint.te.state.DefaultInterfaceSwitchingCapability.builder();
+                // FIXME: teIsc at this moment is empty, therefore we cannot
+                // really add its attributes to isc
+                yangStateBuilder.addToInterfaceSwitchingCapability(isc.build());
+            }
+        }
+        return yangStateBuilder.build();
+    }
+
+    private static Config teSubsystem2YangTeAugConfig(TeTerminationPoint teSubsystemTe) {
+        Config.ConfigBuilder yangConfigBuilder = DefaultConfig.builder();
+        yangConfigBuilder = yangConfigBuilder.interLayerLockId(teSubsystemTe.getInterLayerLockId());
+        if (teSubsystemTe.interfaceSwitchingCapabilities() != null) {
+            for (org.onosproject.tetopology.management.api.node.InterfaceSwitchingCapability teIsc :
+                    teSubsystemTe.interfaceSwitchingCapabilities()) {
+                InterfaceSwitchingCapability.InterfaceSwitchingCapabilityBuilder
+                    isc = DefaultInterfaceSwitchingCapability.builder();
+                // FIXME: teIsc at this moment is empty, therefore we cannot
+                // really add its attributes to isc
+                yangConfigBuilder = yangConfigBuilder.addToInterfaceSwitchingCapability(isc.build());
+            }
+        }
+        return yangConfigBuilder.build();
+    }
+
+    /**
+     * TerminationPoint object translation from YANG to TE Topology subsystem.
+     *
+     * @param yangTp TerminationPoint YANG object
+     * @return TerminationPoint TE Topology subsystem termination point object
+     */
+    public static org.onosproject.tetopology.management.api.node.TerminationPoint
+                      yang2teSubsystemTerminationPoint(TerminationPoint yangTp) {
+        checkNotNull(yangTp, E_NULL_YANG_TP);
+
+        org.onosproject.tetopology.management.api.node.DefaultTerminationPoint tp = new org.onosproject.tetopology
+                .management.api.node.DefaultTerminationPoint(KeyId.keyId(yangTp.tpId().uri().string()));
+
+        if (yangTp.supportingTerminationPoint() != null) {
+            List<org.onosproject.tetopology.management.api.node.TerminationPointKey> spTps = Lists.newArrayList();
+            for (SupportingTerminationPoint yangSptp : yangTp.supportingTerminationPoint()) {
+                org.onosproject.tetopology.management.api.node.TerminationPointKey tpKey =
+                        new org.onosproject.tetopology.management.api.node.TerminationPointKey(
+                                KeyId.keyId(yangSptp.networkRef().uri().string()),
+                                KeyId.keyId(yangSptp.nodeRef().uri().string()),
+                                KeyId.keyId(yangSptp.tpRef().uri().string()));
+                spTps.add(tpKey);
+            }
+            tp.setSupportingTpIds(spTps);
+        }
+
+        if (yangTp.yangAugmentedInfoMap() != null && !yangTp.yangAugmentedInfoMap().isEmpty()) {
+            AugmentedNtTerminationPoint yangTpAugment =
+                    (AugmentedNtTerminationPoint) yangTp.yangAugmentedInfo(AugmentedNtTerminationPoint.class);
+            if (yangTpAugment.te() != null && yangTpAugment.te().teTpId() != null) {
+                KeyId teTpId = KeyId.keyId(yangTpAugment.te().teTpId().toString());
+                if (yangTpAugment.te().config() != null) {
+                    long interLayerLockId = yangTpAugment.te().config().interLayerLockId();
+                    List<org.onosproject.tetopology.management.api.node.InterfaceSwitchingCapability>
+                            teIscList = Lists.newArrayList();
+                    // FIXME: the following line is for config. State also has
+                    // similar stuff, but Te Subsystem does not diffrentiate
+                    // between the two
+                    if (yangTpAugment.te().config().interfaceSwitchingCapability() != null) {
+                        for (InterfaceSwitchingCapability iscConfigYang :
+                                yangTpAugment.te().config().interfaceSwitchingCapability()) {
+                            org.onosproject.tetopology.management.api.node.InterfaceSwitchingCapability iscTe =
+                                    new org.onosproject.tetopology.management.api.node.InterfaceSwitchingCapability();
+                            // FIXME: at this moment, iscTe does not have any
+                            // attributes. Therefore, I cannot feed it with
+                            // attributes of iscConfigYang
+                            teIscList.add(iscTe);
+                        }
+                    }
+
+                    TeTerminationPoint teSubsystemTp = new TeTerminationPoint(teTpId,
+                                                                              teIscList,
+                                                                              interLayerLockId);
+                    tp.setTe(teSubsystemTp);
+                }
+            }
+        }
+        return tp;
+    }
+
+}
diff --git a/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/package-info.java b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/package-info.java
new file mode 100644
index 0000000..f11dfdc
--- /dev/null
+++ b/apps/tenbi/utils/src/main/java/org/onosproject/teyang/utils/topology/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * The utilities for conversions between TE Topology core subsystem and
+ * IETF TE Topology Yang generated Java code.
+ */
+package org.onosproject.teyang.utils.topology;
diff --git a/apps/tenbi/utils/src/test/java/org/onosproject/teyang/utils/topology/ConverterTest.java b/apps/tenbi/utils/src/test/java/org/onosproject/teyang/utils/topology/ConverterTest.java
new file mode 100644
index 0000000..3637559
--- /dev/null
+++ b/apps/tenbi/utils/src/test/java/org/onosproject/teyang/utils/topology/ConverterTest.java
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.teyang.utils.topology;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.onosproject.teyang.api.OperationType;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network
+            .rev20151208.ietfnetwork.networks.Network;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.topology.rev20160708.ietftetopology.networks.network.node.AugmentedNwNode;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.TeAdminStatus;
+import org.onosproject.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.te.types.rev20160705.ietftetypes.teadminstatus.TeAdminStatusEnum;
+
+
+/**
+ * Unit tests for converter functions.
+ */
+public class ConverterTest {
+
+    Network output;
+
+    @Before
+    public void setUp() {
+        output = NetworkConverter.teSubsystem2YangNetwork(
+                        DefaultBuilder.sampleTeSubsystemNetworkBuilder(),
+                        OperationType.NONE);
+    }
+
+    @Test
+    public void basics() {
+        assertEquals("Wrong networkId",
+                     output.networkId().uri().string(),
+                     "HUAWEI_NETWORK_NEW");
+        assertEquals("Wrong 1st nodeId",
+                     output.node().get(0).nodeId().uri().string(),
+                     "HUAWEI_ROADM_1");
+        assertEquals("Wrong 2dn nodeId",
+                     output.node().get(1).nodeId().uri().string(),
+                     "HUAWEI_ROADM_2");
+        AugmentedNwNode augmentedNode = (AugmentedNwNode) output.node().get(0)
+                .yangAugmentedInfo(AugmentedNwNode.class);
+
+        assertEquals("Wrong adminStatus",
+                     augmentedNode.te().config().teNodeAttributes().adminStatus(),
+                     TeAdminStatus.of(TeAdminStatusEnum.UP));
+    }
+
+}
diff --git a/apps/tenbi/utils/src/test/java/org/onosproject/teyang/utils/topology/DefaultBuilder.java b/apps/tenbi/utils/src/test/java/org/onosproject/teyang/utils/topology/DefaultBuilder.java
new file mode 100644
index 0000000..c078d1b
--- /dev/null
+++ b/apps/tenbi/utils/src/test/java/org/onosproject/teyang/utils/topology/DefaultBuilder.java
@@ -0,0 +1,172 @@
+/*
+ * Copyright 2016-present Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.onosproject.teyang.utils.topology;
+
+import java.math.BigInteger;
+import java.util.List;
+
+import org.onosproject.tetopology.management.api.DefaultNetwork;
+import org.onosproject.tetopology.management.api.DefaultNetworks;
+import org.onosproject.tetopology.management.api.KeyId;
+import org.onosproject.tetopology.management.api.Network;
+import org.onosproject.tetopology.management.api.Networks;
+import org.onosproject.tetopology.management.api.TeTopologyId;
+import org.onosproject.tetopology.management.api.link.DefaultNetworkLink;
+import org.onosproject.tetopology.management.api.link.LinkProtectionType;
+import org.onosproject.tetopology.management.api.link.NetworkLink;
+import org.onosproject.tetopology.management.api.link.TeLink;
+import org.onosproject.tetopology.management.api.link.TeLinkAccessType;
+import org.onosproject.tetopology.management.api.node.ConnectivityMatrix;
+import org.onosproject.tetopology.management.api.node.DefaultNetworkNode;
+import org.onosproject.tetopology.management.api.node.DefaultTerminationPoint;
+import org.onosproject.tetopology.management.api.node.NetworkNode;
+import org.onosproject.tetopology.management.api.node.TeNetworkTopologyId;
+import org.onosproject.tetopology.management.api.node.TeNode;
+import org.onosproject.tetopology.management.api.node.TeStatus;
+import org.onosproject.tetopology.management.api.node.TerminationPoint;
+import org.onosproject.tetopology.management.api.node.TerminationPointKey;
+
+import com.google.common.collect.Lists;
+
+/**
+ * Builds a sample Topology, which consists of two Nodes, one link,
+ * and each node has two termination points.
+ */
+public final class DefaultBuilder {
+
+    private static final String HUAWEI_NETWORK_NEW = "HUAWEI_NETWORK_NEW";
+    private static final String HUAWEI_ROADM_1 = "HUAWEI_ROADM_1";
+    private static final String CLIENT1_NODE1 = "CLIENT1_NODE1";
+    private static final String LINE1_NODE1 = "LINE1_NODE1";
+    private static final String NODE1_IP = "10.11.12.33";
+    private static final String HUAWEI_ROADM_2 = "HUAWEI_ROADM_2";
+    private static final String CLIENT1_NODE2 = "CLIENT1_NODE2";
+    private static final String LINE1_NODE2 = "LINE1_NODE2";
+    private static final String NODE2_IP = "10.11.12.34";
+    private static final String LINK1FORNETWORK1 = "LINK1FORNETWORK1";
+    private static final String HUAWEI_TE_TOPOLOGY_NEW = "HUAWEI_TE_TOPOLOGY_NEW";
+
+    // no instantiation
+    private DefaultBuilder() {
+    }
+
+    /**
+     * Returns a sample TeSubsystem Networks object.
+     *
+     * @return the Networks object
+     */
+    public static Networks sampleTeSubsystemNetworksBuilder() {
+        DefaultNetworks defaultNetworks = new DefaultNetworks();
+        List<Network> networks = Lists.newArrayList();
+        networks.add(sampleTeSubsystemNetworkBuilder());
+        defaultNetworks.setNetworks(networks);
+        return defaultNetworks;
+    }
+
+    /**
+     * Returns a sample TeSubsystem Network object.
+     *
+     * @return the Network object
+     */
+    public static Network sampleTeSubsystemNetworkBuilder() {
+        DefaultNetwork huaweiNetworkNew = new DefaultNetwork(KeyId.keyId(HUAWEI_NETWORK_NEW));
+        huaweiNetworkNew.setServerProvided(true);
+        List<NetworkNode> nodes = Lists.newArrayList();
+
+
+        DefaultNetworkNode node1 = new DefaultNetworkNode(KeyId.keyId(HUAWEI_ROADM_1));
+
+        DefaultTerminationPoint tp11 = new DefaultTerminationPoint(KeyId.keyId(CLIENT1_NODE1));
+        DefaultTerminationPoint tp12 = new DefaultTerminationPoint(KeyId.keyId(LINE1_NODE1));
+
+        List<TerminationPoint> tps1 = Lists.newArrayList();
+        tps1.add(tp11);
+        tps1.add(tp12);
+        node1.setTerminationPoints(tps1);
+
+        TeNode teNode1 = new TeNode(NODE1_IP);
+        teNode1.setAdminStatus(TeStatus.UP);
+        teNode1.setAbstract(false);
+        ConnectivityMatrix cMatrix1 =
+                new ConnectivityMatrix(1,
+                                       new TerminationPointKey(huaweiNetworkNew.networkId(),
+                                                               node1.nodeId(), tp11.id()),
+                                       new TerminationPointKey(huaweiNetworkNew.networkId(),
+                                                               node1.nodeId(), tp12.id()),
+                                       true);
+        List<ConnectivityMatrix> connMatrices = Lists.newArrayList();
+        connMatrices.add(cMatrix1);
+        teNode1.setConnectivityMatrices(connMatrices);
+        node1.setTe(teNode1);
+
+        DefaultNetworkNode node2 = new DefaultNetworkNode(KeyId.keyId(HUAWEI_ROADM_2));
+
+        DefaultTerminationPoint tp21 = new DefaultTerminationPoint(KeyId.keyId(CLIENT1_NODE2));
+        DefaultTerminationPoint tp22 = new DefaultTerminationPoint(KeyId.keyId(LINE1_NODE2));
+
+        List<TerminationPoint> tps2 = Lists.newArrayList();
+        tps2.add(tp21);
+        tps2.add(tp22);
+        node2.setTerminationPoints(tps2);
+
+        TeNode teNode2 = new TeNode(NODE2_IP);
+        teNode1.setAdminStatus(TeStatus.UP);
+        teNode1.setAbstract(false);
+        ConnectivityMatrix cMatrix2 =
+                new ConnectivityMatrix(1,
+                                       new TerminationPointKey(huaweiNetworkNew.networkId(),
+                                                               node2.nodeId(), tp21.id()),
+                                       new TerminationPointKey(huaweiNetworkNew.networkId(),
+                                                               node2.nodeId(), tp22.id()),
+                                       true);
+        List<ConnectivityMatrix> connMatrices2 = Lists.newArrayList();
+        connMatrices.add(cMatrix2);
+        teNode1.setConnectivityMatrices(connMatrices2);
+        node2.setTe(teNode2);
+
+        nodes.add(node1);
+        nodes.add(node2);
+        huaweiNetworkNew.setNodes(nodes);
+
+        List<NetworkLink> links = Lists.newArrayList();
+
+        DefaultNetworkLink link1 = new DefaultNetworkLink(KeyId.keyId(LINK1FORNETWORK1));
+        link1.setSource(new TerminationPointKey(huaweiNetworkNew.networkId(),
+                                                node1.nodeId(),
+                                                tp11.id()));
+        link1.setDestination(new TerminationPointKey(huaweiNetworkNew.networkId(),
+                                                     node2.nodeId(),
+                                                     tp21.id()));
+        TeLink teLink1 = new TeLink(BigInteger.valueOf(1));
+        teLink1.setIsAbstract(false);
+        teLink1.setAdminStatus(TeStatus.UP);
+        teLink1.setAccessType(TeLinkAccessType.POINT_TO_POINT);
+        teLink1.setLinkProtectionType(LinkProtectionType.UNPROTECTED);
+        List<Long> teSrlgs = Lists.newArrayList();
+        teSrlgs.add(1000L);
+        teSrlgs.add(2000L);
+        teLink1.setTeSrlgs(teSrlgs);
+        link1.setTe(teLink1);
+        links.add(link1);
+        huaweiNetworkNew.setLinks(links);
+
+        TeNetworkTopologyId teNetwork =
+                new TeNetworkTopologyId(new TeTopologyId(22222L, 44444L, HUAWEI_TE_TOPOLOGY_NEW));
+        huaweiNetworkNew.setTeTopologyId(teNetwork.getTopologyId());
+
+        return huaweiNetworkNew;
+    }
+}
diff --git a/apps/tenbi/utils/src/test/java/org/onosproject/teyang/utils/topology/package-info.java b/apps/tenbi/utils/src/test/java/org/onosproject/teyang/utils/topology/package-info.java
new file mode 100644
index 0000000..049b3d2
--- /dev/null
+++ b/apps/tenbi/utils/src/test/java/org/onosproject/teyang/utils/topology/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2016 Open Networking Laboratory
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * The topology utilities test functions.
+ *
+ */
+package org.onosproject.teyang.utils.topology;
diff --git a/apps/tenbi/yangmodel/BUCK b/apps/tenbi/yangmodel/BUCK
new file mode 100644
index 0000000..9c47ca7
--- /dev/null
+++ b/apps/tenbi/yangmodel/BUCK
@@ -0,0 +1,9 @@
+COMPILE = [
+  '//lib:guava',
+]
+
+#yang_library(
+#  deps = COMPILE,
+#  name = 'onos-app-tenbi-yangmodel',
+#  srcs = glob(['src/main/**/*.yang']),
+#)
diff --git a/apps/tenbi/yangmodel/features.xml b/apps/tenbi/yangmodel/features.xml
new file mode 100644
index 0000000..a3c78e3
--- /dev/null
+++ b/apps/tenbi/yangmodel/features.xml
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!--
+  ~ Copyright 2015 Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.2.0" name="@PROJECT-ARTIFACTID-@ONOS-VERSION" >
+    <feature name="@PROJECT-ARTIFACTID" version="@ONOS-VERSION"
+             description="@PROJECT-DESCRIPTION" >
+        <bundle>mvn:@PROJECT-GROUPID/@PROJECT-ARTIFACTID/@ONOS-VERSION</bundle>
+    </feature>
+</features>
\ No newline at end of file
diff --git a/apps/tenbi/yangmodel/pom.xml b/apps/tenbi/yangmodel/pom.xml
new file mode 100644
index 0000000..6211f7f
--- /dev/null
+++ b/apps/tenbi/yangmodel/pom.xml
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Copyright 2016 Open Networking Laboratory
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~     http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.onosproject</groupId>
+        <artifactId>onos-app-tenbi</artifactId>
+        <version>1.8.0-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>onos-app-tenbi-yangmodel</artifactId>
+    <packaging>bundle</packaging>
+
+    <description>IETF TE YANG models</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-yang-maven-plugin</artifactId>
+            <version>1.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onosproject</groupId>
+            <artifactId>onos-yang-datamodel</artifactId>
+            <version>1.8</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+           <plugin>
+                <groupId>org.onosproject</groupId>
+                <artifactId>onos-yang-maven-plugin</artifactId>
+                <version>1.8</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>yang2java</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>com.google.code.maven-replacer-plugin</groupId>
+                <artifactId>replacer</artifactId>
+                <version>1.5.3</version>
+                <executions>
+                    <execution>
+                        <phase>prepare-package</phase>
+                        <goals>
+                            <goal>replace</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <file>${pom.basedir}/features.xml</file>
+                    <outputFile>${pom.basedir}/target/features.xml</outputFile>
+                    <replacements>
+                        <replacement>
+                            <token>@ONOS-VERSION</token>
+                            <value>${project.version}</value>
+                        </replacement>
+                        <replacement>
+                            <token>@PROJECT-GROUPID</token>
+                            <value>${project.groupId}</value>
+                        </replacement>
+                        <replacement>
+                            <token>@PROJECT-ARTIFACTID</token>
+                            <value>${project.artifactId}</value>
+                        </replacement>
+                        <replacement>
+                            <token>@PROJECT-DESCRIPTION</token>
+                            <value>${project.description}</value>
+                        </replacement>
+                        <replacement>
+                            <token>@FEATURE-VERSION</token>
+                            <value>${project.version}</value>
+                        </replacement>
+                    </replacements>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.9</version>
+                <executions>
+                    <execution>
+                        <id>attach-artifacts</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>attach-artifact</goal>
+                        </goals>
+                        <configuration>
+                            <artifacts>
+                                <artifact>
+                                    <file>target/features.xml</file>
+                                    <type>xml</type>
+                                    <classifier>features</classifier>
+                                </artifact>
+                            </artifacts>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
diff --git a/apps/tenbi/yangmodel/src/main/yang/ietf-inet-types.yang b/apps/tenbi/yangmodel/src/main/yang/ietf-inet-types.yang
new file mode 100644
index 0000000..5388b03
--- /dev/null
+++ b/apps/tenbi/yangmodel/src/main/yang/ietf-inet-types.yang
@@ -0,0 +1,461 @@
+module ietf-inet-types {
+
+  namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types";
+  prefix "inet";
+
+  organization
+   "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+  contact
+   "WG Web:   <http://tools.ietf.org/wg/netmod/>
+    WG List:  <mailto:netmod@ietf.org>
+
+    WG Chair: David Kessens
+              <mailto:david.kessens@nsn.com>
+
+    WG Chair: Juergen Schoenwaelder
+              <mailto:j.schoenwaelder@jacobs-university.de>
+
+    Editor:   Juergen Schoenwaelder
+              <mailto:j.schoenwaelder@jacobs-university.de>";
+
+  description
+   "This module contains a collection of generally useful derived
+    YANG data types for Internet addresses and related things.
+
+    Copyright (c) 2013 IETF Trust and the persons identified as
+    authors of the code.  All rights reserved.
+
+    Redistribution and use in source and binary forms, with or
+    without modification, is permitted pursuant to, and subject
+    to the license terms contained in, the Simplified BSD License
+    set forth in Section 4.c of the IETF Trust's Legal Provisions
+    Relating to IETF Documents
+    (http://trustee.ietf.org/license-info).
+
+    This version of this YANG module is part of RFC 6991; see
+    the RFC itself for full legal notices.";
+
+  revision 2013-07-15 {
+    description
+     "This revision adds the following new data types:
+      - ip-address-no-zone
+      - ipv4-address-no-zone
+      - ipv6-address-no-zone";
+    reference
+     "RFC 6991: Common YANG Data Types";
+  }
+
+  revision 2010-09-24 {
+    description
+     "Initial revision.";
+    reference
+     "RFC 6021: Common YANG Data Types";
+  }
+
+  /*** collection of types related to protocol fields ***/
+
+  typedef ip-version {
+    type enumeration {
+      enum unknown {
+        value "0";
+        description
+         "An unknown or unspecified version of the Internet
+          protocol.";
+      }
+      enum ipv4 {
+        value "1";
+        description
+         "The IPv4 protocol as defined in RFC 791.";
+      }
+      enum ipv6 {
+        value "2";
+        description
+         "The IPv6 protocol as defined in RFC 2460.";
+      }
+    }
+    description
+     "This value represents the version of the IP protocol.
+
+      In the value set and its semantics, this type is equivalent
+      to the InetVersion textual convention of the SMIv2.";
+    reference
+     "RFC  791: Internet Protocol
+      RFC 2460: Internet Protocol, Version 6 (IPv6) Specification
+      RFC 4001: Textual Conventions for Internet Network Addresses";
+  }
+
+  typedef dscp {
+    type uint8 {
+      range "0..63";
+    }
+    description
+     "The dscp type represents a Differentiated Services Code Point
+      that may be used for marking packets in a traffic stream.
+      In the value set and its semantics, this type is equivalent
+      to the Dscp textual convention of the SMIv2.";
+    reference
+     "RFC 3289: Management Information Base for the Differentiated
+                Services Architecture
+      RFC 2474: Definition of the Differentiated Services Field
+                (DS Field) in the IPv4 and IPv6 Headers
+      RFC 2780: IANA Allocation Guidelines For Values In
+                the Internet Protocol and Related Headers";
+  }
+
+  typedef ipv6-flow-label {
+    type uint32 {
+      range "0..1048575";
+    }
+    description
+     "The ipv6-flow-label type represents the flow identifier or Flow
+      Label in an IPv6 packet header that may be used to
+      discriminate traffic flows.
+
+      In the value set and its semantics, this type is equivalent
+      to the IPv6FlowLabel textual convention of the SMIv2.";
+    reference
+     "RFC 3595: Textual Conventions for IPv6 Flow Label
+      RFC 2460: Internet Protocol, Version 6 (IPv6) Specification";
+  }
+
+  typedef port-number {
+    type uint16 {
+      range "0..65535";
+    }
+    description
+     "The port-number type represents a 16-bit port number of an
+      Internet transport-layer protocol such as UDP, TCP, DCCP, or
+      SCTP.  Port numbers are assigned by IANA.  A current list of
+      all assignments is available from <http://www.iana.org/>.
+
+      Note that the port number value zero is reserved by IANA.  In
+      situations where the value zero does not make sense, it can
+      be excluded by subtyping the port-number type.
+      In the value set and its semantics, this type is equivalent
+      to the InetPortNumber textual convention of the SMIv2.";
+    reference
+     "RFC  768: User Datagram Protocol
+      RFC  793: Transmission Control Protocol
+      RFC 4960: Stream Control Transmission Protocol
+      RFC 4340: Datagram Congestion Control Protocol (DCCP)
+      RFC 4001: Textual Conventions for Internet Network Addresses";
+  }
+
+  /*** collection of types related to autonomous systems ***/
+
+  typedef as-number {
+    type uint32;
+    description
+     "The as-number type represents autonomous system numbers
+      which identify an Autonomous System (AS).  An AS is a set
+      of routers under a single technical administration, using
+      an interior gateway protocol and common metrics to route
+      packets within the AS, and using an exterior gateway
+      protocol to route packets to other ASes.  IANA maintains
+      the AS number space and has delegated large parts to the
+      regional registries.
+
+      Autonomous system numbers were originally limited to 16
+      bits.  BGP extensions have enlarged the autonomous system
+      number space to 32 bits.  This type therefore uses an uint32
+      base type without a range restriction in order to support
+      a larger autonomous system number space.
+
+      In the value set and its semantics, this type is equivalent
+      to the InetAutonomousSystemNumber textual convention of
+      the SMIv2.";
+    reference
+     "RFC 1930: Guidelines for creation, selection, and registration
+                of an Autonomous System (AS)
+      RFC 4271: A Border Gateway Protocol 4 (BGP-4)
+      RFC 4001: Textual Conventions for Internet Network Addresses
+      RFC 6793: BGP Support for Four-Octet Autonomous System (AS)
+                Number Space";
+  }
+
+  /*** collection of types related to IP addresses and hostnames ***/
+
+  typedef ip-address {
+    type union {
+      type inet:ipv4-address;
+      type inet:ipv6-address;
+    }
+    description
+     "The ip-address type represents an IP address and is IP
+      version neutral.  The format of the textual representation
+      implies the IP version.  This type supports scoped addresses
+      by allowing zone identifiers in the address format.";
+    reference
+     "RFC 4007: IPv6 Scoped Address Architecture";
+  }
+
+  typedef ipv4-address {
+    type string {
+      pattern
+        '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+      +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+      + '(%[\p{N}\p{L}]+)?';
+    }
+    description
+      "The ipv4-address type represents an IPv4 address in
+       dotted-quad notation.  The IPv4 address may include a zone
+       index, separated by a % sign.
+
+       The zone index is used to disambiguate identical address
+       values.  For link-local addresses, the zone index will
+       typically be the interface index number or the name of an
+       interface.  If the zone index is not present, the default
+       zone of the device will be used.
+
+       The canonical format for the zone index is the numerical
+       format";
+  }
+
+  typedef ipv6-address {
+    type string {
+      pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+            + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+            + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
+            + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
+            + '(%[\p{N}\p{L}]+)?';
+      pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+            + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
+            + '(%.+)?';
+    }
+    description
+     "The ipv6-address type represents an IPv6 address in full,
+      mixed, shortened, and shortened-mixed notation.  The IPv6
+      address may include a zone index, separated by a % sign.
+
+      The zone index is used to disambiguate identical address
+      values.  For link-local addresses, the zone index will
+      typically be the interface index number or the name of an
+      interface.  If the zone index is not present, the default
+      zone of the device will be used.
+
+
+
+      The canonical format of IPv6 addresses uses the textual
+      representation defined in Section 4 of RFC 5952.  The
+      canonical format for the zone index is the numerical
+      format as described in Section 11.2 of RFC 4007.";
+    reference
+     "RFC 4291: IP Version 6 Addressing Architecture
+      RFC 4007: IPv6 Scoped Address Architecture
+      RFC 5952: A Recommendation for IPv6 Address Text
+                Representation";
+  }
+
+  typedef ip-address-no-zone {
+    type union {
+      type inet:ipv4-address-no-zone;
+      type inet:ipv6-address-no-zone;
+    }
+    description
+     "The ip-address-no-zone type represents an IP address and is
+      IP version neutral.  The format of the textual representation
+      implies the IP version.  This type does not support scoped
+      addresses since it does not allow zone identifiers in the
+      address format.";
+    reference
+     "RFC 4007: IPv6 Scoped Address Architecture";
+  }
+
+  typedef ipv4-address-no-zone {
+    type inet:ipv4-address {
+      pattern '[0-9\.]*';
+    }
+    description
+      "An IPv4 address without a zone index.  This type, derived from
+       ipv4-address, may be used in situations where the zone is
+       known from the context and hence no zone index is needed.";
+  }
+
+  typedef ipv6-address-no-zone {
+    type inet:ipv6-address {
+      pattern '[0-9a-fA-F:\.]*';
+    }
+    description
+      "An IPv6 address without a zone index.  This type, derived from
+       ipv6-address, may be used in situations where the zone is
+       known from the context and hence no zone index is needed.";
+    reference
+     "RFC 4291: IP Version 6 Addressing Architecture
+      RFC 4007: IPv6 Scoped Address Architecture
+      RFC 5952: A Recommendation for IPv6 Address Text
+                Representation";
+  }
+
+  typedef ip-prefix {
+    type union {
+      type inet:ipv4-prefix;
+      type inet:ipv6-prefix;
+    }
+    description
+     "The ip-prefix type represents an IP prefix and is IP
+      version neutral.  The format of the textual representations
+      implies the IP version.";
+  }
+
+  typedef ipv4-prefix {
+    type string {
+      pattern
+         '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+       +  '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
+       + '/(([0-9])|([1-2][0-9])|(3[0-2]))';
+    }
+    description
+     "The ipv4-prefix type represents an IPv4 address prefix.
+      The prefix length is given by the number following the
+      slash character and must be less than or equal to 32.
+
+      A prefix length value of n corresponds to an IP address
+      mask that has n contiguous 1-bits from the most
+      significant bit (MSB) and all other bits set to 0.
+
+      The canonical format of an IPv4 prefix has all bits of
+      the IPv4 address set to zero that are not part of the
+      IPv4 prefix.";
+  }
+
+  typedef ipv6-prefix {
+    type string {
+      pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
+            + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
+            + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
+            + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
+            + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';
+      pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+            + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
+            + '(/.+)';
+    }
+
+
+    description
+     "The ipv6-prefix type represents an IPv6 address prefix.
+      The prefix length is given by the number following the
+      slash character and must be less than or equal to 128.
+
+      A prefix length value of n corresponds to an IP address
+      mask that has n contiguous 1-bits from the most
+      significant bit (MSB) and all other bits set to 0.
+
+      The IPv6 address should have all bits that do not belong
+      to the prefix set to zero.
+
+      The canonical format of an IPv6 prefix has all bits of
+      the IPv6 address set to zero that are not part of the
+      IPv6 prefix.  Furthermore, the IPv6 address is represented
+      as defined in Section 4 of RFC 5952.";
+    reference
+     "RFC 5952: A Recommendation for IPv6 Address Text
+                Representation";
+  }
+
+  /*** collection of domain name and URI types ***/
+
+  typedef domain-name {
+    type string {
+      pattern
+        '((([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.)*'
+      + '([a-zA-Z0-9_]([a-zA-Z0-9\-_]){0,61})?[a-zA-Z0-9]\.?)'
+      + '|\.';
+      length "1..253";
+    }
+    description
+     "The domain-name type represents a DNS domain name.  The
+      name SHOULD be fully qualified whenever possible.
+
+      Internet domain names are only loosely specified.  Section
+      3.5 of RFC 1034 recommends a syntax (modified in Section
+      2.1 of RFC 1123).  The pattern above is intended to allow
+      for current practice in domain name use, and some possible
+      future expansion.  It is designed to hold various types of
+      domain names, including names used for A or AAAA records
+      (host names) and other records, such as SRV records.  Note
+      that Internet host names have a stricter syntax (described
+      in RFC 952) than the DNS recommendations in RFCs 1034 and
+      1123, and that systems that want to store host names in
+      schema nodes using the domain-name type are recommended to
+      adhere to this stricter standard to ensure interoperability.
+
+      The encoding of DNS names in the DNS protocol is limited
+      to 255 characters.  Since the encoding consists of labels
+      prefixed by a length bytes and there is a trailing NULL
+      byte, only 253 characters can appear in the textual dotted
+      notation.
+
+      The description clause of schema nodes using the domain-name
+      type MUST describe when and how these names are resolved to
+      IP addresses.  Note that the resolution of a domain-name value
+      may require to query multiple DNS records (e.g., A for IPv4
+      and AAAA for IPv6).  The order of the resolution process and
+      which DNS record takes precedence can either be defined
+      explicitly or may depend on the configuration of the
+      resolver.
+
+      Domain-name values use the US-ASCII encoding.  Their canonical
+      format uses lowercase US-ASCII characters.  Internationalized
+      domain names MUST be A-labels as per RFC 5890.";
+    reference
+     "RFC  952: DoD Internet Host Table Specification
+      RFC 1034: Domain Names - Concepts and Facilities
+      RFC 1123: Requirements for Internet Hosts -- Application
+                and Support
+      RFC 2782: A DNS RR for specifying the location of services
+                (DNS SRV)
+      RFC 5890: Internationalized Domain Names in Applications
+                (IDNA): Definitions and Document Framework";
+  }
+
+  typedef host {
+    type union {
+      type inet:ip-address;
+      type inet:domain-name;
+    }
+    description
+     "The host type represents either an IP address or a DNS
+      domain name.";
+  }
+
+  typedef uri {
+    type string;
+    description
+     "The uri type represents a Uniform Resource Identifier
+      (URI) as defined by STD 66.
+
+      Objects using the uri type MUST be in US-ASCII encoding,
+      and MUST be normalized as described by RFC 3986 Sections
+      6.2.1, 6.2.2.1, and 6.2.2.2.  All unnecessary
+      percent-encoding is removed, and all case-insensitive
+      characters are set to lowercase except for hexadecimal
+      digits, which are normalized to uppercase as described in
+      Section 6.2.2.1.
+
+      The purpose of this normalization is to help provide
+      unique URIs.  Note that this normalization is not
+      sufficient to provide uniqueness.  Two URIs that are
+      textually distinct after this normalization may still be
+      equivalent.
+
+      Objects using the uri type may restrict the schemes that
+      they permit.  For example, 'data:' and 'urn:' schemes
+      might not be appropriate.
+
+      A zero-length URI is not a valid URI.  This can be used to
+      express 'URI absent' where required.
+
+      In the value set and its semantics, this type is equivalent
+      to the Uri SMIv2 textual convention defined in RFC 5017.";
+    reference
+     "RFC 3986: Uniform Resource Identifier (URI): Generic Syntax
+      RFC 3305: Report from the Joint W3C/IETF URI Planning Interest
+                Group: Uniform Resource Identifiers (URIs), URLs,
+                and Uniform Resource Names (URNs): Clarifications
+                and Recommendations
+      RFC 5017: MIB Textual Conventions for Uniform Resource
+                Identifiers (URIs)";
+  }
+
+}
diff --git a/apps/tenbi/yangmodel/src/main/yang/ietf-network-topology@2015-12-08.yang b/apps/tenbi/yangmodel/src/main/yang/ietf-network-topology@2015-12-08.yang
new file mode 100644
index 0000000..bba3916
--- /dev/null
+++ b/apps/tenbi/yangmodel/src/main/yang/ietf-network-topology@2015-12-08.yang
@@ -0,0 +1,277 @@
+module ietf-network-topology {
+ // yang-version 1.1;
+  yang-version 1;
+  namespace "urn:ietf:params:xml:ns:yang:ietf-network-topology";
+  prefix lnk;
+  import ietf-inet-types {
+    prefix inet;
+  }
+  import ietf-network {
+    prefix nd;
+  }
+  organization
+    "IETF I2RS (Interface to the Routing System) Working Group";
+  contact
+    "WG Web:    <http:  tools.ietf.org/wg/i2rs/>
+     WG List:   <mailto:i2rs@ietf.org>
+     WG Chair:  Susan Hares
+                <mailto:shares@ndzh.com>
+     WG Chair:  Jeffrey Haas
+                <mailto:jhaas@pfrc.org>
+     Editor:    Alexander Clemm
+                <mailto:alex@cisco.com>
+     Editor:    Jan Medved
+                <mailto:jmedved@cisco.com>
+     Editor:    Robert Varga
+                <mailto:rovarga@cisco.com>
+     Editor:    Tony Tkacik
+                <mailto:ttkacik@cisco.com>
+     Editor:    Nitin Bahadur
+                <mailto:nitin_bahadur@yahoo.com>
+     Editor:    Hariharan Ananthakrishnan
+                <mailto:hari@packetdesign.com>";
+  description
+    "This module defines a common base model for network topology,
+     augmenting the base network model with links to connect nodes,
+     as well as termination points to terminate links on nodes.
+     Copyright (c) 2015 IETF Trust and the persons identified as
+     authors of the code.  All rights reserved.
+     Redistribution and use in source and binary forms, with or
+     without modification, is permitted pursuant to, and subject
+     to the license terms contained in, the Simplified BSD License
+     set forth in Section 4.c of the IETF Trust's Legal Provisions
+     Relating to IETF Documents
+     (http:  trustee.ietf.org/license-info).
+     This version of this YANG module is part of
+     draft-ietf-i2rs-yang-network-topo-02;
+     see the RFC itself for full legal notices.
+     NOTE TO RFC EDITOR: Please replace above reference to
+     draft-ietf-i2rs-yang-network-topo-02 with RFC
+     number when published (i.e. RFC xxxx).";
+  revision 2015-12-08 {
+    description
+      "Initial revision.
+       NOTE TO RFC EDITOR: Please replace the following reference
+       to draft-ietf-i2rs-yang-network-topo-02 with
+       RFC number when published (i.e. RFC xxxx).";
+    reference
+      "draft-ietf-i2rs-yang-network-topo-02.";
+  }
+  typedef link-id {
+    type inet:uri;
+    description
+      "An identifier for a link in a topology.
+       The identifier SHOULD be chosen such that the same link in a
+       real network topology will always be identified through the
+       same identifier, even if the model is instantiated in
+           separate datastores. An implementation MAY choose to capture
+       semantics in the identifier, for example to indicate the type
+       of link and/or the type of topology that the link is a part
+       of.";
+  }
+  typedef tp-id {
+    type inet:uri;
+    description
+      "An identifier for termination points on a node.
+       The identifier SHOULD be chosen such that the same TP in a
+       real network topology will always be identified through the
+       same identifier, even if the model is instantiated in
+       separate datastores. An implementation MAY choose to capture
+       semantics in the identifier, for example to indicate the type
+       of TP and/or the type of node and topology that the TP is a
+       part of.";
+  }
+  grouping link-ref {
+    description
+      "References a link in a specific network.";
+    leaf link-ref {
+      type leafref {
+        path "/nd:networks/nd:network[nd:network-id=current()/../"+
+          "network-ref]/lnk:link/lnk:link-id";
+          require-instance false;
+      }
+      description
+        "A type for an absolute reference a link instance.
+         (This type should not be used for relative references.
+         In such a case, a relative path should be used instead.)";
+    }
+    uses nd:network-ref;
+  }
+  grouping tp-ref {
+    description
+      "References a termination point in a specific node.";
+    leaf tp-ref {
+      type leafref {
+        path "/nd:networks/nd:network[nd:network-id=current()/../"+
+          "network-ref]/nd:node[nd:node-id=current()/../"+
+          "node-ref]/lnk:termination-point/lnk:tp-id";
+          require-instance false;
+      }
+      description
+        "A type for an absolute reference to a termination point.
+         (This type should not be used for relative references.
+         In such a case, a relative path should be used instead.)";
+    }
+    uses nd:node-ref;
+  }
+  augment "/nd:networks/nd:network" {
+    description
+      "Add links to the network model.";
+    list link {
+      key "link-id";
+      description
+        "A Network Link connects a by Local (Source) node and
+         a Remote (Destination) Network Nodes via a set of the
+         nodes' termination points.
+         As it is possible to have several links between the same
+         source and destination nodes, and as a link could
+         potentially be re-homed between termination points, to
+         ensure that we would always know to distinguish between
+         links, every link is identified by a dedicated link
+         identifier.
+         Note that a link models a point-to-point link, not a
+         multipoint link.
+         Layering dependencies on links in underlay topologies are
+         not represented as the layering information of nodes and of
+         termination points is sufficient.";
+      container source {
+        description
+          "This container holds the logical source of a particular
+           link.";
+        leaf source-node {
+          type leafref {
+            path "../../../nd:node/nd:node-id";
+          }
+          mandatory true;
+          description
+            "Source node identifier, must be in same topology.";
+        }
+        leaf source-tp {
+          type leafref {
+            path "../../../nd:node[nd:node-id=current()/../"+
+              "source-node]/termination-point/tp-id";
+          }
+          description
+            "Termination point within source node that terminates
+             the link.";
+        }
+      }
+      container destination {
+        description
+          "This container holds the logical destination of a
+           particular link.";
+        leaf dest-node {
+          type leafref {
+            path "../../../nd:node/nd:node-id";
+          }
+          mandatory true;
+          description
+            "Destination node identifier, must be in the same
+             network.";
+        }
+        leaf dest-tp {
+          type leafref {
+            path "../../../nd:node[nd:node-id=current()/../"+
+              "dest-node]/termination-point/tp-id";
+          }
+          description
+            "Termination point within destination node that
+             terminates the link.";
+        }
+      }
+      leaf link-id {
+        type link-id;
+        description
+          "The identifier of a link in the topology.
+           A link is specific to a topology to which it belongs.";
+      }
+      list supporting-link {
+        key "network-ref link-ref";
+        description
+          "Identifies the link, or links, that this link
+           is dependent on.";
+        leaf network-ref {
+          type leafref {
+            path "../../../nd:supporting-network/nd:network-ref";
+            require-instance false;
+          }
+          description
+            "This leaf identifies in which underlay topology
+             supporting link is present.";
+        }
+        leaf link-ref {
+          type leafref {
+            path "/nd:networks/nd:network[nd:network-id=current()/"+
+              "../network-ref]/link/link-id";
+              require-instance false;
+          }
+          description
+            "This leaf identifies a link which is a part
+             of this link's underlay. Reference loops, in which
+             a link identifies itself as its underlay, either
+             directly or transitively, are not allowed.";
+        }
+      }
+    }
+  }
+  augment "/nd:networks/nd:network/nd:node" {
+    description
+      "Augment termination points which terminate links.
+       Termination points can ultimately be mapped to interfaces.";
+    list termination-point {
+      key "tp-id";
+      description
+        "A termination point can terminate a link.
+         Depending on the type of topology, a termination point
+         could, for example, refer to a port or an interface.";
+      leaf tp-id {
+        type tp-id;
+        description
+          "Termination point identifier.";
+      }
+      list supporting-termination-point {
+        key "network-ref node-ref tp-ref";
+        description
+          "The leaf list identifies any termination points that
+           the termination point is dependent on, or maps onto.
+           Those termination points will themselves be contained
+           in a supporting node.
+           This dependency information can be inferred from
+           the dependencies between links.  For this reason,
+           this item is not separately configurable.  Hence no
+           corresponding constraint needs to be articulated.
+           The corresponding information is simply provided by the
+           implementing system.";
+        leaf network-ref {
+          type leafref {
+            path "../../../nd:supporting-node/nd:network-ref";
+            require-instance false;
+          }
+          description
+            "This leaf identifies in which topology the
+             supporting termination point is present.";
+        }
+        leaf node-ref {
+          type leafref {
+            path "../../../nd:supporting-node/nd:node-ref";
+            require-instance false;
+          }
+          description
+            "This leaf identifies in which node the supporting
+             termination point is present.";
+        }
+        leaf tp-ref {
+          type leafref {
+            path "/nd:networks/nd:network[nd:network-id=current()/"+
+              "../network-ref]/nd:node[nd:node-id=current()/../"+
+              "node-ref]/termination-point/tp-id";
+              require-instance false;
+          }
+          description
+            "Reference to the underlay node, must be in a
+             different topology";
+        }
+      }
+    }
+  }
+}
diff --git a/apps/tenbi/yangmodel/src/main/yang/ietf-network@2015-12-08.yang b/apps/tenbi/yangmodel/src/main/yang/ietf-network@2015-12-08.yang
new file mode 100644
index 0000000..f5e0dcc
--- /dev/null
+++ b/apps/tenbi/yangmodel/src/main/yang/ietf-network@2015-12-08.yang
@@ -0,0 +1,196 @@
+module ietf-network {
+  // yang-version 1.1;
+  yang-version 1;
+  namespace "urn:ietf:params:xml:ns:yang:ietf-network";
+  prefix nd;
+  import ietf-inet-types {
+    prefix inet;
+  }
+  organization
+    "IETF I2RS (Interface to the Routing System) Working Group";
+  contact
+    "WG Web:    <http: tools.ietf.org/wg/i2rs/>
+     WG List:   <mailto:i2rs@ietf.org>
+     WG Chair:  Susan Hares
+                <mailto:shares@ndzh.com>
+     WG Chair:  Jeffrey Haas
+                <mailto:jhaas@pfrc.org>
+     Editor:    Alexander Clemm
+                <mailto:alex@cisco.com>
+     Editor:    Jan Medved
+                <mailto:jmedved@cisco.com>
+     Editor:    Robert Varga
+                <mailto:rovarga@cisco.com>
+     Editor:    Tony Tkacik
+                <mailto:ttkacik@cisco.com>
+     Editor:    Nitin Bahadur
+                <mailto:nitin_bahadur@yahoo.com>
+     Editor:    Hariharan Ananthakrishnan
+                <mailto:hari@packetdesign.com>";
+  description
+    "This module defines a common base model for a collection
+     of nodes in a network. Node definitions are further used
+     in network topologies and inventories.
+     Copyright (c) 2015 IETF Trust and the persons identified as
+     authors of the code.  All rights reserved.
+     Redistribution and use in source and binary forms, with or
+     without modification, is permitted pursuant to, and subject
+     to the license terms contained in, the Simplified BSD License
+     set forth in Section 4.c of the IETF Trust's Legal Provisions
+     Relating to IETF Documents
+     (http: trustee.ietf.org/license-info).
+     This version of this YANG module is part of
+     draft-ietf-i2rs-yang-network-topo-02;
+     see the RFC itself for full legal notices.
+     NOTE TO RFC EDITOR: Please replace above reference to
+     draft-ietf-i2rs-yang-network-topo-02 with RFC
+     number when published (i.e. RFC xxxx).";
+  revision 2015-12-08 {
+    description
+      "Initial revision.
+       NOTE TO RFC EDITOR: Please replace the following reference
+       to draft-ietf-i2rs-yang-network-topo-02 with
+       RFC number when published (i.e. RFC xxxx).";
+    reference
+      "draft-ietf-i2rs-yang-network-topo-02";
+  }
+  typedef node-id {
+    type inet:uri;
+    description
+      "Identifier for a node.";
+  }
+  typedef network-id {
+    type inet:uri;
+    description
+      "Identifier for a network.";
+  }
+  grouping network-ref {
+    description
+      "Contains the information necessary to reference a network,
+       for example an underlay network.";
+    leaf network-ref {
+      type leafref {
+        path "/nd:networks/nd:network/nd:network-id";
+        require-instance false;
+      }
+      description
+        "Used to reference a network, for example an underlay
+         network.";
+    }
+  }
+  grouping node-ref {
+    description
+      "Contains the information necessary to reference a node.";
+    leaf node-ref {
+      type leafref {
+        path "/nd:networks/nd:network[nd:network-id=current()/../"+
+          "network-ref]/nd:node/nd:node-id";
+        require-instance false;
+      }
+      description
+        "Used to reference a node.
+         Nodes are identified relative to the network they are
+         contained in.";
+    }
+    uses network-ref;
+  }
+  container networks {
+    description
+      "Serves as top-level container for a list of networks.";
+    list network {
+      key "network-id";
+      description
+        "Describes a network.
+         A network typically contains an inventory of nodes,
+         topological information (augmented through
+         network-topology model), as well as layering
+         information.";
+      container network-types {
+        description
+          "Serves as an augmentation target.
+           The network type is indicated through corresponding
+           presence containers augmented into this container.";
+      }
+      leaf network-id {
+        type network-id;
+        description
+          "Identifies a network.";
+      }
+      list supporting-network {
+        key "network-ref";
+        description
+          "An underlay network, used to represent layered network
+           topologies.";
+        leaf network-ref {
+          type leafref {
+            path "/networks/network/network-id";
+            require-instance false;
+          }
+          description
+            "References the underlay network.";
+        }
+      }
+      list node {
+        key "node-id";
+        description
+          "The inventory of nodes of this network.";
+        leaf node-id {
+          type node-id;
+          description
+            "Identifies a node uniquely within the containing
+             network.";
+        }
+        list supporting-node {
+          key "network-ref node-ref";
+          description
+            "Represents another node, in an underlay network, that
+             this node is supported by.  Used to represent layering
+             structure.";
+          leaf network-ref {
+            type leafref {
+              path "../../../supporting-network/network-ref";
+              require-instance false;
+            }
+            description
+              "References the underlay network that the
+               underlay node is part of.";
+          }
+          leaf node-ref {
+            type leafref {
+              path "/networks/network/node/node-id";
+              require-instance false;
+            }
+            description
+              "References the underlay node itself.";
+          }
+        }
+      }
+    }
+  }
+  container networks-state {
+    config false;
+    description
+      "Serves as top-level container for a list of state information
+       for networks";
+    list network {
+      key "network-ref";
+      description
+        "Data nodes representing operational data and state of
+         networks.
+         An instance is automatically created for every network
+         in the corresponding list under the networks container.";
+      uses network-ref;
+      leaf server-provided {
+        type boolean;
+        description
+          "Indicates whether the information concerning this
+           particular network is populated by the server
+           (server-provided true, the general case for network
+           information discovered from the server),
+           or whether it is configured by a client
+           (server-provided true, possible e.g. for
+           service overlays managed through a controller).";
+      }
+    }
+  }
+}
diff --git a/apps/tenbi/yangmodel/src/main/yang/ietf-schedule.yang b/apps/tenbi/yangmodel/src/main/yang/ietf-schedule.yang
new file mode 100644
index 0000000..55ce942
--- /dev/null
+++ b/apps/tenbi/yangmodel/src/main/yang/ietf-schedule.yang
@@ -0,0 +1,61 @@
+module ietf-schedule {
+  yang-version 1;
+  namespace "urn:ietf:params:xml:ns:yang:ietf-schedule";
+  // replace with IANA namespace when assigned
+  
+  prefix "sch";
+
+  import ietf-yang-types { 
+    prefix "yang"; 
+  }
+
+  organization "TBD";
+  contact "TBD";
+  description 
+    "The model allows time scheduling parameters to be specified.";
+  
+  revision "2015-10-08" {
+    description "Initial revision";
+    reference "TBD";
+  }
+
+  /*
+   * Groupings
+   */
+
+  grouping schedules {
+    description
+      "A list of schedules defining when a particular 
+       configuration takes effect.";
+    container schedules {
+      list schedule {
+        key "schedule-id";
+        description "A list of schedule elements.";
+        
+        leaf schedule-id {
+          type uint32;
+          description "Identifies the schedule element.";
+        }
+        leaf start {
+          type yang:date-and-time;
+          description "Start time.";
+        }
+        leaf schedule-duration {
+          type string {
+            pattern 
+              'P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?T(\d+H)?(\d+M)?(\d+S)?';
+          }
+          description "Schedule duration in ISO 8601 format.";
+        }
+        leaf repeat-interval {
+          type string {
+            pattern 
+              'R\d*/P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?T(\d+H)?(\d+M)?'
+              + '(\d+S)?';
+          }
+          description "Repeat interval in ISO 8601 format.";
+        }
+      }
+    }
+  } // schedules
+}
diff --git a/apps/tenbi/yangmodel/src/main/yang/ietf-te-topology.yang b/apps/tenbi/yangmodel/src/main/yang/ietf-te-topology.yang
new file mode 100644
index 0000000..e5305e2
--- /dev/null
+++ b/apps/tenbi/yangmodel/src/main/yang/ietf-te-topology.yang
@@ -0,0 +1,1707 @@
+module ietf-te-topology {
+  //yang-version 1.1;
+  namespace "urn:ietf:params:xml:ns:yang:ietf-te-topology";
+  // replace with IANA namespace when assigned
+  
+  prefix "tet";
+
+  import ietf-inet-types {
+    prefix "inet";
+  }
+
+  import ietf-schedule { 
+    prefix "sch"; 
+  }
+
+  import ietf-te-types {
+    prefix "te-types";
+  }
+
+  import ietf-network {
+    prefix "nw";
+  }
+
+  import ietf-network-topology {
+    prefix "nt";
+  }
+
+  organization
+    "Traffic Engineering Architecture and Signaling (TEAS)
+     Working Group";
+
+  contact
+    "WG Web:   <http://tools.ietf.org/wg/teas/>
+     WG List:  <mailto:teas@ietf.org>
+
+     WG Chair: Lou Berger
+               <mailto:lberger@labn.net>
+
+     WG Chair: Vishnu Pavan Beeram
+               <mailto:vbeeram@juniper.net>
+
+     Editor:   Xufeng Liu
+               <mailto:xliu@kuatrotech.com>
+
+     Editor:   Igor Bryskin
+               <mailto:Igor.Bryskin@huawei.com>
+
+     Editor:   Vishnu Pavan Beeram
+               <mailto:vbeeram@juniper.net>
+
+     Editor:   Tarek Saad
+               <mailto:tsaad@cisco.com>
+
+     Editor:   Himanshu Shah
+               <mailto:hshah@ciena.com>
+
+     Editor:   Oscar Gonzalez De Dios
+               <mailto:oscar.gonzalezdedios@telefonica.com>";
+
+  description "TE topology model";
+  
+  revision "2016-07-08" {
+    description "Initial revision";
+    reference "TBD";
+  }
+
+  /*
+   * Features
+   */
+
+  feature configuration-schedule {
+    description
+      "This feature indicates that the system supports 
+       configuration scheduling.";
+  }
+
+  feature te-topology-hierarchy {
+    description
+      "This feature indicates that the system allows underlay
+       and/or overlay TE topology hierarchy.";
+  }
+
+  feature te-performance-metric {
+    description
+      "This feature indicates that the system supports
+       TE performance metric.";
+    reference
+      "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
+       RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
+       RFC7823: Performance-Based Path Selection for Explicitly
+       Routed Label Switched Paths (LSPs) Using TE Metric
+       Extensions";
+  }
+
+  feature template {
+    description
+      "This feature indicates that the system supports 
+       template configuration.";
+  }
+
+  /*
+   * Typedefs
+   */
+
+  /*
+   * Identities
+   */
+
+  /*
+   * Groupings
+   */
+  grouping connectivity-label-restriction-list {
+    description
+      "List of abel restrictions specifying what labels may or may
+       not be used on a link connectivity.";
+    list label-restriction {
+      key "inclusive-exclusive label-start";
+      description
+        "List of abel restrictions specifying what labels may or may
+         not be used on a link connectivity.";
+      reference
+        "RFC7579: General Network Element Constraint Encoding
+         for GMPLS-Controlled Networks";
+      leaf inclusive-exclusive {
+        type enumeration {
+          enum inclusive {
+            description "The label or label range is inclusive.";
+          }
+          enum exclusive {
+            description "The label or label range is exclusive.";
+          }
+        }
+        description
+          "Whether the list item is inclusive or exclusive.";
+      }
+      leaf label-start {
+        type te-types:generalized-label;
+        description
+          "This is the starting lable if a lable range is specified.
+           This is the lable value if a single lable is specified,
+           in which case, attribute 'label-end' is not set.";
+      }
+      leaf label-end {
+        type te-types:generalized-label;
+        description
+          "The ending lable if a lable range is specified;
+           This attribute is not set, If a single lable is specified.";
+      }
+      leaf range-bitmap {
+        type binary;
+        description
+          "When there are gaps between label-start and label-end, 
+           this attribute is used to specified the possitions
+           of the used labels.";
+      }
+    }
+  } // connectivity-label-restrictions 
+
+  grouping information-source-attributes {
+    description
+      "The attributes identifying source that has provided the 
+       related information, and the source credibility.";
+    leaf information-source {
+      type enumeration {
+        enum "unknown" {
+          description "The source is unknown.";
+        }
+        enum "locally-configured" {
+          description "Configured entity.";
+        }
+        enum "ospfv2" {
+          description "OSPFv2.";
+        }
+        enum "ospfv3" {
+          description "OSPFv3.";
+        }
+        enum "isis" {
+          description "ISIS.";
+        }
+        enum "system-processed" {
+          description "System processed entity.";
+        }
+        enum "other" {
+          description "Other source.";
+        }
+      }
+      description 
+        "Indicates the source of the information.";
+    }
+    container information-source-state {
+      description
+        "The container contains state attributes related to 
+         the information source.";
+      leaf credibility-preference {
+        type uint16;
+        description
+          "The preference value to calculate the traffic 
+           engineering database credibility value used for 
+           tie-break selection between different 
+           information-source values.
+           Higher value is more preferable.";
+      }      
+      container topology {
+        description 
+          "When the information is processed by the system,
+           the attributes in this container indicate which topology
+           is used to process to generate the result information.";
+        uses te-topology-ref;
+      } // topology
+      leaf routing-instance {
+        type string;
+        description
+          "When applicable, this is the name of a routing instance
+           from which the information is learned.";
+      } // routing-information
+    }
+  } // information-source-attributes
+
+  grouping interface-switching-capability-list {
+    description
+      "List of Interface Switching Capabilities Descriptors (ISCD)";
+
+    list interface-switching-capability {
+      key "switching-capability";
+      description
+        "List of Interface Switching Capabilities Descriptors (ISCD)
+         for this link.";
+      reference
+        "RFC3471: Generalized Multi-Protocol Label Switching (GMPLS)
+         Signaling Functional Description.
+         RFC4203: OSPF Extensions in Support of Generalized 
+         Multi-Protocol Label Switching (GMPLS).";
+      leaf switching-capability {
+        type identityref {
+          base te-types:switching-capabilities;
+        }
+        description
+          "Switching Capability for this interface.";
+      }
+      leaf encoding {
+        type identityref {
+          base te-types:lsp-encoding-types;
+        }
+        description
+          "Encoding supported by this interface.";
+      }
+      list max-lsp-bandwidth {
+        key "priority";
+        max-elements "8";
+        description
+          "Maximum LSP Bandwidth at priorities 0-7.";
+        leaf priority {
+          type uint8 {
+            range "0..7";
+          }
+          description "Priority.";
+        }
+        leaf bandwidth {
+          type decimal64 {
+            fraction-digits 2;
+          }
+          description
+            "Max LSP Bandwidth for this level";
+        }
+      }
+      container time-division-multiplex-capable {
+        when "../switching-capability = 'TDM'" {
+          description "Valid only for TDM";
+        }
+        description
+          "Interface has time-division multiplex capabilities.";
+
+        leaf minimum-lsp-bandwidth {
+          type decimal64 {
+            fraction-digits 2;
+          }
+          description
+            "Minimum LSP Bandwidth. Units in bytes per second.";
+        }
+        leaf indication {
+          type enumeration {
+            enum "standard" {
+              description 
+                "Indicates support of standard SONET/SDH.";
+            }
+            enum "arbitrary" {
+              description 
+                "Indicates support of arbitrary SONET/SDH.";
+            }
+          }
+          description
+            "Indication whether the interface supports Standard or
+             Arbitrary SONET/SDH";
+        }
+      } // time-division-multiplex-capable
+    } // interface-switching-capability
+  } // interface-switching-capability-list
+
+  grouping performance-metric-attributes {
+    description
+      "Link performance information in real time.";
+    reference 
+      "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
+       RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
+       RFC7823: Performance-Based Path Selection for Explicitly
+       Routed Label Switched Paths (LSPs) Using TE Metric
+       Extensions";
+    leaf unidirectional-delay {
+      type uint32 {
+        range 0..16777215;
+      }
+      description "Delay or latency in micro seconds.";
+    }
+    leaf unidirectional-min-delay {
+      type uint32 {
+        range 0..16777215;
+      }
+      description "Minimum delay or latency in micro seconds.";
+    }
+    leaf unidirectional-max-delay {
+      type uint32 {
+        range 0..16777215;
+      }
+      description "Maximum delay or latency in micro seconds.";
+    }
+    leaf unidirectional-delay-variation {
+      type uint32 {
+        range 0..16777215;
+      }
+      description "Delay variation in micro seconds.";
+    }
+    leaf unidirectional-packet-loss {
+      type decimal64 {
+        fraction-digits 6;
+        range "0 .. 50.331642";
+      }
+      description 
+        "Packet loss as a percentage of the total traffic sent
+         over a configurable interval. The finest precision is
+         0.000003%.";
+    }
+    leaf unidirectional-residual-bandwidth {
+      type decimal64 {
+        fraction-digits 2;
+      }
+      description 
+        "Residual bandwidth that subtracts tunnel
+         reservations from Maximum Bandwidth (or link capacity)
+         [RFC3630] and provides an aggregated remainder across QoS
+         classes.";
+    }
+    leaf unidirectional-available-bandwidth {
+      type decimal64 {
+        fraction-digits 2;
+      }
+      description 
+        "Available bandwidth that is defined to be residual
+         bandwidth minus the measured bandwidth used for the
+         actual forwarding of non-RSVP-TE LSP packets.  For a
+         bundled link, available bandwidth is defined to be the
+         sum of the component link available bandwidths.";
+    }
+    leaf unidirectional-utilized-bandwidth {
+      type decimal64 {
+        fraction-digits 2;
+      }
+      description
+        "Bandwidth utilization that represents the actual
+         utilization of the link (i.e. as measured in the router).
+         For a bundled link, bandwidth utilization is defined to
+         be the sum of the component link bandwidth
+         utilizations.";
+    }
+  } // performance-metric-attributes
+
+  grouping performance-metric-normality-attributes {
+    description
+      "Link performance metric normality attributes.";
+    reference 
+      "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
+       RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
+       RFC7823: Performance-Based Path Selection for Explicitly
+       Routed Label Switched Paths (LSPs) Using TE Metric
+       Extensions";
+    leaf unidirectional-delay {
+      type te-types:performance-metric-normality;
+      description "Delay normality.";
+    }
+    leaf unidirectional-min-delay {
+      type te-types:performance-metric-normality;
+      description "Minimum delay or latency normality.";
+    }
+    leaf unidirectional-max-delay {
+      type te-types:performance-metric-normality;
+      description "Maximum delay or latency normality.";
+    }
+    leaf unidirectional-delay-variation {
+      type te-types:performance-metric-normality;
+      description "Delay variation normality.";
+    }
+    leaf unidirectional-packet-loss {
+      type te-types:performance-metric-normality;
+      description "Packet loss normality.";
+    }
+    leaf unidirectional-residual-bandwidth {
+      type te-types:performance-metric-normality;
+      description "Residual bandwidth normality.";
+    }
+    leaf unidirectional-available-bandwidth {
+      type te-types:performance-metric-normality;
+      description "Available bandwidth normality.";
+    }
+    leaf unidirectional-utilized-bandwidth {
+      type te-types:performance-metric-normality;
+      description "Bandwidth utilization normality.";
+    }
+  } // performance-metric-normality-attributes
+
+  grouping performance-metric-throttle-container {
+    description
+      "A container controlling performance metric throttle.";
+    container performance-metric-throttle {
+      if-feature te-performance-metric;
+      must "suppression-interval >= measure-interval" {
+        error-message 
+          "suppression-interval cannot be less then 
+           measure-interval.";
+        description
+          "Constraint on suppression-interval and 
+           measure-interval.";
+      }
+      description
+        "Link performance information in real time.";
+      reference 
+        "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
+         RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
+         RFC7823: Performance-Based Path Selection for Explicitly
+         Routed Label Switched Paths (LSPs) Using TE Metric
+         Extensions";
+      leaf unidirectional-delay-offset {
+        type uint32 {
+          range 0..16777215;
+        }
+        description 
+          "Offset value to be added to the measured delay value.";
+      }
+      leaf measure-interval {
+        type uint32;
+        default 30;
+        description 
+          "Interval in seconds to measure the extended metric
+           values.";
+      }
+      leaf advertisement-interval {
+        type uint32;
+        description 
+          "Interval in seconds to advertise the extended metric
+           values.";
+      }
+      leaf suppression-interval {
+        type uint32 {
+          range "1 .. max";
+        }
+        default 120;
+        description 
+          "Interval in seconds to suppress advertising the extended
+           metric values.";
+      }
+      container threshold-out {
+        uses performance-metric-attributes;
+        description
+          "If the measured parameter falls outside an upper bound
+           for all but the min delay metric (or lower bound for
+           min-delay metric only) and the advertised value is not
+           already outside that bound, anomalous announcement will be
+           triggered.";
+      }
+      container threshold-in {
+        uses performance-metric-attributes;
+        description
+          "If the measured parameter falls inside an upper bound
+           for all but the min delay metric (or lower bound for
+           min-delay metric only) and the advertised value is not
+           already inside that bound, normal (anomalous-flag cleared)
+           announcement will be triggered.";
+      }
+      container threshold-accelerated-advertisement {
+        description
+          "When the difference between the last advertised value and
+           current measured value exceed this threshold, anomalous
+           announcement will be triggered.";
+        uses performance-metric-attributes;
+      }
+    }
+  } // performance-metric-throttle-container
+
+  grouping te-link-augment {
+    description 
+      "Augmentation for TE link.";
+    
+    container te {
+      presence "TE support.";
+      description 
+        "Indicates TE support.";
+
+      container config {
+        description
+          "Configuration data.";
+        uses te-link-config;
+      } // config
+      container state {
+        config false;
+        description
+          "Operational state data.";
+        uses te-link-config;
+        uses te-link-state-derived;
+      } // state
+    } // te
+  } // te-link-augment
+  
+  grouping te-link-config {
+    description
+      "TE link configuration grouping.";
+    choice bundle-stack-level {
+      description 
+        "The TE link can be partitioned into bundled
+         links, or component links.";
+      case bundle {
+        container bundled-links {
+          description
+            "A set of bundled links.";
+          reference
+            "RFC4201: Link Bundling in MPLS Traffic Engineering
+            (TE).";
+          list bundled-link {
+            key "sequence";
+            description
+              "Specify a bundled interface that is
+               further partitioned.";
+            leaf sequence {
+              type uint32;
+              description
+                "Identify the sequence in the bundle.";
+            }
+            leaf src-tp-ref {
+              type leafref {
+                path "../../../../../../nw:node[nw:node-id = "
+                  + "current()/../../../../../nt:source/"
+                  + "nt:source-node]/"
+                  + "nt:termination-point/nt:tp-id";
+                require-instance true;
+              }
+              description
+                "Reference to another TE termination point on the
+                 same souruce node.";
+            }
+            leaf des-tp-ref {
+              type leafref {
+                path "../../../../../../nw:node[nw:node-id = "
+                  + "current()/../../../../../nt:destination/"
+                  + "nt:dest-node]/"
+                  + "nt:termination-point/nt:tp-id";
+                require-instance true;
+              }
+              description
+                "Reference to another TE termination point on the
+                 same destination node.";
+            }
+          } // list bundled-link
+        }
+      }
+      case component {
+        container component-links {
+          description
+            "A set of component links";
+          list component-link {
+            key "sequence";
+            description
+              "Specify a component interface that is
+               sufficient to unambiguously identify the
+               appropriate resources";
+            
+            leaf sequence {
+              type uint32;
+              description
+                "Identify the sequence in the bundle.";
+            }
+            leaf src-interface-ref {
+              type string;
+              description
+                "Reference to component link interface on the
+                 source node.";
+            }
+            leaf des-interface-ref {
+              type string;
+              description
+                "Reference to component link interface on the
+                 destinatioin node.";
+            }
+          }
+        }
+      }
+    } // bundle-stack-level
+    
+    leaf-list te-link-template {
+      if-feature template;
+      type leafref {
+        path "../../../../../te/templates/link-template/name";
+      }
+      description
+        "The reference to a TE link template.";
+    }
+    uses te-link-config-attributes;
+  } // te-link-config
+
+  grouping te-link-config-attributes {
+    description 
+      "Link configuration attributes in a TE topology.";
+    container te-link-attributes {
+      description "Link attributes in a TE topology.";
+      uses sch:schedules;
+      leaf access-type {
+        type te-types:te-link-access-type;
+        description 
+          "Link access type, which can be point-to-point or
+           multi-access.";
+      }
+      container external-domain {
+        description
+          "For an inter-domain link, specify the attributes of 
+           the remote end of link, to facilitate the signalling at
+           local end.";
+        leaf remote-te-node-id {
+          type te-types:te-node-id;
+          description
+            "Remote TE node identifier, used together with
+             remote-te-link-id to identify the remote link 
+             termination point in a different domain.";
+        }
+        leaf remote-te-link-tp-id {
+          type te-types:te-tp-id;
+          description
+            "Remote TE link termination point identifier, used
+             together with remote-te-node-id to identify the remote
+             link termination point in a different domain.";
+        }
+        leaf plug-id {
+          type uint32;
+          description
+            "A topology-wide unique number that identifies on the
+             network a connectivity supporting a given inter-domain
+             TE link. This is more flexible alternative to specifying
+             remote-te-node-id and remote-te-link-tp-id, when the
+             provider does not know remote-te-node-id and
+             remote-te-link-tp-id or need to give client the
+             flexibility to mix-n-match multiple topologies.";
+        }
+      }
+      leaf is-abstract {
+        type empty;
+        description "Present if the link is abstract.";
+      }
+      leaf name {
+        type string;
+        description "Link Name.";
+      }
+      container underlay {
+        if-feature te-topology-hierarchy;
+        presence 
+          "Indicates the underlay exists for this link.";
+        description "Attributes of the te-link underlay.";
+        reference
+          "RFC4206: Label Switched Paths (LSP) Hierarchy with
+           Generalized Multi-Protocol Label Switching (GMPLS)
+           Traffic Engineering (TE)";
+
+        uses te-link-underlay-attributes;
+      } // underlay
+      leaf admin-status {
+        type te-types:te-admin-status;
+        description
+          "The administrative state of the link.";
+      }
+      
+      uses performance-metric-throttle-container;
+      uses te-link-info-attributes;
+    } // te-link-attributes
+  } // te-link-config-attributes
+
+  grouping te-link-connectivity-attributes {
+    description
+      "Advertised TE connectivity attributes.";
+    leaf max-link-bandwidth {
+      type decimal64 {
+        fraction-digits 2;
+      }
+      description
+        "Maximum bandwidth that can be seen on this link in this
+         direction. Units in bytes per second.";
+      reference
+        "RFC3630: Traffic Engineering (TE) Extensions to OSPF
+         Version 2.
+         RFC5305: IS-IS Extensions for Traffic Engineering.";
+    }
+    leaf max-resv-link-bandwidth {
+      type decimal64 {
+        fraction-digits 2;
+      }
+      description
+        "Maximum amount of bandwidth that can be reserved in this
+         direction in this link. Units in bytes per second.";
+      reference
+        "RFC3630: Traffic Engineering (TE) Extensions to OSPF
+         Version 2.
+         RFC5305: IS-IS Extensions for Traffic Engineering.";
+    }
+    list unreserved-bandwidth {
+      key "priority";
+      max-elements "8";
+      description
+        "Unreserved bandwidth for 0-7 priority levels. Units in
+         bytes per second.";
+      reference
+        "RFC3630: Traffic Engineering (TE) Extensions to OSPF
+         Version 2.
+         RFC5305: IS-IS Extensions for Traffic Engineering.";
+      leaf priority {
+        type uint8 {
+          range "0..7";
+        }
+        description "Priority.";
+      }
+      leaf bandwidth {
+        type decimal64 {
+          fraction-digits 2;
+        }
+        description
+          "Unreserved bandwidth for this level.";
+      }
+    }
+    leaf te-default-metric {
+      type uint32;
+      description
+        "Traffic Engineering Metric.";
+    }
+    container performance-metric {
+      if-feature te-performance-metric;
+      description
+        "Link performance information in real time.";
+      reference 
+        "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
+         RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
+         RFC7823: Performance-Based Path Selection for Explicitly
+         Routed Label Switched Paths (LSPs) Using TE Metric
+         Extensions";
+      container measurement {
+        description
+          "Measured performance metric values. Static configuration
+           and manual overrides of these measurements are also 
+           allowed.";
+        uses performance-metric-attributes;
+      }
+      container normality
+      {
+        description
+          "Performance metric normality values.";
+        uses performance-metric-normality-attributes;
+      }
+    }
+    container te-srlgs {
+      description
+        "A list of SLRGs.";
+      leaf-list value {
+        type te-types:srlg;
+        description "SRLG value.";
+        reference
+          "RFC4202: Routing Extensions in Support of
+           Generalized Multi-Protocol Label Switching (GMPLS).";
+      }
+    }
+  } // te-link-connectivity-attributes
+
+  grouping te-link-info-attributes {
+    description
+      "Advertised TE information attributes.";
+    leaf link-index {
+      type uint64;
+      description
+        "The link identifier.  If OSPF is used, this represents an
+         ospfLsdbID.  If IS-IS is used, this represents an isisLSPID.
+         If a locally configured link is used, this object represents
+         a unique value, which is locally defined in a router.";
+    }
+    leaf administrative-group {
+      type te-types:admin-groups;
+      description
+        "Administrative group or color of the link. 
+         This attribute covers both administrative group (defined in
+         RFC3630, RFC5329, and RFC5305), and extended administrative
+         group (defined in RFC7308).";
+    }
+    uses interface-switching-capability-list;
+    leaf link-protection-type {
+      type enumeration {
+        enum "unprotected" {
+          description "Unprotected.";
+        }
+        enum "extra-traffic" {
+          description "Extra traffic.";
+        }
+        enum "shared" {
+          description "Shared.";
+        }
+        enum "1-for-1" {
+          description "One for one protection.";
+        }
+        enum "1-plus-1" {
+          description "One plus one protection.";
+        }
+        enum "enhanced" {
+          description "Enhanced protection.";
+        }
+      }
+      description
+        "Link Protection Type desired for this link.";
+      reference
+        "RFC4202: Routing Extensions in Support of
+         Generalized Multi-Protocol Label Switching (GMPLS).";
+    }
+    uses te-link-connectivity-attributes;
+  } // te-link-info-attributes
+
+  grouping te-link-state-derived {
+    description 
+      "Link state attributes in a TE topology.";
+    leaf oper-status {
+      type te-types:te-oper-status;
+      description
+        "The current operational state of the link.";
+    }
+    leaf is-transitional {
+      type empty;
+      description 
+        "Present if the link is transitional, used as an 
+         alternative approach in lieu of inter-layer-lock-id 
+         for path computation in a TE topology covering multiple
+         layers or multiple regions.";
+      reference
+        "RFC5212: Requirements for GMPLS-Based Multi-Region and
+         Multi-Layer Networks (MRN/MLN).
+         RFC6001: Generalized MPLS (GMPLS) Protocol Extensions
+         for Multi-Layer and Multi-Region Networks (MLN/MRN).";        
+    }
+    uses information-source-attributes;
+    list information-source-entry {
+      key "information-source";
+      description
+        "A list of information sources learned, including the one
+         used.";
+      uses information-source-attributes;
+      uses te-link-info-attributes;
+    }
+    container recovery {
+      description
+        "Status of the recovery process.";
+      leaf restoration-status {
+        type te-types:te-recovery-status;
+        description
+          "Restoration status.";
+      }
+      leaf protection-status {
+        type te-types:te-recovery-status;
+        description
+          "Protection status.";
+      }      
+    }
+    container underlay {
+      if-feature te-topology-hierarchy;
+      description "State attributes for te-link underlay.";
+      uses te-link-state-underlay-attributes;
+    }
+  } // te-link-state-derived
+
+  grouping te-link-state-underlay-attributes {
+    description "State attributes for te-link underlay.";
+    leaf dynamic {
+      type boolean;
+      description 
+        "true if the underlay is dynamically created.";
+    }
+    leaf committed {
+      type boolean;
+      description 
+        "true if the underlay is committed.";
+    }
+  } // te-link-state-underlay-attributes
+    
+  grouping te-link-underlay-attributes {
+    description "Attributes for  te-link underlay.";
+    reference
+      "RFC4206: Label Switched Paths (LSP) Hierarchy with
+       Generalized Multi-Protocol Label Switching (GMPLS)
+       Traffic Engineering (TE)";
+    container underlay-primary-path {
+      description 
+        "The service path on the underlay topology that
+         supports this link.";
+      uses te-topology-ref;
+      list path-element {
+        key "path-element-id";
+        description 
+          "A list of path elements describing the service path.";
+        leaf path-element-id {
+          type uint32;
+          description "To identify the element in a path.";
+        }
+        uses te-path-element;
+      }
+    } // underlay-primary-path
+    list underlay-backup-path {
+      key "index";
+      description 
+        "A list of backup service paths on the underlay topology that
+         protect the underlay primary path. If the primary path is
+         not protected, the list contains zero elements. If the 
+         primary path is protected, the list contains one or more
+         elements.";
+      leaf index {
+        type uint32;
+        description
+          "A sequence number to identify a backup path.";
+      }
+      uses te-topology-ref;
+      list path-element {
+        key "path-element-id";
+        description 
+          "A list of path elements describing the backup service 
+           path";
+        leaf path-element-id {
+          type uint32;
+          description "To identify the element in a path.";
+        }
+        uses te-path-element;
+      }
+    } // underlay-backup-path
+    leaf underlay-protection-type {
+      type uint16;
+      description
+        "Underlay protection type desired for this link";
+    }
+    container underlay-trail-src {
+      uses nt:tp-ref;
+      description
+        "Source TE link of the underlay trail.";
+    }
+    container underlay-trail-des {
+      uses nt:tp-ref;
+      description
+        "Destination TE link of the underlay trail.";
+    }
+  } // te-link-underlay-attributes
+
+  grouping te-node-augment {
+    description
+      "Augmentation for TE node.";
+    
+    container te {
+      presence "TE support.";
+      description 
+        "Indicates TE support.";
+
+      leaf te-node-id {
+        type te-types:te-node-id;
+        mandatory true;
+        description
+          "The identifier of a node in the TE topology.
+           A node is specific to a topology to which it belongs.";
+      }
+
+      container config {
+        description
+          "Configuration data.";
+        uses te-node-config;
+      } // config
+      container state {
+        config false;
+        description
+          "Operational state data.";
+
+        uses te-node-config;
+        uses te-node-state-derived;
+      } // state
+
+      list tunnel-termination-point {
+        key "tunnel-tp-id";
+        description
+          "A termination point can terminate a tunnel.";
+        leaf tunnel-tp-id {
+          type binary;
+          description
+            "Tunnel termination point identifier.";
+        }
+
+        container config {
+          description
+            "Configuration data.";
+          uses te-node-tunnel-termination-capability;
+        }
+
+        container state {
+          config false;
+          description
+            "Operational state data.";
+
+          uses te-node-tunnel-termination-capability;
+        } // state
+        
+      } // tunnel-termination-point
+    } // te
+  } // te-node-augment
+
+  grouping te-node-config {
+    description "TE node configuration grouping.";
+
+    leaf-list te-node-template {
+      if-feature template;
+      type leafref {
+        path "../../../../../te/templates/node-template/name";
+      }
+      description
+        "The reference to a TE node template.";
+    }
+    uses te-node-config-attributes;
+  } // te-node-config
+
+  grouping te-node-config-attributes {
+    description "Configuration node attributes in a TE topology.";
+    container te-node-attributes {
+      description "Containing node attributes in a TE topology.";
+      uses sch:schedules;
+      leaf admin-status {
+        type te-types:te-admin-status;
+        description
+          "The administrative state of the link.";
+      }
+      uses te-node-connectivity-matrix;
+      uses te-node-info-attributes;
+    } // te-node-attributes
+  } // te-node-config-attributes
+    
+  grouping te-node-config-attributes-notification {
+    description 
+      "Configuration node attributes for template in a TE topology.";
+    container te-node-attributes {
+      description "Containing node attributes in a TE topology.";
+      uses sch:schedules;
+      leaf admin-status {
+        type te-types:te-admin-status;
+        description
+          "The administrative state of the link.";
+      }
+      uses te-node-connectivity-matrix-abs;
+      uses te-node-info-attributes;
+    } // te-node-attributes
+  } // te-node-config-attributes-notification
+
+  grouping te-node-config-attributes-template {
+    description 
+      "Configuration node attributes for template in a TE topology.";
+    container te-node-attributes {
+      description "Containing node attributes in a TE topology.";
+      uses sch:schedules;
+      leaf admin-status {
+        type te-types:te-admin-status;
+        description
+          "The administrative state of the link.";
+      }
+      uses te-node-info-attributes;
+    } // te-node-attributes
+  } // te-node-config-attributes-template
+
+  grouping te-node-connectivity-matrix {
+    description "Connectivity matrix on a TE node.";
+    list connectivity-matrix {
+      key "id";
+      description
+        "Represents node's switching limitations, i.e. limitations
+         in interconnecting network TE links across the node.";
+      reference
+        "RFC7579: General Network Element Constraint Encoding
+         for GMPLS-Controlled Networks.";
+      leaf id {
+        type uint32;
+        description "Identifies the connectivity-matrix entry.";
+      }
+      container from {
+        leaf tp-ref {
+          type leafref {
+            path "../../../../../../nt:termination-point/nt:tp-id";
+          }
+          description
+            "Relative reference to source termination point.";
+        }
+        description 
+          "Reference to source NTP.";
+      }
+      container to {
+        leaf tp-ref {
+          type leafref {
+            path "../../../../../../nt:termination-point/nt:tp-id";
+          }
+          description
+            "Relative reference to destination termination point.";
+        }
+        description 
+          "Reference to destination NTP.";
+      }
+      leaf is-allowed {
+        type boolean;
+        description
+          "true  - switching is allowed, 
+           false - switching is disallowed.";
+      }
+      uses connectivity-label-restriction-list;
+      uses te-link-connectivity-attributes;
+    }
+  } // te-node-connectivity-matrix
+    
+  grouping te-node-connectivity-matrix-abs {
+    description 
+      "Connectivity matrix on a TE node, using absolute
+       paths to reference termination points.";
+    list connectivity-matrix {
+      key "id";
+      description
+        "Represents node's switching limitations, i.e. limitations
+         in interconnecting network TE links across the node.";
+      reference
+        "RFC7579: General Network Element Constraint Encoding
+         for GMPLS-Controlled Networks.";
+      leaf id {
+        type uint32;
+        description "Identifies the connectivity-matrix entry.";
+      }
+      container from {
+        uses nt:tp-ref;
+        description 
+          "Reference to source NTP.";
+      }
+      container to {
+        uses nt:tp-ref;
+        description 
+          "Reference to destination NTP.";
+      }
+      leaf is-allowed {
+        type boolean;
+        description
+          "true  - switching is allowed, 
+           false - switching is disallowed.";
+      }
+    }
+  } // te-node-connectivity-matrix-abs
+
+  grouping te-node-info-attributes {
+    description
+      "Advertised TE information attributes.";
+    leaf domain-id {
+      type uint32;
+      description
+        "Identifies the domain that this node belongs.
+         This attribute is used to support inter-domain links.";
+      reference
+        "RFC5152: A Per-Domain Path Computation Method for
+         Establishing Inter-Domain Traffic Engineering (TE)
+         Label Switched Paths (LSPs).
+         RFC5392: OSPF Extensions in Support of Inter-Autonomous
+         System (AS) MPLS and GMPLS Traffic Engineering.
+         RFC5316: ISIS Extensions in Support of Inter-Autonomous
+         System (AS) MPLS and GMPLS Traffic Engineering.";
+    }
+    leaf is-abstract {
+      type empty;
+      description 
+        "Present if the node is abstract, not present if the node
+         is actual.";
+    }
+    leaf name {
+      type inet:domain-name;
+      description "Node name.";
+    }
+    leaf-list signaling-address {
+      type inet:ip-address;
+      description "Node signaling address.";
+    }
+    container underlay-topology {
+      if-feature te-topology-hierarchy;
+      description 
+        "When an abstract node encapsulates a topology, 
+         the attributes in this container point to said topology.";
+      uses te-topology-ref;
+    }
+  } // te-node-info-attributes
+    
+  grouping te-node-state-derived {
+    description "Node state attributes in a TE topology.";
+    leaf oper-status {
+      type te-types:te-oper-status;
+      description
+        "The current operational state of the node.";
+    }
+    leaf is-multi-access-dr {
+      type empty;
+      description
+        "The presence of this attribute indicates that this TE node
+         is a pseudonode elected as a designated router.";
+      reference
+        "RFC3630: Traffic Engineering (TE) Extensions to OSPF
+         Version 2.
+         RFC1195: Use of OSI IS-IS for Routing in TCP/IP and Dual
+         Environments.";
+    }
+    uses information-source-attributes;
+    list information-source-entry {
+      key "information-source";
+      description
+        "A list of information sources learned, including the one
+         used.";
+      uses information-source-attributes;
+      uses te-node-connectivity-matrix;
+      uses te-node-info-attributes;
+    }
+  } // te-node-state-derived
+
+  grouping te-node-state-derived-notification {
+    description "Node state attributes in a TE topology.";
+    leaf oper-status {
+      type te-types:te-oper-status;
+      description
+        "The current operational state of the node.";
+    }
+    leaf is-multi-access-dr {
+      type empty;
+      description
+        "The presence of this attribute indicates that this TE node
+         is a pseudonode elected as a designated router.";
+      reference
+        "RFC3630: Traffic Engineering (TE) Extensions to OSPF
+         Version 2.
+         RFC1195: Use of OSI IS-IS for Routing in TCP/IP and Dual
+         Environments.";
+    }
+    uses information-source-attributes;
+    list information-source-entry {
+      key "information-source";
+      description
+        "A list of information sources learned, including the one
+         used.";
+      uses information-source-attributes;
+      uses te-node-connectivity-matrix-abs;
+      uses te-node-info-attributes;
+    }
+  } // te-node-state-derived-notification
+
+  grouping te-node-tunnel-termination-capability {
+    description 
+      "Termination capability of a tunnel termination point on a
+       TE node.";
+
+    leaf switching-capability {
+      type identityref {
+        base te-types:switching-capabilities;
+      }
+      description
+        "Switching Capability for this interface.";
+    }
+    leaf encoding {
+      type identityref {
+        base te-types:lsp-encoding-types;
+      }
+      description
+        "Encoding supported by this interface.";
+    }
+    leaf inter-layer-lock-id {
+      type uint32;
+      description
+        "Inter layer lock ID, used for path computation in a TE
+         topology covering multiple layers or multiple regions.";
+      reference
+        "RFC5212: Requirements for GMPLS-Based Multi-Region and
+         Multi-Layer Networks (MRN/MLN).
+         RFC6001: Generalized MPLS (GMPLS) Protocol Extensions
+         for Multi-Layer and Multi-Region Networks (MLN/MRN).";        
+    }
+    leaf protection-type {
+      type identityref {
+        base te-types:lsp-prot-type;
+      }
+      description
+        "The protection type that this tunnel termination point
+         is capable of.";
+    }
+
+    list termination-capability {
+      key "link-tp";
+      description
+        "The termination capabilities between 
+         tunnel-termination-point and link termination-point.
+         The capability information can be used to compute
+         the tunnel path.
+         The Interface Adjustment Capability Descriptors (IACD)
+         [RFC6001] on each link-tp can be derived from this 
+         termination-capability list.";
+      reference
+        "RFC6001: Generalized MPLS (GMPLS) Protocol Extensions
+         for Multi-Layer and Multi-Region Networks (MLN/MRN).";
+      leaf link-tp {
+        type leafref {
+          path "../../../../../nt:termination-point/nt:tp-id";
+        }
+        description
+          "Link termination point.";
+      }
+
+      uses connectivity-label-restriction-list;
+
+      list max-lsp-bandwidth {
+        key "priority";
+        max-elements "8";
+        description
+          "Maximum LSP Bandwidth at priorities 0-7.";
+        reference
+          "RFC6001: Generalized MPLS (GMPLS) Protocol Extensions
+           for Multi-Layer and Multi-Region Networks (MLN/MRN).";
+        leaf priority {
+          type uint8 {
+            range "0..7";
+          }
+          description "Priority.";
+        }
+        leaf bandwidth {
+          type decimal64 {
+            fraction-digits 2;
+          }
+          description
+            "Max LSP Bandwidth for this level.";
+        }
+      } // max-lsp-bandwidth
+    } // termination-capability
+  } // te-node-tunnel-termination-capability
+
+  grouping te-path-element {
+    description
+      "A group of attributes defining an element in a TE path
+       such as TE node, TE link, TE atomic resource or label.";
+    uses te-types:explicit-route-subobject;
+  } // te-path-element
+  
+  grouping te-termination-point-augment {
+    description
+      "Augmentation for TE termination point.";
+    
+    container te {
+      presence "TE support.";      
+      description 
+        "Indicates TE support.";
+
+      leaf te-tp-id {
+        type te-types:te-tp-id;
+        mandatory true;
+        description
+          "An identifier to uniquely identify a TE termination
+           point.";
+      }
+
+      container config {
+        description
+          "Configuration data.";
+        uses te-termination-point-config;
+      } // config
+      container state {
+        config false;
+        description
+          "Operational state data.";
+        uses te-termination-point-config;
+      } // state
+    } // te
+  } // te-termination-point-augment
+
+  grouping te-termination-point-config {
+    description 
+      "TE termination point configuration grouping.";
+    uses sch:schedules;
+    uses interface-switching-capability-list;
+    leaf inter-layer-lock-id {
+      type uint32;
+      description
+        "Inter layer lock ID, used for path computation in a TE
+         topology covering multiple layers or multiple regions.";
+      reference
+        "RFC5212: Requirements for GMPLS-Based Multi-Region and
+         Multi-Layer Networks (MRN/MLN).
+         RFC6001: Generalized MPLS (GMPLS) Protocol Extensions
+         for Multi-Layer and Multi-Region Networks (MLN/MRN).";        
+    }
+  } // te-termination-point-config
+
+  grouping te-topologies-augment {
+    description
+      "Augmentation for TE topologies.";
+    
+    container te {
+      presence "TE support.";
+      description 
+        "Indicates TE support.";
+
+      container templates {
+        description
+          "Configuration parameters for templates used for TE
+           topology.";
+
+        list node-template {
+          if-feature template;
+          key "name";
+          leaf name {
+            type te-types:te-template-name;
+            description
+              "The name to identify a TE node template.";
+          }
+          description
+            "The list of TE node templates used to define sharable
+             and reusable TE node attributes.";
+          uses template-attributes;
+          uses te-node-config-attributes-template;
+        } // node-template
+        
+        list link-template {
+          if-feature template;
+          key "name";
+          leaf name {
+            type te-types:te-template-name;
+            description
+              "The name to identify a TE link template.";
+          }
+          description
+            "The list of TE link templates used to define sharable
+             and reusable TE link attributes.";
+          uses template-attributes;
+          uses te-link-config-attributes;
+        } // link-template
+      } // templates
+    } // te
+  } // te-topologies-augment
+
+  grouping te-topology-augment {
+    description
+      "Augmentation for TE topology.";
+    
+    container te {
+      presence "TE support.";
+      description 
+        "Indicates TE support.";
+
+      leaf provider-id {
+        type te-types:te-global-id;
+        mandatory true;
+        description
+          "An identifier to uniquely identify a provider.";
+      }
+      leaf client-id {
+        type te-types:te-global-id;
+        mandatory true;
+        description
+          "An identifier to uniquely identify a client.";
+      }
+      leaf te-topology-id {
+        type te-types:te-topology-id;
+        mandatory true;
+        description
+          "It is presumed that a datastore will contain many
+           topologies. To distinguish between topologies it is
+           vital to have UNIQUE topology identifiers.";
+      }
+
+      container config {
+        description
+          "Configuration data.";
+        uses te-topology-config;
+      } // config
+      container state {
+        config false;
+        description
+          "Operational state data.";
+        uses te-topology-config;
+      } // state
+    } // te
+  } // te-topology-augment
+
+  grouping te-topology-config {
+    description 
+      "TE topology configuration grouping.";
+    uses sch:schedules;
+    leaf preference {
+      type uint8 {
+        range "1..255";
+      }
+      description
+        "Specifies a preference for this topology. A lower number
+         indicates a higher preference.";
+    }
+    leaf optimization-criterion {
+      type identityref {
+        base te-types:te-optimization-criterion;
+      }
+      description
+        "Optimization criterion applied to this topology.";
+      reference
+        "RFC3272: Overview and Principles of Internet Traffic
+         Engineering.";
+    }
+  } // te-topology-config
+
+  grouping te-topology-ref {
+    description
+      "References a TE topology.";
+    leaf provider-id-ref {
+      type leafref {
+        path "/nw:networks/nw:network[nw:network-id = "
+          + "current()/../network-id-ref]/tet:te/tet:provider-id";
+        require-instance false;
+      }
+      description
+        "A reference to a provider-id.";
+    }
+    leaf client-id-ref {
+      type leafref {
+        path "/nw:networks/nw:network[nw:network-id = "
+          + "current()/../network-id-ref]/tet:te/tet:client-id";
+        require-instance false;
+      }
+      description
+        "A reference to a client-id.";
+    }
+    leaf te-topology-id-ref {
+      type leafref {
+        path "/nw:networks/nw:network[nw:network-id = "
+          + "current()/../network-id-ref]/tet:te/tet:te-topology-id";
+        require-instance false;
+      }
+      description
+        "A reference to a te-topology-id.";
+    }
+    leaf network-id-ref {
+      type leafref {
+        path "/nw:networks/nw:network/nw:network-id";
+        require-instance false;
+      }
+      description
+        "A reference to a network-id in base ietf-network module.";
+    }
+  } // te-topology-ref
+
+  grouping te-topology-type {
+    description
+      "Identifies the TE topology type.";
+    container te-topology {
+      presence "Indicates TE topology.";
+      description
+        "Its presence identifies the TE topology type.";
+    }
+  } // te-topology-type
+  
+  grouping template-attributes {
+    description 
+      "Common attributes for all templates.";
+
+    leaf priority {
+      type uint16;
+      description
+        "The preference value to resolve conflicts between different
+         templates. When two or more templates specify values for 
+         one configuration attribute, the value from the template
+         with the highest priority is used.";
+    }
+    leaf reference-change-policy {
+      type enumeration {
+        enum no-action {
+          description
+            "When an attribute changes in this template, the 
+             configuration node referring to this template does 
+             not take any action.";
+        }
+        enum not-allowed {
+          description
+            "When any configuration object has a reference to this
+             template, changing this template is not allowed.";
+        }
+        enum cascade {
+          description
+            "When an attribute changes in this template, the 
+             configuration object referring to this template applies
+             the new attribute value to the corresponding 
+             configuration.";
+        }
+      }
+      description
+        "This attribute specifies the action taken to a configuration
+         node that has a reference to this template.";
+    }
+  } // template-attributes
+
+  /*
+   * Configuration data nodes
+   */
+  augment "/nw:networks/nw:network/nw:network-types" {
+    description
+      "Introduce new network type for TE topology.";
+    uses te-topology-type;
+  }
+
+  augment "/nw:networks" {
+    description
+      "Augmentation parameters for TE topologies.";
+    uses te-topologies-augment;
+  }
+
+  augment "/nw:networks/nw:network" {
+    when "nw:network-types/te-topology" {
+      description
+        "Augmentation parameters apply only for networks with
+         TE topology type.";
+    }
+    description
+      "Configuration parameters for TE topology.";
+    uses te-topology-augment;
+  }
+  
+  augment "/nw:networks/nw:network/nw:node" {
+    when "../nw:network-types/te-topology" {
+      description
+        "Augmentation parameters apply only for networks with
+         TE topology type.";
+    }
+    description
+      "Configuration parameters for TE at node level.";
+    uses te-node-augment;
+  }
+
+  augment "/nw:networks/nw:network/nt:link" {
+    when "../nw:network-types/te-topology" {
+      description
+        "Augmentation parameters apply only for networks with
+         TE topology type.";
+    }
+    description
+      "Configuration parameters for TE at link level";
+    uses te-link-augment;
+  }
+
+  augment "/nw:networks/nw:network/nw:node/"
+        + "nt:termination-point" {
+    when "../../nw:network-types/te-topology" {
+      description
+        "Augmentation parameters apply only for networks with
+         TE topology type.";
+    }
+    description
+      "Configuration parameters for TE at termination point level";
+    uses te-termination-point-augment;
+  }
+
+  /*
+   * Operational state data nodes
+   */
+
+  /*
+   * Notifications
+   */
+
+  notification te-node-event {
+    description "Notification event for TE node.";
+    leaf event-type {
+      type te-types:te-topology-event-type;
+      description "Event type.";
+    }
+    uses nw:node-ref;
+    uses te-topology-type;
+    uses tet:te-node-config-attributes-notification;
+    uses tet:te-node-state-derived-notification;
+  }
+  
+  notification te-link-event {
+    description "Notification event for TE link.";
+    leaf event-type {
+      type te-types:te-topology-event-type;
+      description "Event type";
+    }
+    uses nt:link-ref;
+    uses te-topology-type;
+    uses tet:te-link-config-attributes;
+    uses tet:te-link-state-derived;
+  }
+
+  augment "/te-link-event/te-link-attributes/underlay" {
+    description "Add state attributes to te-link underlay.";
+    uses te-link-state-underlay-attributes;
+  }
+}
diff --git a/apps/tenbi/yangmodel/src/main/yang/ietf-te-types.yang b/apps/tenbi/yangmodel/src/main/yang/ietf-te-types.yang
new file mode 100644
index 0000000..265e21e
--- /dev/null
+++ b/apps/tenbi/yangmodel/src/main/yang/ietf-te-types.yang
@@ -0,0 +1,1207 @@
+module ietf-te-types {
+
+  namespace "urn:ietf:params:xml:ns:yang:ietf-te-types";
+
+  /* Replace with IANA when assigned */
+  prefix "te-types";
+
+  import ietf-inet-types {
+    prefix inet;
+  }
+
+  import ietf-yang-types {
+    prefix "yang";
+  }
+
+  organization
+    "IETF Traffic Engineering Architecture and Signaling (TEAS)
+     Working Group";
+
+  contact
+    "WG Web:   <http://tools.ietf.org/wg/teas/>
+     WG List:  <mailto:teas@ietf.org>
+
+     WG Chair: Lou Berger
+               <mailto:lberger@labn.net>
+
+     WG Chair: Vishnu Pavan Beeram
+               <mailto:vbeeram@juniper.net>
+
+     Editor:   Tarek Saad
+               <mailto:tsaad@cisco.com>
+
+     Editor:   Rakesh Gandhi
+               <mailto:rgandhi@cisco.com>
+
+     Editor:   Vishnu Pavan Beeram
+               <mailto:vbeeram@juniper.net>
+
+     Editor:   Himanshu Shah
+               <mailto:hshah@ciena.com>
+
+     Editor:   Xufeng Liu
+               <mailto:xufeng.liu@ericsson.com>
+
+     Editor:   Xia Chen
+               <mailto:jescia.chenxia@huawei.com>
+
+     Editor:   Raqib Jones
+               <mailto:raqib@Brocade.com>
+
+     Editor:   Bin Wen
+               <mailto:Bin_Wen@cable.comcast.com>";
+
+  description
+    "This module contains a collection of generally
+    useful TE specific YANG data type defintions.";
+
+  revision "2016-07-05" {
+    description "Latest revision of TE basic types";
+    reference "RFC3209";
+  }
+
+  /*
+   * Identities
+   */
+  identity tunnel-type {
+    description
+      "Base identity from which specific tunnel types are
+      derived.";
+  }
+
+  identity tunnel-p2p {
+    base tunnel-type;
+    description
+      "TE point-to-point tunnel type.";
+  }
+
+  identity tunnel-p2mp {
+    base tunnel-type;
+    description
+      "TE point-to-multipoint tunnel type.";
+  }
+
+  identity state-type {
+    description
+      "Base identity for TE states";
+  }
+
+  identity state-up {
+    base state-type;
+    description
+      "State up";
+  }
+
+  identity state-down {
+    base state-type;
+    description
+      "State down";
+  }
+
+  identity path-invalidation-action-type {
+    description
+      "Base identity for TE path invalidation action types";
+  }
+
+  identity tunnel-invalidation-action-drop-type {
+    base path-invalidation-action-type;
+    description
+      "TE path invalidation action drop";
+  }
+
+  identity tunnel-invalidation-action-drop-tear {
+    base path-invalidation-action-type;
+    description
+      "TE path invalidation action tear";
+  }
+
+  identity lsp-prot-type {
+    description
+      "Base identity from which LSP protection types are
+      derived.";
+  }
+
+  identity lsp-prot-unprotected {
+    base lsp-prot-type;
+    description
+      "LSP protection 'Unprotected'";
+    reference "RFC4872";
+  }
+
+  identity lsp-prot-reroute-extra {
+    base lsp-prot-type;
+    description
+      "LSP protection '(Full) Rerouting'";
+    reference "RFC4872";
+  }
+
+  identity lsp-prot-reroute {
+    base lsp-prot-type;
+    description
+      "LSP protection 'Rerouting without Extra-Traffic'";
+    reference "RFC4872";
+  }
+
+  identity lsp-prot-1-for-n {
+    base lsp-prot-type;
+    description
+      "LSP protection '1:N Protection with Extra-Traffic'";
+    reference "RFC4872";
+  }
+
+  identity lsp-prot-unidir-1-to-1 {
+    base lsp-prot-type;
+    description
+      "LSP protection '1+1 Unidirectional Protection'";
+    reference "RFC4872";
+  }
+
+  identity lsp-prot-bidir-1-to-1 {
+    base lsp-prot-type;
+    description
+      "LSP protection '1+1 Bidirectional Protection'";
+    reference "RFC4872";
+  }
+
+  identity switching-capabilities {
+    description
+      "Base identity for interface switching capabilities";
+  }
+
+  identity switching-psc1 {
+    base switching-capabilities;
+    description
+      "Packet-Switch Capable-1 (PSC-1)";
+  }
+
+  identity switching-evpl {
+    base switching-capabilities;
+    description
+      "Ethernet Virtual Private Line (EVPL)";
+  }
+
+  identity switching-l2sc {
+    base switching-capabilities;
+    description
+      "Layer-2 Switch Capable (L2SC)";
+  }
+
+  identity switching-tdm {
+    base switching-capabilities;
+    description
+      "Time-Division-Multiplex Capable (TDM)";
+  }
+
+  identity switching-otn {
+    base switching-capabilities;
+    description
+      "OTN-TDM capable";
+  }
+
+  identity switching-dcsc {
+    base switching-capabilities;
+    description
+      "Data Channel Switching Capable (DCSC)";
+  }
+
+  identity switching-lsc {
+    base switching-capabilities;
+    description
+      "Lambda-Switch Capable (LSC)";
+  }
+
+  identity switching-fsc {
+    base switching-capabilities;
+    description
+      "Fiber-Switch Capable (FSC)";
+  }
+
+  identity lsp-encoding-types {
+    description
+      "Base identity for encoding types";
+  }
+
+  identity lsp-encoding-packet {
+    base lsp-encoding-types;
+    description
+      "Packet LSP encoding";
+  }
+
+  identity lsp-encoding-ethernet {
+    base lsp-encoding-types;
+    description
+      "Ethernet LSP encoding";
+  }
+
+  identity lsp-encoding-pdh {
+    base lsp-encoding-types;
+    description
+      "ANSI/ETSI LSP encoding";
+  }
+
+  identity lsp-encoding-sdh {
+    base lsp-encoding-types;
+    description
+      "SDH ITU-T G.707 / SONET ANSI T1.105 LSP encoding";
+  }
+
+  identity lsp-encoding-digital-wrapper {
+    base lsp-encoding-types;
+    description
+      "Digital Wrapper LSP encoding";
+  }
+
+  identity lsp-encoding-lambda {
+    base lsp-encoding-types;
+    description
+      "Lambda (photonic) LSP encoding";
+  }
+
+  identity lsp-encoding-fiber {
+    base lsp-encoding-types;
+    description
+      "Fiber LSP encoding";
+  }
+
+  identity lsp-encoding-fiber-channel {
+    base lsp-encoding-types;
+    description
+      "FiberChannel LSP encoding";
+  }
+
+  identity lsp-encoding-oduk {
+    base lsp-encoding-types;
+    description
+      "G.709 ODUk (Digital Path)LSP encoding";
+  }
+
+  identity lsp-encoding-optical-channel {
+    base lsp-encoding-types;
+    description
+      "Line (e.g., 8B/10B) LSP encoding";
+  }
+
+  identity lsp-encoding-line {
+    base lsp-encoding-types;
+    description
+      "Line (e.g., 8B/10B) LSP encoding";
+  }
+
+  identity path-signaling-type {
+    description
+      "Base identity from which specific path signaling
+       types are derived.";
+  }
+
+  identity path-signaling-rsvpte {
+    base tunnel-type;
+    description
+      "RSVP-TE path signaling type";
+  }
+
+  identity path-signaling-sr {
+    base tunnel-type;
+    description
+      "Segment-routing path signaling type";
+  }
+
+  /* TE basic features */
+  feature p2mp-te {
+    description
+      "Indicates support for P2MP-TE";
+  }
+
+  feature frr-te {
+    description
+      "Indicates support for TE FastReroute (FRR)";
+  }
+
+  feature extended-admin-groups {
+    description
+      "Indicates support for TE link extended admin
+      groups.";
+  }
+
+  feature named-path-affinities {
+    description
+      "Indicates support for named path affinities";
+  }
+
+  feature named-extended-admin-groups {
+    description
+      "Indicates support for named extended admin groups";
+  }
+
+  feature named-srlg-groups {
+    description
+      "Indicates support for named SRLG groups";
+  }
+
+  feature named-path-constraints {
+    description
+      "Indicates support for named path constraints";
+  }
+
+  grouping explicit-route-subobject {
+    description
+      "The explicit route subobject grouping";
+    choice type {
+      description
+        "The explicit route subobject type";
+      case ipv4-address {
+        description
+          "IPv4 address explicit route subobject";
+        leaf v4-address {
+          type inet:ipv4-address;
+          description
+            "An IPv4 address.  This address is
+            treated as a prefix based on the
+            prefix length value below. Bits beyond
+            the prefix are ignored on receipt and
+            SHOULD be set to zero on transmission.";
+        }
+        leaf v4-prefix-length {
+          type uint8;
+          description
+            "Length in bits of the IPv4 prefix";
+        }
+        leaf v4-loose {
+          type boolean;
+          description
+            "Describes whether the object is loose
+            if set, or otherwise strict";
+        }
+      }
+      case ipv6-address {
+        description
+          "IPv6 address Explicit Route Object";
+        leaf v6-address {
+          type inet:ipv6-address;
+          description
+            "An IPv6 address.  This address is
+            treated as a prefix based on the
+            prefix length value below.  Bits
+            beyond the prefix are ignored on
+            receipt and SHOULD be set to zero
+            on transmission.";
+        }
+        leaf v6-prefix-length {
+          type uint8;
+          description
+            "Length in bits of the IPv4 prefix";
+        }
+        leaf v6-loose {
+          type boolean;
+          description
+            "Describes whether the object is loose
+            if set, or otherwise strict";
+        }
+      }
+      case as-number {
+        leaf as-number {
+          type uint16;
+          description "AS number";
+        }
+        description
+          "Autonomous System explicit route subobject";
+      }
+      case unnumbered-link {
+        leaf router-id {
+          type inet:ip-address;
+          description
+            "A router-id address";
+        }
+        leaf interface-id {
+          type uint32;
+          description "The interface identifier";
+        }
+        description
+          "Unnumbered link explicit route subobject";
+        reference
+          "RFC3477: Signalling Unnumbered Links in
+          RSVP-TE";
+      }
+      case label {
+        leaf value {
+          type uint32;
+          description "the label value";
+        }
+        description
+          "The Label ERO subobject";
+      }
+      /* AS domain sequence..? */
+    }
+  }
+
+  grouping record-route-subobject {
+    description
+      "The record route subobject grouping";
+    choice type {
+      description
+        "The record route subobject type";
+      case ipv4-address {
+        leaf v4-address {
+          type inet:ipv4-address;
+          description
+            "An IPv4 address.  This address is
+            treated as a prefix based on the prefix
+            length value below. Bits beyond the
+            prefix are ignored on receipt and
+            SHOULD be set to zero on transmission.";
+        }
+        leaf v4-prefix-length {
+          type uint8;
+          description
+            "Length in bits of the IPv4 prefix";
+        }
+        leaf v4-flags {
+          type uint8;
+          description
+            "IPv4 address sub-object flags";
+          reference "RFC3209";
+        }
+      }
+      case ipv6-address {
+        leaf v6-address {
+          type inet:ipv6-address;
+          description
+            "An IPv6 address.  This address is
+            treated as a prefix based on the
+            prefix length value below. Bits
+            beyond the prefix are ignored on
+            receipt and SHOULD be set to zero
+            on transmission.";
+        }
+        leaf v6-prefix-length {
+          type uint8;
+          description
+            "Length in bits of the IPv4 prefix";
+        }
+        leaf v6-flags {
+          type uint8;
+          description
+            "IPv6 address sub-object flags";
+          reference "RFC3209";
+        }
+      }
+      case unnumbered-link {
+        leaf router-id {
+          type inet:ip-address;
+          description
+            "A router-id address";
+        }
+        leaf interface-id {
+          type uint32;
+          description "The interface identifier";
+        }
+        description
+          "Unnumbered link record route subobject";
+        reference
+          "RFC3477: Signalling Unnumbered Links in
+           RSVP-TE";
+      }
+      case label {
+        leaf value {
+          type uint32;
+          description "the label value";
+        }
+        leaf flags {
+          type uint8;
+          description
+            "Label sub-object flags";
+          reference "RFC3209";
+        }
+        description
+          "The Label ERO subobject";
+      }
+    }
+  }
+
+  identity route-usage-type {
+    description
+      "Base identity for route usage";
+  }
+
+  identity route-include-ero {
+    base route-usage-type;
+    description
+      "Include ERO from route";
+  }
+
+  identity route-exclude-ero {
+    base route-usage-type;
+    description
+      "Exclude ERO from route";
+  }
+
+  identity route-exclude-srlg {
+    base route-usage-type;
+    description
+      "Exclude SRLG from route";
+  }
+
+  identity path-metric-type {
+    description
+      "Base identity for path metric type";
+  }
+
+  identity path-metric-te {
+    base path-metric-type;
+    description
+      "TE path metric";
+  }
+
+  identity path-metric-igp {
+    base path-metric-type;
+    description
+      "IGP path metric";
+  }
+
+  identity path-tiebreaker-type {
+    description
+      "Base identity for path tie-breaker type";
+  }
+
+  identity path-tiebreaker-minfill {
+    base path-tiebreaker-type;
+    description
+      "Min-Fill LSP path placement";
+  }
+
+  identity path-tiebreaker-maxfill {
+    base path-tiebreaker-type;
+    description
+      "Max-Fill LSP path placement";
+  }
+
+  identity path-tiebreaker-randoom {
+    base path-tiebreaker-type;
+    description
+      "Random LSP path placement";
+  }
+
+  identity bidir-provisioning-mode {
+    description
+      "Base identity for bidirectional provisioning
+      mode.";
+  }
+
+  identity bidir-provisioning-single-sided {
+    base bidir-provisioning-mode;
+    description
+      "Single-sided bidirectional provioning mode";
+  }
+
+  identity bidir-provisioning-double-sided {
+    base bidir-provisioning-mode;
+    description
+      "Double-sided bidirectional provioning mode";
+  }
+
+  identity bidir-association-type {
+    description
+      "Base identity for bidirectional association type";
+  }
+
+  identity bidir-assoc-corouted {
+    base bidir-association-type;
+    description
+      "Co-routed bidirectional association type";
+  }
+
+  identity bidir-assoc-non-corouted {
+    base bidir-association-type;
+    description
+      "Non co-routed bidirectional association type";
+  }
+
+  identity resource-affinities-type {
+    description
+      "Base identity for resource affinities";
+  }
+
+  identity resource-aff-include-all {
+    base resource-affinities-type;
+    description
+      "The set of attribute filters associated with a
+      tunnel all of which must be present for a link
+      to be acceptable";
+  }
+
+  identity resource-aff-include-any {
+    base resource-affinities-type;
+    description
+      "The set of attribute filters associated with a
+      tunnel any of which must be present for a link
+      to be acceptable";
+  }
+
+  identity resource-aff-exclude-any {
+    base resource-affinities-type;
+    description
+      "The set of attribute filters associated with a
+      tunnel any of which renders a link unacceptable";
+  }
+
+  identity te-optimization-criterion {
+    description
+      "Base identity for TE optimization criterion.";
+    reference
+      "RFC3272: Overview and Principles of Internet Traffic
+       Engineering.";
+  }
+
+  identity not-optimized {
+    base te-optimization-criterion;
+    description "Optimization is not applied.";
+  }
+
+  identity cost {
+    base te-optimization-criterion;
+    description "Optimized on cost.";
+  }
+
+  identity delay {
+    base te-optimization-criterion;
+    description "Optimized on delay.";
+  }
+
+  /*
+   * Typedefs
+   */
+  typedef performance-metric-normality {
+    type enumeration {
+      enum "unknown" {        
+        value 0;
+        description
+          "Unknown.";
+      }
+      enum "normal" {        
+        value 1;
+        description
+          "Normal.";
+      }
+      enum "abnormal" {        
+        value 2;
+        description
+          "Abnormal. The anomalous bit is set.";
+      }
+    }
+    description
+      "Indicates whether a performance metric is normal, abnormal, or
+       unknown.";
+    reference
+      "RFC7471: OSPF Traffic Engineering (TE) Metric Extensions.
+       RFC7810: IS-IS Traffic Engineering (TE) Metric Extensions.
+       RFC7823: Performance-Based Path Selection for Explicitly
+       Routed Label Switched Paths (LSPs) Using TE Metric
+       Extensions";
+  }
+
+  typedef te-admin-status {
+    type enumeration {
+      enum up {
+        description
+          "Enabled.";
+      }
+      enum down {
+        description
+          "Disabled.";
+      }
+      enum testing {
+        description
+          "In some test mode.";
+      }
+      enum preparing-maintenance {
+        description
+          "Resource is disabled in the control plane to prepare for
+           graceful shutdown for maintenance purposes.";
+        reference
+          "RFC5817: Graceful Shutdown in MPLS and Generalized MPLS
+           Traffic Engineering Networks";
+      }
+      enum maintenance {
+        description
+          "Resource is disabled in the data plane for maintenance
+           purposes.";
+      }
+    }
+    description
+      "Defines a type representing the administrative status of 
+       a TE resource.";
+  }
+
+  typedef te-global-id {
+    type uint32;
+    description
+      "An identifier to uniquely identify an operator, which can be
+       either a provider or a client.
+       The definition of this type is taken from RFC6370 and RFC5003.
+       This attribute type is used solely to provide a globally
+       unique context for TE topologies.";
+  }
+
+  typedef te-link-access-type {
+    type enumeration {
+      enum point-to-point {
+        description
+          "The link is point-to-point.";
+      }
+      enum multi-access {
+        description
+          "The link is multi-access, including broacast and NBMA.";
+      }
+    }
+    description
+      "Defines a type representing the access type of a TE link.";
+    reference
+      "RFC3630: Traffic Engineering (TE) Extensions to OSPF
+       Version 2.";
+  }
+
+  typedef te-node-id {
+    type yang:dotted-quad;
+    description
+      "An identifier for a node in a topology.
+       The identifier is represented as 32-bit unsigned integer in
+       the dotted-quad notation.
+       This attribute is mapped to Router ID in
+       RFC3630, RFC5329, RFC5305, and RFC6119.";
+  }
+
+  typedef te-oper-status {
+    type enumeration {
+      enum up {
+        description
+        "Operational up.";
+      }
+      enum down {
+        description
+        "Operational down.";
+      }
+      enum testing {
+        description
+        "In some test mode.";
+      }
+      enum unknown {
+        description
+        "Status cannot be determined for some reason.";
+      }
+      enum preparing-maintenance {
+        description
+          "Resource is disabled in the control plane to prepare for
+           graceful shutdown for maintenance purposes.";
+        reference
+          "RFC5817: Graceful Shutdown in MPLS and Generalized MPLS
+           Traffic Engineering Networks";
+      }
+      enum maintenance {
+        description
+          "Resource is disabled in the data plane for maintenance
+           purposes.";
+      }
+    }
+    description
+      "Defines a type representing the operational status of 
+       a TE resource.";
+  }
+
+  typedef te-recovery-status {
+    type enumeration {
+      enum normal {
+        description
+          "Both the recovery and working spans are fully
+           allocated and active, data traffic is being
+           transported over (or selected from) the working
+           span, and no trigger events are reported.";
+      }
+      enum recovery-started {
+        description
+          "The recovery action has been started, but not completed.";
+      }
+      enum recovery-succeeded {
+        description
+          "The recovery action has succeeded. The working span has
+           reported a failure/degrade condition and the user traffic
+           is being transported (or selected) on the recovery span.";
+      }
+      enum recovery-failed {
+        description
+          "The recovery action has failed.";
+      }
+      enum reversion-started {
+        description
+          "The reversion has started.";
+      }
+      enum reversion-failed {
+        description
+          "The reversion has failed.";
+      }
+      enum recovery-unavailable {
+        description
+          "The recovery is unavailable -- either as a result of an
+           operator Lockout command or a failure condition detected
+           on the recovery span.";
+      }
+      enum recovery-admin {
+        description
+          "The operator has issued a command switching the user
+           traffic to the recovery span.";
+      }
+      enum wait-to-restore {
+        description
+          "The recovery domain is recovering from a failuer/degrade
+           condition on the working span that is being controlled by
+           the Wait-to-Restore (WTR) timer.";
+      }
+    }
+    description
+      "Defines the status of a recovery action.";
+    reference
+      "RFC4427: Recovery (Protection and Restoration) Terminology
+       for Generalized Multi-Protocol Label Switching (GMPLS).
+       RFC6378: MPLS Transport Profile (MPLS-TP) Linear Protection";
+  }
+
+  typedef te-template-name {
+    type string {
+      pattern '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*';
+    }
+    description
+      "A type for the name of a TE node template or TE link
+       template.";
+  }
+  
+  typedef te-topology-event-type {
+    type enumeration {
+      enum "add" {
+        value 0;
+        description 
+          "A TE node or te-link has been added.";
+      }
+      enum "remove" {
+        value 1;
+        description 
+          "A TE node or te-link has been removed.";
+      }
+      enum "update" {
+        value 2;
+        description 
+          "A TE node or te-link has been updated.";
+      }
+    }
+    description "TE  Event type for notifications";
+  } // te-topology-event-type
+  
+  typedef te-topology-id {
+    type string {
+      pattern '/?([a-zA-Z0-9\-_.]+)(/[a-zA-Z0-9\-_.]+)*';
+    }
+    description
+      "An identifier for a topology.";
+  }
+  
+  typedef te-tp-id {
+    type union {
+      type uint32;          // Unnumbered
+      type inet:ip-address; // IPv4 or IPv6 address
+    }
+    description
+      "An identifier for a TE link endpoint on a node.
+       This attribute is mapped to local or remote link identifier in
+       RFC3630 and RFC5305.";
+  }
+  
+  typedef generalized-label {
+    type binary;
+    description
+      "Generalized label. Nodes sending and receiving the
+       Generalized Label know what kinds of link they are
+       using, the Generalized Label does not identify its
+       type.  Instead, nodes are expected to know from the
+       context what type of label to expect.";
+      reference "rfc3471: section 3.2";
+  }
+
+  typedef admin-group {
+    type binary {
+      length 32;
+    }
+    description
+      "Administrative group/Resource class/Color.";
+  }
+
+  typedef extended-admin-group {
+    type binary;
+    description
+      "Extended administrative group/Resource class/Color.";
+  }
+
+  typedef admin-groups {
+    type union {
+      type admin-group;
+      type extended-admin-group;
+    }
+    description "TE administrative group derived type";
+  }
+
+  typedef srlg {
+    type uint32;
+    description "SRLG type";
+  }
+
+  identity path-computation-srlg-type {
+    description
+      "Base identity for SRLG path computation";
+  }
+
+  identity srlg-ignore {
+    base path-computation-srlg-type;
+    description
+      "Ignores SRLGs in path computation";
+  }
+
+  identity srlg-strict {
+    base path-computation-srlg-type;
+    description
+      "Include strict SRLG check in path computation";
+  }
+
+  identity srlg-preferred {
+    base path-computation-srlg-type;
+    description
+      "Include preferred SRLG check in path computation";
+  }
+
+  identity srlg-weighted {
+    base path-computation-srlg-type;
+    description
+      "Include weighted SRLG check in path computation";
+  }
+
+  typedef te-metric {
+    type uint32;
+    description
+      "TE link metric";
+  }
+
+  /**
+   * TE tunnel generic groupings
+   **/
+
+  /* Tunnel path selection parameters */
+  grouping tunnel-path-selection {
+    description
+      "Tunnel path selection properties grouping";
+    container path-selection {
+      description
+        "Tunnel path selection properties container";
+      leaf topology-id {
+        type te-types:te-topology-id;
+        description
+          "The tunnel path is computed using the specific
+          topology identified by this identifier";
+      }
+      leaf cost-limit {
+        type uint32 {
+          range "1..4294967295";
+        }
+        description
+          "The tunnel path cost limit.";
+      }
+      leaf hop-limit {
+        type uint8 {
+          range "1..255";
+        }
+        description
+          "The tunnel path hop limit.";
+      }
+      leaf metric-type {
+        type identityref {
+          base path-metric-type;
+        }
+        default path-metric-te;
+        description
+          "The tunnel path metric type.";
+      }
+      leaf tiebreaker-type {
+        type identityref {
+          base path-tiebreaker-type;
+        }
+        default path-tiebreaker-maxfill;
+        description
+          "The tunnel path computation tie breakers.";
+      }
+      leaf ignore-overload {
+        type boolean;
+        description
+          "The tunnel path can traverse overloaded node.";
+      }
+      uses tunnel-path-affinities;
+      uses tunnel-path-srlgs;
+    }
+  }
+
+  grouping tunnel-path-affinities {
+    description
+      "Path affinities grouping";
+    container tunnel-path-affinities {
+      if-feature named-path-affinities;
+      description
+        "Path affinities container";
+      choice style {
+        description
+          "Path affinities representation style";
+        case values {
+          leaf value {
+            type uint32 {
+              range "0..4294967295";
+            }
+            description
+              "Affinity value";
+          }
+          leaf mask {
+            type uint32 {
+              range "0..4294967295";
+            }
+            description
+              "Affinity mask";
+          }
+        }
+        case named {
+          list constraints {
+            key "usage";
+            leaf usage {
+              type identityref {
+                base resource-affinities-type;
+              }
+              description "Affinities usage";
+            }
+            container constraint {
+              description
+                "Container for named affinities";
+              list affinity-names {
+                key "name";
+                leaf name {
+                  type string;
+                  description
+                    "Affinity name";
+                }
+                description
+                  "List of named affinities";
+              }
+            }
+            description
+              "List of named affinity constraints";
+          }
+        }
+      }
+    }
+  }
+
+  grouping tunnel-path-srlgs {
+    description
+      "Path SRLG properties grouping";
+    container tunnel-path-srlgs {
+      description
+        "Path SRLG properties container";
+      choice style {
+        description
+          "Type of SRLG representation";
+        case values {
+          leaf usage {
+            type identityref {
+              base route-exclude-srlg;
+            }
+            description "SRLG usage";
+          }
+          leaf-list values {
+            type te-types:srlg;
+            description "SRLG value";
+          }
+        }
+        case named {
+          list constraints {
+            key "usage";
+            leaf usage {
+              type identityref {
+                base route-exclude-srlg;
+              }
+              description "SRLG usage";
+            }
+            container constraint {
+              description
+                "Container for named SRLG list";
+              list srlg-names {
+                key "name";
+                leaf name {
+                  type string;
+                  description
+                    "The SRLG name";
+                }
+                description
+                  "List named SRLGs";
+              }
+            }
+            description
+              "List of named SRLG constraints";
+          }
+        }
+      }
+    }
+  }
+
+  grouping tunnel-bidir-assoc-properties {
+    description
+      "TE tunnel associated bidirectional properties
+      grouping";
+    container bidirectional {
+      description
+        "TE tunnel associated bidirectional attributes.";
+      container association {
+        description
+          "Tunnel bidirectional association properties";
+        leaf id {
+          type uint16;
+          description
+            "The TE tunnel association identifier.";
+        }
+        leaf source {
+          type inet:ip-address;
+          description
+            "The TE tunnel association source.";
+        }
+        leaf global-source {
+          type inet:ip-address;
+          description
+            "The TE tunnel association global
+            source.";
+        }
+        leaf type {
+          type identityref {
+            base bidir-association-type;
+          }
+          default bidir-assoc-non-corouted;
+          description
+            "The TE tunnel association type.";
+        }
+        leaf provisioing {
+          type identityref {
+            base bidir-provisioning-mode;
+          }
+          description
+            "Describes the provisioning model of the
+            associated bidirectional LSP";
+          reference
+            "draft-ietf-teas-mpls-tp-rsvpte-ext-
+            associated-lsp, section-3.2";
+        }
+      }
+    }
+  }
+  /*** End of TE tunnel groupings ***/
+
+  /**
+   * TE interface generic groupings
+   **/
+}
diff --git a/apps/tenbi/yangmodel/src/main/yang/ietf-yang-types@2013-07-15.yang b/apps/tenbi/yangmodel/src/main/yang/ietf-yang-types@2013-07-15.yang
new file mode 100755
index 0000000..371a091
--- /dev/null
+++ b/apps/tenbi/yangmodel/src/main/yang/ietf-yang-types@2013-07-15.yang
@@ -0,0 +1,480 @@
+module ietf-yang-types {
+
+  namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types";
+  prefix "yang";
+
+  organization
+   "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
+
+  contact
+   "WG Web:   <http://tools.ietf.org/wg/netmod/>
+    WG List:  <mailto:netmod@ietf.org>
+
+    WG Chair: David Kessens
+              <mailto:david.kessens@nsn.com>
+
+    WG Chair: Juergen Schoenwaelder
+              <mailto:j.schoenwaelder@jacobs-university.de>
+
+    Editor:   Juergen Schoenwaelder
+              <mailto:j.schoenwaelder@jacobs-university.de>";
+
+  description
+   "This module contains a collection of generally useful derived
+    YANG data types.
+
+    Copyright (c) 2013 IETF Trust and the persons identified as
+    authors of the code.  All rights reserved.
+
+    Redistribution and use in source and binary forms, with or
+    without modification, is permitted pursuant to, and subject
+    to the license terms contained in, the Simplified BSD License
+    set forth in Section 4.c of the IETF Trust's Legal Provisions
+    Relating to IETF Documents
+    (http://trustee.ietf.org/license-info).
+
+    This version of this YANG module is part of RFC 6991; see
+    the RFC itself for full legal notices.";
+
+  revision 2013-07-15 {
+    description
+     "This revision adds the following new data types:
+      - yang-identifier
+      - hex-string
+      - uuid
+      - dotted-quad";
+    reference
+     "RFC 6991: Common YANG Data Types";
+  }
+
+  revision 2010-09-24 {
+    description
+     "Initial revision.";
+    reference
+     "RFC 6021: Common YANG Data Types";
+  }
+
+  /*** collection of counter and gauge types ***/
+
+  typedef counter32 {
+    type uint32;
+    description
+     "The counter32 type represents a non-negative integer
+      that monotonically increases until it reaches a
+      maximum value of 2^32-1 (4294967295 decimal), when it
+      wraps around and starts increasing again from zero.
+
+      Counters have no defined 'initial' value, and thus, a
+      single value of a counter has (in general) no information
+      content.  Discontinuities in the monotonically increasing
+      value normally occur at re-initialization of the
+      management system, and at other times as specified in the
+      description of a schema node using this type.  If such
+      other times can occur, for example, the creation of
+      a schema node of type counter32 at times other than
+      re-initialization, then a corresponding schema node
+      should be defined, with an appropriate type, to indicate
+      the last discontinuity.
+
+      The counter32 type should not be used for configuration
+      schema nodes.  A default statement SHOULD NOT be used in
+      combination with the type counter32.
+
+      In the value set and its semantics, this type is equivalent
+      to the Counter32 type of the SMIv2.";
+    reference
+     "RFC 2578: Structure of Management Information Version 2
+                (SMIv2)";
+  }
+
+  typedef zero-based-counter32 {
+    type yang:counter32;
+    default "0";
+    description
+     "The zero-based-counter32 type represents a counter32
+      that has the defined 'initial' value zero.
+
+      A schema node of this type will be set to zero (0) on creation
+      and will thereafter increase monotonically until it reaches
+      a maximum value of 2^32-1 (4294967295 decimal), when it
+      wraps around and starts increasing again from zero.
+
+      Provided that an application discovers a new schema node
+      of this type within the minimum time to wrap, it can use the
+      'initial' value as a delta.  It is important for a management
+      station to be aware of this minimum time and the actual time
+      between polls, and to discard data if the actual time is too
+      long or there is no defined minimum time.
+
+      In the value set and its semantics, this type is equivalent
+      to the ZeroBasedCounter32 textual convention of the SMIv2.";
+    reference
+      "RFC 4502: Remote Network Monitoring Management Information
+                 Base Version 2";
+  }
+
+  typedef counter64 {
+    type uint64;
+    description
+     "The counter64 type represents a non-negative integer
+      that monotonically increases until it reaches a
+      maximum value of 2^64-1 (18446744073709551615 decimal),
+      when it wraps around and starts increasing again from zero.
+
+      Counters have no defined 'initial' value, and thus, a
+      single value of a counter has (in general) no information
+      content.  Discontinuities in the monotonically increasing
+      value normally occur at re-initialization of the
+      management system, and at other times as specified in the
+      description of a schema node using this type.  If such
+      other times can occur, for example, the creation of
+      a schema node of type counter64 at times other than
+      re-initialization, then a corresponding schema node
+      should be defined, with an appropriate type, to indicate
+      the last discontinuity.
+
+      The counter64 type should not be used for configuration
+      schema nodes.  A default statement SHOULD NOT be used in
+      combination with the type counter64.
+
+      In the value set and its semantics, this type is equivalent
+      to the Counter64 type of the SMIv2.";
+    reference
+     "RFC 2578: Structure of Management Information Version 2
+                (SMIv2)";
+  }
+
+  typedef zero-based-counter64 {
+    type yang:counter64;
+    default "0";
+    description
+     "The zero-based-counter64 type represents a counter64 that
+      has the defined 'initial' value zero.
+
+
+
+
+      A schema node of this type will be set to zero (0) on creation
+      and will thereafter increase monotonically until it reaches
+      a maximum value of 2^64-1 (18446744073709551615 decimal),
+      when it wraps around and starts increasing again from zero.
+
+      Provided that an application discovers a new schema node
+      of this type within the minimum time to wrap, it can use the
+      'initial' value as a delta.  It is important for a management
+      station to be aware of this minimum time and the actual time
+      between polls, and to discard data if the actual time is too
+      long or there is no defined minimum time.
+
+      In the value set and its semantics, this type is equivalent
+      to the ZeroBasedCounter64 textual convention of the SMIv2.";
+    reference
+     "RFC 2856: Textual Conventions for Additional High Capacity
+                Data Types";
+  }
+
+  typedef gauge32 {
+    type uint32;
+    description
+     "The gauge32 type represents a non-negative integer, which
+      may increase or decrease, but shall never exceed a maximum
+      value, nor fall below a minimum value.  The maximum value
+      cannot be greater than 2^32-1 (4294967295 decimal), and
+      the minimum value cannot be smaller than 0.  The value of
+      a gauge32 has its maximum value whenever the information
+      being modeled is greater than or equal to its maximum
+      value, and has its minimum value whenever the information
+      being modeled is smaller than or equal to its minimum value.
+      If the information being modeled subsequently decreases
+      below (increases above) the maximum (minimum) value, the
+      gauge32 also decreases (increases).
+
+      In the value set and its semantics, this type is equivalent
+      to the Gauge32 type of the SMIv2.";
+    reference
+     "RFC 2578: Structure of Management Information Version 2
+                (SMIv2)";
+  }
+
+  typedef gauge64 {
+    type uint64;
+    description
+     "The gauge64 type represents a non-negative integer, which
+      may increase or decrease, but shall never exceed a maximum
+      value, nor fall below a minimum value.  The maximum value
+      cannot be greater than 2^64-1 (18446744073709551615), and
+      the minimum value cannot be smaller than 0.  The value of
+      a gauge64 has its maximum value whenever the information
+      being modeled is greater than or equal to its maximum
+      value, and has its minimum value whenever the information
+      being modeled is smaller than or equal to its minimum value.
+      If the information being modeled subsequently decreases
+      below (increases above) the maximum (minimum) value, the
+      gauge64 also decreases (increases).
+
+      In the value set and its semantics, this type is equivalent
+      to the CounterBasedGauge64 SMIv2 textual convention defined
+      in RFC 2856";
+    reference
+     "RFC 2856: Textual Conventions for Additional High Capacity
+                Data Types";
+  }
+
+  /*** collection of identifier-related types ***/
+
+  typedef object-identifier {
+    type string {
+      pattern '(([0-1](\.[1-3]?[0-9]))|(2\.(0|([1-9]\d*))))'
+            + '(\.(0|([1-9]\d*)))*';
+    }
+    description
+     "The object-identifier type represents administratively
+      assigned names in a registration-hierarchical-name tree.
+
+      Values of this type are denoted as a sequence of numerical
+      non-negative sub-identifier values.  Each sub-identifier
+      value MUST NOT exceed 2^32-1 (4294967295).  Sub-identifiers
+      are separated by single dots and without any intermediate
+      whitespace.
+
+      The ASN.1 standard restricts the value space of the first
+      sub-identifier to 0, 1, or 2.  Furthermore, the value space
+      of the second sub-identifier is restricted to the range
+      0 to 39 if the first sub-identifier is 0 or 1.  Finally,
+      the ASN.1 standard requires that an object identifier
+      has always at least two sub-identifiers.  The pattern
+      captures these restrictions.
+
+      Although the number of sub-identifiers is not limited,
+      module designers should realize that there may be
+      implementations that stick with the SMIv2 limit of 128
+      sub-identifiers.
+
+      This type is a superset of the SMIv2 OBJECT IDENTIFIER type
+      since it is not restricted to 128 sub-identifiers.  Hence,
+      this type SHOULD NOT be used to represent the SMIv2 OBJECT
+      IDENTIFIER type; the object-identifier-128 type SHOULD be
+      used instead.";
+    reference
+     "ISO9834-1: Information technology -- Open Systems
+      Interconnection -- Procedures for the operation of OSI
+      Registration Authorities: General procedures and top
+      arcs of the ASN.1 Object Identifier tree";
+  }
+
+  typedef object-identifier-128 {
+    type object-identifier {
+      pattern '\d*(\.\d*){1,127}';
+    }
+    description
+     "This type represents object-identifiers restricted to 128
+      sub-identifiers.
+
+      In the value set and its semantics, this type is equivalent
+      to the OBJECT IDENTIFIER type of the SMIv2.";
+    reference
+     "RFC 2578: Structure of Management Information Version 2
+                (SMIv2)";
+  }
+
+  typedef yang-identifier {
+    type string {
+      length "1..max";
+      pattern '[a-zA-Z_][a-zA-Z0-9\-_.]*';
+      pattern '.|..|[^xX].*|.[^mM].*|..[^lL].*';
+    }
+    description
+      "A YANG identifier string as defined by the 'identifier'
+       rule in Section 12 of RFC 6020.  An identifier must
+       start with an alphabetic character or an underscore
+       followed by an arbitrary sequence of alphabetic or
+       numeric characters, underscores, hyphens, or dots.
+
+       A YANG identifier MUST NOT start with any possible
+       combination of the lowercase or uppercase character
+       sequence 'xml'.";
+    reference
+      "RFC 6020: YANG - A Data Modeling Language for the Network
+                 Configuration Protocol (NETCONF)";
+  }
+
+  /*** collection of types related to date and time***/
+
+  typedef date-and-time {
+    type string {
+      pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?'
+            + '(Z|[\+\-]\d{2}:\d{2})';
+    }
+    description
+     "The date-and-time type is a profile of the ISO 8601
+      standard for representation of dates and times using the
+      Gregorian calendar.  The profile is defined by the
+      date-time production in Section 5.6 of RFC 3339.
+
+      The date-and-time type is compatible with the dateTime XML
+      schema type with the following notable exceptions:
+
+      (a) The date-and-time type does not allow negative years.
+
+      (b) The date-and-time time-offset -00:00 indicates an unknown
+          time zone (see RFC 3339) while -00:00 and +00:00 and Z
+          all represent the same time zone in dateTime.
+
+      (c) The canonical format (see below) of data-and-time values
+          differs from the canonical format used by the dateTime XML
+          schema type, which requires all times to be in UTC using
+          the time-offset 'Z'.
+
+      This type is not equivalent to the DateAndTime textual
+      convention of the SMIv2 since RFC 3339 uses a different
+      separator between full-date and full-time and provides
+      higher resolution of time-secfrac.
+
+      The canonical format for date-and-time values with a known time
+      zone uses a numeric time zone offset that is calculated using
+      the device's configured known offset to UTC time.  A change of
+      the device's offset to UTC time will cause date-and-time values
+      to change accordingly.  Such changes might happen periodically
+      in case a server follows automatically daylight saving time
+      (DST) time zone offset changes.  The canonical format for
+      date-and-time values with an unknown time zone (usually
+      referring to the notion of local time) uses the time-offset
+      -00:00.";
+    reference
+     "RFC 3339: Date and Time on the Internet: Timestamps
+      RFC 2579: Textual Conventions for SMIv2
+      XSD-TYPES: XML Schema Part 2: Datatypes Second Edition";
+  }
+
+  typedef timeticks {
+    type uint32;
+    description
+     "The timeticks type represents a non-negative integer that
+      represents the time, modulo 2^32 (4294967296 decimal), in
+      hundredths of a second between two epochs.  When a schema
+      node is defined that uses this type, the description of
+      the schema node identifies both of the reference epochs.
+
+      In the value set and its semantics, this type is equivalent
+      to the TimeTicks type of the SMIv2.";
+    reference
+     "RFC 2578: Structure of Management Information Version 2
+                (SMIv2)";
+  }
+
+  typedef timestamp {
+    type yang:timeticks;
+    description
+     "The timestamp type represents the value of an associated
+      timeticks schema node at which a specific occurrence
+      happened.  The specific occurrence must be defined in the
+      description of any schema node defined using this type.  When
+      the specific occurrence occurred prior to the last time the
+      associated timeticks attribute was zero, then the timestamp
+      value is zero.  Note that this requires all timestamp values
+      to be reset to zero when the value of the associated timeticks
+      attribute reaches 497+ days and wraps around to zero.
+
+      The associated timeticks schema node must be specified
+      in the description of any schema node using this type.
+
+      In the value set and its semantics, this type is equivalent
+      to the TimeStamp textual convention of the SMIv2.";
+    reference
+     "RFC 2579: Textual Conventions for SMIv2";
+  }
+
+  /*** collection of generic address types ***/
+
+  typedef phys-address {
+    type string {
+      pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';
+    }
+
+
+
+
+    description
+     "Represents media- or physical-level addresses represented
+      as a sequence octets, each octet represented by two hexadecimal
+      numbers.  Octets are separated by colons.  The canonical
+      representation uses lowercase characters.
+
+      In the value set and its semantics, this type is equivalent
+      to the PhysAddress textual convention of the SMIv2.";
+    reference
+     "RFC 2579: Textual Conventions for SMIv2";
+  }
+
+  typedef mac-address {
+    type string {
+      pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}';
+    }
+    description
+     "The mac-address type represents an IEEE 802 MAC address.
+      The canonical representation uses lowercase characters.
+
+      In the value set and its semantics, this type is equivalent
+      to the MacAddress textual convention of the SMIv2.";
+    reference
+     "IEEE 802: IEEE Standard for Local and Metropolitan Area
+                Networks: Overview and Architecture
+      RFC 2579: Textual Conventions for SMIv2";
+  }
+
+  /*** collection of XML-specific types ***/
+
+  typedef xpath1.0 {
+    type string;
+    description
+     "This type represents an XPATH 1.0 expression.
+
+      When a schema node is defined that uses this type, the
+      description of the schema node MUST specify the XPath
+      context in which the XPath expression is evaluated.";
+    reference
+     "XPATH: XML Path Language (XPath) Version 1.0";
+  }
+
+  /*** collection of string types ***/
+
+  typedef hex-string {
+    type string {
+      pattern '([0-9a-fA-F]{2}(:[0-9a-fA-F]{2})*)?';
+    }
+    description
+     "A hexadecimal string with octets represented as hex digits
+      separated by colons.  The canonical representation uses
+      lowercase characters.";
+  }
+
+  typedef uuid {
+    type string {
+      pattern '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-'
+            + '[0-9a-fA-F]{4}-[0-9a-fA-F]{12}';
+    }
+    description
+     "A Universally Unique IDentifier in the string representation
+      defined in RFC 4122.  The canonical representation uses
+      lowercase characters.
+
+      The following is an example of a UUID in string representation:
+      f81d4fae-7dec-11d0-a765-00a0c91e6bf6
+      ";
+    reference
+     "RFC 4122: A Universally Unique IDentifier (UUID) URN
+                Namespace";
+  }
+
+  typedef dotted-quad {
+    type string {
+      pattern
+        '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
+      + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])';
+    }
+    description
+      "An unsigned 32-bit number expressed in the dotted-quad
+       notation, i.e., four octets written as decimal numbers
+       and separated with the '.' (full stop) character.";
+  }
+}