summaryrefslogtreecommitdiffstats
path: root/plugins/restconf-client/provider
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2021-04-14 14:15:41 -0400
committerDan Timoney <dtimoney@att.com>2021-04-19 17:45:33 +0000
commit43228cc2a7f06d5e1b6e398023684c80d9ed1270 (patch)
tree1128649a01f6da9e4941adfb30f1e95715aa14d9 /plugins/restconf-client/provider
parent19c7de1f524478ea351f4d2dcd76508455a75ba8 (diff)
Fix yangparser invocation
Fix YangParser invocation in restconf-provider to address breaking change in ODL Aluminum release. Issue-ID: SDNC-1515 Signed-off-by: Dan Timoney <dtimoney@att.com> Change-Id: I9974889bfa9bbd11077c95275c0cb8ba59b1b0bb
Diffstat (limited to 'plugins/restconf-client/provider')
-rwxr-xr-xplugins/restconf-client/provider/pom.xml1
-rw-r--r--plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java60
-rw-r--r--plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java25
-rwxr-xr-xplugins/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml7
-rw-r--r--plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfapicall/TestRestconfApiUtils.java52
-rw-r--r--plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java10
-rw-r--r--plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DataFormatSerializerTest.java6
-rw-r--r--plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/IdentifierValidationTest.java6
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/SLI-API/sliapi.yang117
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/cds/execution-service.yang43
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/notification/ietf-subscribed-notifications.yang21
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-eth-tran-service@2018-03-01.yang572
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-eth-tran-types@2018-05-24.yang303
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-inet-types.yang430
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-otn-tunnel@2018-06-07.yang837
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-otn-types@2018-06-07.yang565
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-routing-types@2017-10-13.yang733
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-te-types@2018-07-01.yang2457
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-te@2018-03-03.yang1562
-rw-r--r--plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-yang-types.yang438
20 files changed, 8206 insertions, 39 deletions
diff --git a/plugins/restconf-client/provider/pom.xml b/plugins/restconf-client/provider/pom.xml
index 6dcc7d70d..b48c8cd48 100755
--- a/plugins/restconf-client/provider/pom.xml
+++ b/plugins/restconf-client/provider/pom.xml
@@ -93,6 +93,7 @@
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>yang-parser-impl</artifactId>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java
index 679ba57b7..b5a9df706 100644
--- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java
+++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiCallNode.java
@@ -3,6 +3,7 @@
* ONAP - CCSDK
* ================================================================================
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
+ * Modifications Copyright (c) 2021 AT&T
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -48,7 +49,6 @@ import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializ
import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.XML_TREE_ERR;
import static org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.DfSerializerUtil.getXmlWriter;
import static org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.MdsalPropertiesNodeUtils.getModuleNamespace;
-import static org.osgi.framework.FrameworkUtil.getBundle;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
@@ -85,10 +85,9 @@ import org.onap.ccsdk.sli.plugins.yangserializers.pnserializer.PropertiesNodeSer
import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
import org.opendaylight.restconf.nb.rfc8040.utils.parser.ParserIdentifier;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
-import org.opendaylight.yangtools.yang.model.api.SchemaContext;
import org.opendaylight.yangtools.yang.model.api.SchemaNode;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
+import org.opendaylight.yangtools.yang.model.parser.api.YangParserException;
+import org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -109,12 +108,20 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin {
private RestapiCallNode restapiCallNode;
/**
- * Creates an instance of restconf api call node with restapi call node.
+ * Yang parser factory
+ */
+ private YangParserFactory parserFactory;
+
+
+ /**
+ * Creates an instance of restconf api call node with restapi call node, within OSGi
*
* @param r restapi call node
+ * @param parserFactory Yang parser factory
*/
- public RestconfApiCallNode(RestapiCallNode r) {
+ public RestconfApiCallNode(RestapiCallNode r, YangParserFactory parserFactory) {
this.restapiCallNode = r;
+ this.parserFactory = parserFactory;
}
/**
@@ -125,6 +132,25 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin {
return restapiCallNode;
}
+
+ /**
+ * Returns the yang parser factory instance
+ * @return
+ */
+ public YangParserFactory getParserFactory() {
+ return parserFactory;
+ }
+
+ /**
+ * set the yang parser factory instance
+ * @return
+ */
+ public void setParserFactory(YangParserFactory parserFactory) {
+ this.parserFactory = parserFactory;
+ }
+
+
+
/**
* Sends the restconf request using the parameters map and the memory
* context. And this method allows the directed graphs to interact with
@@ -299,21 +325,17 @@ public class RestconfApiCallNode implements SvcLogicJavaPlugin {
* @return schema context
* @throws SvcLogicException when schema context fetching fails
*/
- private EffectiveModelContext getSchemaContext(YangParameters params)
- throws SvcLogicException {
- if (params.dirPath != null) {
- return getSchemaCtxFromDir(params.dirPath);
- }
- BundleContext bc = getBundle(SchemaContext.class).getBundleContext();
- EffectiveModelContext schemaContext = null;
- if (bc != null) {
- ServiceReference reference = bc.getServiceReference(
- SchemaContext.class);
- if (reference != null) {
- schemaContext = (EffectiveModelContext) bc.getService(reference);
+ private EffectiveModelContext getSchemaContext(YangParameters params) throws SvcLogicException {
+ try {
+
+ if (params.dirPath != null) {
+ return getSchemaCtxFromDir(getParserFactory(), params.dirPath);
+ } else {
+ return (getParserFactory().createParser().buildEffectiveModel());
}
+ } catch (YangParserException e) {
+ throw new SvcLogicException("Caught exception creating yang model context", e);
}
- return schemaContext;
}
/**
diff --git a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java
index d22c3707a..134868c15 100644
--- a/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java
+++ b/plugins/restconf-client/provider/src/main/java/org/onap/ccsdk/sli/plugins/restconfapicall/RestconfApiUtils.java
@@ -5,6 +5,7 @@
* Copyright (C) 2018 Huawei Technologies Co., Ltd. All rights reserved.
*
* Modifications Copyright © 2018 IBM.
+ * Modifications Copyright (c) 2021 AT&T
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -24,18 +25,13 @@ package org.onap.ccsdk.sli.plugins.restconfapicall;
import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.getParameters;
import static org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode.parseParam;
-import static org.opendaylight.yangtools.yang.model.repo.api.StatementParserMode.DEFAULT_MODE;
import static org.opendaylight.yangtools.yang.model.repo.api.YangTextSchemaSource.forFile;
-import static org.opendaylight.yangtools.yang.parser.rfc7950.reactor.RFC7950Reactors.defaultReactor;
-import static org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource.create;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.Path;
import java.nio.file.Paths;
-import java.util.ArrayList;
-import java.util.Collection;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
@@ -43,10 +39,10 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.plugins.restapicall.HttpMethod;
import org.onap.ccsdk.sli.plugins.yangserializers.dfserializer.YangParameters;
import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.model.parser.api.YangParser;
+import org.opendaylight.yangtools.yang.model.parser.api.YangParserException;
+import org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory;
import org.opendaylight.yangtools.yang.model.parser.api.YangSyntaxErrorException;
-import org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource;
-import org.opendaylight.yangtools.yang.parser.spi.meta.ReactorException;
-import org.opendaylight.yangtools.yang.parser.stmt.reactor.CrossSourceStatementReactor;
/**
* Utilities for restconf api call node.
@@ -188,27 +184,24 @@ public final class RestconfApiUtils {
* @return YANG schema context
* @throws SvcLogicException when YANG file reading fails
*/
- static EffectiveModelContext getSchemaCtxFromDir(String di)
+ static EffectiveModelContext getSchemaCtxFromDir(YangParserFactory parserFactory, String di)
throws SvcLogicException {
Path d = Paths.get(di);
File dir = d.toFile();
List<File> yangFiles = new LinkedList<>();
getYangFiles(dir, yangFiles);
- final Collection<YangStatementStreamSource> sources =
- new ArrayList<>(yangFiles.size());
+ YangParser parser = parserFactory.createParser();
for (File file : yangFiles) {
try {
- sources.add(create(forFile(file)));
+ parser.addSource(forFile(file));
} catch (IOException | YangSyntaxErrorException e) {
throw new SvcLogicException(YANG_FILE_ERR + e.getMessage(), e);
}
}
- final CrossSourceStatementReactor.BuildAction reactor = defaultReactor()
- .newBuild(DEFAULT_MODE).addSources(sources);
try {
- return reactor.buildEffective();
- } catch (ReactorException e) {
+ return parser.buildEffectiveModel();
+ } catch (YangParserException e) {
throw new SvcLogicException(YANG_FILE_ERR + e.getMessage(), e);
}
}
diff --git a/plugins/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml b/plugins/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml
index 45c335b13..efa8fce9d 100755
--- a/plugins/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml
+++ b/plugins/restconf-client/provider/src/main/resources/org/opendaylight/blueprint/restconf-client-blueprint.xml
@@ -28,8 +28,15 @@
interface="org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode"
ext:proxy-method="classes"/>
+ <reference xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
+ id="yangParserFactory"
+ interface="org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory"
+ ext:proxy-method="classes"/>
+
+
<bean id="restconfapiCallNodeProvider" class="org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode" >
<argument ref="restapiCallNodeProvider"/>
+ <argument ref="yangParserFactory"/>
</bean>
<bean id="restconfDiscoveryNodeProvider" class="org.onap.ccsdk.sli.plugins.restconfdiscovery.RestconfDiscoveryNode" >
diff --git a/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfapicall/TestRestconfApiUtils.java b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfapicall/TestRestconfApiUtils.java
new file mode 100644
index 000000000..a76bb52bf
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfapicall/TestRestconfApiUtils.java
@@ -0,0 +1,52 @@
+package org.onap.ccsdk.sli.plugins.restconfapicall;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+import org.junit.Test;
+import org.onap.ccsdk.sli.core.sli.SvcLogicException;
+import org.opendaylight.yangtools.yang.model.api.EffectiveModelContext;
+import org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory;
+import org.opendaylight.yangtools.yang.parser.impl.YangParserFactoryImpl;
+
+/*-
+ * ============LICENSE_START=======================================================
+ * ONAP: CCSDK
+ * ================================================================================
+ * Copyright (C) 2021 AT&T Intellectual Property. All rights
+ * reserved.
+ * ================================================================================
+ * 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.
+ * ============LICENSE_END=========================================================
+ */
+
+public class TestRestconfApiUtils {
+ @Test
+ public void testGetSchemaCtxFromDir() throws SvcLogicException {
+
+ YangParserFactory factory = new YangParserFactoryImpl();
+
+
+ // Test with valid subdirectories
+ EffectiveModelContext modelCtx = RestconfApiUtils.getSchemaCtxFromDir(factory, "src/test/test-yang");
+ assertNotNull(modelCtx);
+
+ // Test with directory with no yang
+ modelCtx = RestconfApiUtils.getSchemaCtxFromDir(factory, "src/test/java");
+ assertNotNull(modelCtx);
+
+ // Test with invalid directory
+ modelCtx = RestconfApiUtils.getSchemaCtxFromDir(factory, "no/such/directory");
+ assertNotNull(modelCtx);
+ }
+}
diff --git a/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java
index aa89d67d7..64173306d 100644
--- a/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java
+++ b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/restconfdiscovery/TestRestconfDiscoveryNode.java
@@ -29,6 +29,7 @@ import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode;
import org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode;
+import org.opendaylight.yangtools.yang.parser.impl.YangParserFactoryImpl;
import java.io.IOException;
import java.net.URI;
@@ -104,8 +105,9 @@ public class TestRestconfDiscoveryNode {
throws SvcLogicException{
SvcLogicContext ctx = new SvcLogicContext();
Map<String, String> p = new HashMap<>();
+
RestconfDiscoveryNode rdn = new RestconfDiscoveryNode(
- new RestconfApiCallNode(new RestapiCallNode()));
+ new RestconfApiCallNode(new RestapiCallNode(), new YangParserFactoryImpl()));
rdn.establishSubscription(p, ctx);
}
@@ -115,7 +117,7 @@ public class TestRestconfDiscoveryNode {
ctx.setAttribute("restapi-result.response-code", "200");
ctx.setAttribute("response-code", "404");
RestconfDiscoveryNode rdn = new RestconfDiscoveryNode(
- new RestconfApiCallNode(new RestapiCallNode()));
+ new RestconfApiCallNode(new RestapiCallNode(), new YangParserFactoryImpl()));
assertThat(rdn.getResponseCode("restapi-result", ctx),
is("200"));
assertThat(rdn.getResponseCode(null, ctx),
@@ -131,7 +133,7 @@ public class TestRestconfDiscoveryNode {
ctx.setAttribute("ietf-subscribed-notifications:establish-subscripti" +
"on.output.identifier", "89");
RestconfDiscoveryNode rdn = new RestconfDiscoveryNode(
- new RestconfApiCallNode(new RestapiCallNode()));
+ new RestconfApiCallNode(new RestapiCallNode(), new YangParserFactoryImpl()));
assertThat(rdn.getOutputIdentifier("restapi-result", ctx),
is("89"));
}
@@ -142,7 +144,7 @@ public class TestRestconfDiscoveryNode {
"futh9ho6eofy3wjsap7wqktemlqm4bbsmnar3vrtbyrzukbv5itd6m1cftldpjarny" +
"le3sdcqq9hftc4lebz464b5ffxmlbvg9";
RestconfDiscoveryNode rdn = new RestconfDiscoveryNode(
- new RestconfApiCallNode(new RestapiCallNode()));
+ new RestconfApiCallNode(new RestapiCallNode(), new YangParserFactoryImpl()));
assertThat(rdn.getTokenId(customHttpHeaders),
is("x-ik2ps4ikvzupbx0486ft1ebzs7rt85futh9ho6eofy3wjsap7wqkt" +
diff --git a/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DataFormatSerializerTest.java b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DataFormatSerializerTest.java
index aa1e50d6a..a5353fad4 100644
--- a/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DataFormatSerializerTest.java
+++ b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/DataFormatSerializerTest.java
@@ -33,6 +33,8 @@ import org.onap.ccsdk.sli.plugins.restapicall.HttpResponse;
import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode;
import org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode;
import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
+import org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory;
+import org.opendaylight.yangtools.yang.parser.impl.YangParserFactoryImpl;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
@@ -75,6 +77,8 @@ public class DataFormatSerializerTest {
private RestapiCallNode restApi;
+ private YangParserFactory parserFactory;
+
private DfCaptor dfCaptor;
/**
@@ -90,6 +94,7 @@ public class DataFormatSerializerTest {
p.put("responsePrefix", "response");
p.put("skipSending", "true");
restApi = new RestapiCallNode();
+ parserFactory = new YangParserFactoryImpl();
restconf = mock(RestconfApiCallNode.class);
dfCaptor = new DfCaptor();
createMethodMocks();
@@ -102,6 +107,7 @@ public class DataFormatSerializerTest {
*/
private void createMethodMocks() throws SvcLogicException {
doReturn(restApi).when(restconf).getRestapiCallNode();
+ doReturn(parserFactory).when(restconf).getParserFactory();
doCallRealMethod().when(restconf).sendRequest(
any(Map.class), any(SvcLogicContext.class));
doCallRealMethod().when(restconf).sendRequest(
diff --git a/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/IdentifierValidationTest.java b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/IdentifierValidationTest.java
index 1109d426c..9abbb16b7 100644
--- a/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/IdentifierValidationTest.java
+++ b/plugins/restconf-client/provider/src/test/java/org/onap/ccsdk/sli/plugins/yangserializers/dfserializer/IdentifierValidationTest.java
@@ -33,6 +33,8 @@ import org.onap.ccsdk.sli.plugins.restapicall.HttpResponse;
import org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode;
import org.onap.ccsdk.sli.plugins.restconfapicall.RestconfApiCallNode;
import org.opendaylight.restconf.common.context.InstanceIdentifierContext;
+import org.opendaylight.yangtools.yang.model.parser.api.YangParserFactory;
+import org.opendaylight.yangtools.yang.parser.impl.YangParserFactoryImpl;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;
@@ -64,6 +66,8 @@ public class IdentifierValidationTest {
private RestapiCallNode restApi;
+ private YangParserFactory parserFactory;
+
private DfCaptor dfCaptor;
/**
@@ -79,6 +83,7 @@ public class IdentifierValidationTest {
p.put("responsePrefix", "response");
p.put("skipSending", "true");
restApi = new RestapiCallNode();
+ parserFactory = new YangParserFactoryImpl();
restconf = mock(RestconfApiCallNode.class);
dfCaptor = new DfCaptor();
createMethodMocks();
@@ -91,6 +96,7 @@ public class IdentifierValidationTest {
*/
private void createMethodMocks() throws SvcLogicException {
doReturn(restApi).when(restconf).getRestapiCallNode();
+ doReturn(parserFactory).when(restconf).getParserFactory();
doCallRealMethod().when(restconf).sendRequest(
any(Map.class), any(SvcLogicContext.class));
doCallRealMethod().when(restconf).sendRequest(
diff --git a/plugins/restconf-client/provider/src/test/test-yang/SLI-API/sliapi.yang b/plugins/restconf-client/provider/src/test/test-yang/SLI-API/sliapi.yang
new file mode 100644
index 000000000..98cbb2aa7
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/SLI-API/sliapi.yang
@@ -0,0 +1,117 @@
+module SLI-API {
+
+ yang-version 1;
+
+ namespace "org:onap:ccsdk:sli:core:sliapi";
+
+ prefix sample;
+
+ import ietf-inet-types { prefix "inet"; revision-date 2013-07-15; }
+
+ organization "ONAP";
+
+ contact
+ "Dan Timoney";
+
+ description
+ "Defines API to service logic interpreter";
+
+ revision "2016-11-10" {
+ description
+ "REST API to Service Logic Interpreter";
+ }
+
+ grouping parameter-setting {
+ description
+ "Parameter setting";
+
+ leaf parameter-name {
+ type string;
+ description "Parameter name";
+ }
+
+ leaf int-value {
+ type int32;
+ }
+ leaf string-value {
+ type string;
+ }
+ leaf boolean-value {
+ type boolean;
+ }
+ }
+
+ grouping response-fields {
+ leaf response-code {
+ type string;
+ }
+ leaf ack-final-indicator {
+ type string;
+ }
+ leaf response-message {
+ type string;
+ }
+ leaf context-memory-json {
+ type string;
+ }
+ }
+
+ container test-results {
+ description "Test results";
+
+ list test-result {
+ key "test-identifier";
+
+ leaf test-identifier {
+ type string;
+ }
+
+ leaf-list results {
+ type string;
+ }
+ }
+ }
+
+ rpc execute-graph {
+ description " Method to add a new parameter.";
+ input {
+
+ leaf module-name {
+ type string;
+ }
+
+ leaf rpc-name {
+ type string;
+ }
+
+ leaf mode {
+ type enumeration {
+ enum sync;
+ enum async;
+ }
+ }
+
+ list sli-parameter {
+ key "parameter-name";
+ uses parameter-setting;
+ }
+ }
+
+ output {
+ uses response-fields;
+ }
+ }
+
+ rpc healthcheck {
+ output {
+ uses response-fields;
+ }
+ }
+
+ rpc vlbcheck {
+ output {
+ uses response-fields;
+ }
+ }
+
+}
diff --git a/plugins/restconf-client/provider/src/test/test-yang/cds/execution-service.yang b/plugins/restconf-client/provider/src/test/test-yang/cds/execution-service.yang
new file mode 100644
index 000000000..fcd35ed53
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/cds/execution-service.yang
@@ -0,0 +1,43 @@
+module execution-service {
+ yang-version 1.1;
+ namespace "cds:workflow:rest";
+ prefix "cds";
+
+ revision "2019-05-21";
+
+ container process {
+ container commonHeader {
+ leaf originatorId {
+ type string;
+ }
+ leaf requestId {
+ type string;
+ }
+ leaf subRequestId {
+ type string;
+ }
+ }
+ container actionIdentifiers {
+ leaf blueprintName {
+ type string;
+ }
+ leaf blueprintVersion {
+ type string;
+ }
+ leaf actionName {
+ type string;
+ }
+ leaf mode {
+ type string;
+ }
+ }
+ container payload {
+ container resource-assignment-request {
+ leaf-list template-prefix {
+ type string;
+ }
+ anyxml resource-assignment-properties;
+ }
+ }
+ }
+}
diff --git a/plugins/restconf-client/provider/src/test/test-yang/notification/ietf-subscribed-notifications.yang b/plugins/restconf-client/provider/src/test/test-yang/notification/ietf-subscribed-notifications.yang
new file mode 100644
index 000000000..f7e01be50
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/notification/ietf-subscribed-notifications.yang
@@ -0,0 +1,21 @@
+module ietf-subscribed-notifications {
+ yang-version 1;
+ namespace "ietf:subscribed:notifications:huawei";
+ prefix "notif";
+
+ revision 2018-09-08;
+
+ rpc establish-subscription {
+ input {
+ leaf encoding {
+ type string;
+ }
+ }
+
+ output {
+ leaf identifier {
+ type int16;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-eth-tran-service@2018-03-01.yang b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-eth-tran-service@2018-03-01.yang
new file mode 100644
index 000000000..cb7c8f05f
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-eth-tran-service@2018-03-01.yang
@@ -0,0 +1,572 @@
+module ietf-eth-tran-service {
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-eth-tran-service";
+
+ prefix "ethtsvc";
+
+ import ietf-yang-types {
+ prefix "yang";
+ }
+
+ import ietf-te-types {
+ prefix "te-types";
+ }
+
+ import ietf-eth-tran-types {
+ prefix "etht-types";
+ }
+
+ organization
+ "Internet Engineering Task Force (IETF) CCAMP WG";
+ contact
+ "
+ WG List: <mailto:ccamp@ietf.org>
+ ID-draft editor:
+ Haomian Zheng (zhenghaomian@huawei.com);
+ Italo Busi (italo.busi@huawei.com);
+ Aihua Guo (aihuaguo@huawei.com);
+ Yunbin Xu (xuyunbin@ritt.cn);
+ Yang Zhao (zhaoyangyjy@chinamobile.com);
+ Xufeng Liu (Xufeng_Liu@jabil.com);
+ Giuseppe Fioccola (giuseppe.fioccola@telecomitalia.it);
+ ";
+
+ description
+ "This module defines a YANG data model for describing
+ the Ethernet transport services.";
+
+ revision 2018-03-01 {
+ description
+ "Initial revision";
+ reference
+ "draft-zheng-ccamp-client-signal-yang";
+ }
+
+ /*
+ Groupings
+ */
+
+ grouping vlan-classification {
+ description
+ "A grouping which represents classification on an 802.1Q VLAN tag.";
+
+ leaf tag-type {
+ type etht-types:eth-tag-classify;
+ description
+ "The tag type used for VLAN classification.";
+ }
+ choice individual-bundling-vlan {
+ description
+ "VLAN based classification can be individual
+ or bundling.";
+ case individual-vlan {
+ leaf vlan-value {
+ type etht-types:vlanid;
+ description
+ "VLAN ID value.";
+ }
+ }
+
+ case vlan-bundling {
+ leaf vlan-range {
+ type etht-types:vid-range-type;
+ description
+ "List of VLAN ID values.";
+ }
+ }
+ }
+ }
+
+ grouping vlan-write {
+ description
+ "A grouping which represents push/pop operations
+ of an 802.1Q VLAN tag.";
+
+ leaf tag-type {
+ type etht-types:eth-tag-type;
+ description
+ "The VLAN tag type to push/swap.";
+ }
+ leaf vlan-value {
+ type etht-types:vlanid;
+ description
+ "The VLAN ID value to push/swap.";
+ }
+ }
+
+ grouping vlan-operations {
+ description
+ "A grouping which represents VLAN operations.";
+
+ leaf pop-tags {
+ type uint8 {
+ range "1..2";
+ }
+ description
+ "The number of VLAN tags to pop (or swap if used in
+ conjunction with push-tags)";
+ }
+ container push-tags {
+ description
+ "The VLAN tags to push (or swap if used in
+ conjunction with pop-tags)";
+
+ container outer-tag {
+ presence
+ "Indicates existence of the outermost VLAN tag to
+ push/swap";
+
+ description
+ "The outermost VLAN tag to push/swap.";
+
+ uses vlan-write;
+ }
+ container second-tag {
+ must
+ '../outer-tag/tag-type = "s-vlan-tag-type" and ' +
+ 'tag-type = "c-vlan-tag-type"'
+ {
+
+ error-message
+ "
+ When pushing/swapping two tags, the outermost tag must
+ be specified and of S-VLAN type and the second
+ outermost tag must be of C-VLAN tag type.
+ ";
+ description
+ "
+ For IEEE 802.1Q interoperability, when pushing/swapping
+ two tags, it is required that the outermost tag exists
+ and is an S-VLAN, and the second outermost tag is a
+ C-VLAN.
+ ";
+ }
+
+ presence
+ "Indicates existence of a second outermost VLAN tag to
+ push/swap";
+
+ description
+ "The second outermost VLAN tag to push/swap.";
+
+ uses vlan-write;
+ }
+ }
+ }
+
+ grouping bandwidth-profiles {
+ description
+ "A grouping which represent bandwidth profile configuration.";
+
+ choice direction {
+ description
+ "Whether the bandwidth profiles are symmetrical or
+ asymmetrical";
+ case symmetrical {
+ description
+ "The same bandwidth profile is used to describe the ingress
+ and the egress bandwidth profile.";
+
+ leaf ingress-egress-bandwidth-profile-name {
+ type "string";
+ description
+ "Name of the bandwidth profile.";
+ }
+ }
+ case asymmetrical {
+ description
+ "Ingress and egress bandwidth profiles can be specified.";
+ leaf ingress-bandwidth-profile-name {
+ type "string";
+ description
+ "Name of the bandwidth profile used in
+ the ingress direction.";
+ }
+ leaf egress-bandwidth-profile-name {
+ type "string";
+ description
+ "Name of the bandwidth profile used in
+ the egress direction.";
+ }
+ }
+ }
+ }
+
+ grouping etht-svc-access-parameters {
+ description
+ "ETH transport services access parameters";
+
+ leaf access-node-id {
+ type te-types:te-node-id;
+ description
+ "The identifier of the access node in
+ the ETH transport topology.";
+ }
+ leaf access-ltp-id {
+ type te-types:te-tp-id;
+ description
+ "The TE link termination point identifier, used
+ together with access-node-id to identify the
+ access LTP.";
+ }
+ leaf service-classification-type {
+ type identityref {
+ base etht-types:service-classification-type;
+ }
+ description
+ "Service classification type.";
+ }
+
+ choice service-classification {
+ description
+ "Access classification can be port-based or
+ VLAN based.";
+
+ case port-classification {
+ /* no additional information */
+ }
+
+ case vlan-classification {
+ container outer-tag {
+ presence "The outermost VLAN tag exists";
+ description
+ "Classifies traffic using the outermost VLAN tag.";
+
+ uses vlan-classification;
+ }
+ container second-tag {
+ must
+ '../outer-tag/tag-type = "classify-s-vlan" and ' +
+ 'tag-type = "classify-c-vlan"'
+ {
+
+ error-message
+ "
+ When matching two tags, the outermost tag must be
+ specified and of S-VLAN type and the second
+ outermost tag must be of C-VLAN tag type.
+ ";
+ description
+ "
+ For IEEE 802.1Q interoperability, when matching two
+ tags, it is required that the outermost tag exists
+ and is an S-VLAN, and the second outermost tag is a
+ C-VLAN.
+ ";
+ }
+ presence "The second outermost VLAN tag exists";
+
+ description
+ "Classifies traffic using the second outermost VLAN tag.";
+
+ uses vlan-classification;
+ }
+ }
+ }
+
+/*
+ Open issue: can we constraints it to be used only with mp services?
+*/
+ leaf split-horizon-group {
+ type string;
+ description "Identify a split horizon group";
+ }
+
+ uses bandwidth-profiles;
+
+ container vlan-operations {
+ description
+ "include parameters for vlan-operation";
+ choice direction {
+ description
+ "Whether the VLAN operations are symmetrical or
+ asymmetrical";
+ case symmetrical {
+ container symmetrical-operation {
+ uses vlan-operations;
+ description
+ "Symmetrical operations.
+ Expressed in the ingress direction, but
+ the reverse operation is applied to egress traffic";
+ }
+ }
+ case asymmetrical {
+ container asymmetrical-operation {
+ description "Asymmetrical operations";
+ container ingress {
+ uses vlan-operations;
+ description "Ingress operations";
+ }
+ container egress {
+ uses vlan-operations;
+ description "Egress operations";
+ }
+ }
+ }
+ }
+ }
+ }
+
+ grouping etht-svc-tunnel-parameters {
+ description
+ "ETH transport services tunnel parameters";
+
+ leaf tunnel-name {
+ type string;
+ description
+ "TE service tunnel instance name.";
+ }
+ choice svc-multiplexing-tag {
+ description
+ "Service multiplexing is optional and flexible.";
+
+ case other {
+ /*
+ placeholder to support proprietary multiplexing
+ (for further discussion)
+ */
+ }
+
+ case none {
+ /* no additional information is needed */
+ }
+
+ case vlan-tag {
+ /*
+ No additional information is needed
+ The C-Tag or S-Tag used for service mulitplexing is defined
+ by the VLAN classification and operations configured in the
+ etht-svc-access-parameters grouping
+ */
+ }
+
+ case pw {
+ /* to be completed (for further discussion) */
+ }
+ }
+
+/*
+ Open issue: can we constraints it to be used only with mp services?
+*/
+ leaf src-split-horizon-group {
+ type string;
+ description "Identify a split horizon group at the Tunnel source TTP";
+ }
+ leaf dst-split-horizon-group {
+ type string;
+ description "Identify a split horizon group at the Tunnel destination TTP";
+ }
+ }
+
+ grouping te-topology-identifier {
+ description
+ "An identifier to uniquely identify the TE topology.";
+ leaf access-provider-id {
+ type te-types:te-global-id;
+ description
+ "An identifier to uniquely identify a provider.";
+ }
+ leaf access-client-id {
+ type te-types:te-global-id;
+ description
+ "An identifier to uniquely identify a client.";
+ }
+ leaf access-topology-id {
+ type te-types:te-topology-id;
+ description
+ "Identifies the topology the
+ service access ports belong to.";
+ }
+ }
+
+ grouping etht-svc-pm-threshold_config {
+ description
+ "Configuraiton parameters for Ethernet service PM thresholds.";
+
+ leaf sending-rate-high {
+ type uint64;
+ description
+ "High threshold of packet sending rate in kbps.";
+ }
+ leaf sending-rate-low {
+ type uint64;
+ description
+ "Low threshold of packet sending rate in kbps.";
+ }
+ leaf receiving-rate-high {
+ type uint64;
+ description
+ "High threshold of packet receiving rate in kbps.";
+ }
+ leaf receiving-rate-low {
+ type uint64;
+ description
+ "Low threshold of packet receiving rate in kbps.";
+ }
+ }
+
+ grouping etht-svc-pm-stats {
+ description
+ "Ethernet service PM statistics.";
+
+ leaf sending-rate-too-high {
+ type uint32;
+ description
+ "Counter that indicates the number of times the sending rate is above the high threshold";
+ }
+ leaf sending-rate-too-low {
+ type uint32;
+ description
+ "Counter that indicates the number of times the sending rate is below the low threshold";
+ }
+ leaf receiving-rate-too-high {
+ type uint32;
+ description
+ "Counter that indicates the number of times the receiving rate is above the high threshold";
+ }
+ leaf receiving-rate-too-low {
+ type uint32;
+ description
+ "Counter that indicates the number of times the receiving rate is below the low threshold";
+ }
+ }
+
+ grouping etht-svc-instance_config {
+ description
+ "Configuraiton parameters for Ethernet services.";
+
+ leaf etht-svc-name {
+ type string;
+ description
+ "Name of the p2p ETH transport service.";
+ }
+
+ leaf etht-svc-descr {
+ type string;
+ description
+ "Description of the ETH transport service.";
+ }
+
+ leaf etht-svc-type {
+ type etht-types:service-type;
+ description
+ "Type of Ethernet service (p2p, mp2mp or rmp).";
+ /* Add default as p2p */
+ }
+
+ uses te-topology-identifier;
+
+ list etht-svc-access-ports {
+ key access-port-id;
+ min-elements "1";
+/*
+ Open Issue:
+ Is it possible to limit the max-elements only for p2p services?
+ max-elements "2";
+*/
+ description
+ "List of the ETH trasport services access port instances.";
+
+ leaf access-port-id {
+ type uint16;
+ description
+ "ID of the service access port instance";
+ }
+ uses etht-svc-access-parameters;
+ }
+ list etht-svc-tunnels {
+ key tunnel-name;
+ description
+ "List of the TE Tunnels supporting the ETH
+ transport service.";
+
+ uses etht-svc-tunnel-parameters;
+ }
+ container pm-config {
+ description
+ "ETH service performance monitoring";
+
+ leaf pm-enable {
+ type boolean;
+ description
+ "Boolean value indicating whether PM is enabled.";
+ }
+ uses etht-svc-pm-threshold_config;
+ }
+ leaf admin-status {
+ type identityref {
+ base te-types:tunnel-state-type;
+ }
+ default te-types:tunnel-state-up;
+ description "ETH service administrative state.";
+ }
+ }
+
+ grouping etht-svc-instance_state {
+ description
+ "State parameters for Ethernet services.";
+
+ leaf operational-state {
+ type identityref {
+ base te-types:tunnel-state-type;
+ }
+ default te-types:tunnel-state-up;
+ description "ETH service operational state.";
+ }
+ leaf provisioning-state {
+ type identityref {
+ base te-types:lsp-state-type;
+ }
+ description "ETH service provisioning state.";
+ }
+ leaf creation-time {
+ type yang:date-and-time;
+ description
+ "Time of ETH service creation.";
+ }
+ leaf last-updated-time {
+ type yang:date-and-time;
+ description
+ "Time of ETH service last update.";
+ }
+ uses etht-svc-pm-stats;
+ }
+
+ /*
+ Data nodes
+ */
+
+ container etht-svc {
+ description
+ "ETH transport services.";
+
+ container globals {
+ description
+ "ETH profile information.";
+ list etht-svc-bandwidth-profiles {
+ key bandwidth-profile-name;
+ description
+ "List of bandwidth profile templates used by
+ Ethernet services.";
+
+ uses etht-types:etht-bandwidth-profiles;
+ }
+ }
+
+ list etht-svc-instances {
+ key etht-svc-name;
+ description
+ "The list of p2p ETH transport service instances";
+
+ uses etht-svc-instance_config;
+
+ container state {
+ config false;
+ description
+ "Ethernet Service states.";
+
+ uses etht-svc-instance_state;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-eth-tran-types@2018-05-24.yang b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-eth-tran-types@2018-05-24.yang
new file mode 100644
index 000000000..3775f36b8
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-eth-tran-types@2018-05-24.yang
@@ -0,0 +1,303 @@
+module ietf-eth-tran-types {
+ namespace "urn:ietf:params:xml:ns:yang:ietf-eth-tran-types";
+ prefix "etht-types";
+
+ organization
+ "Internet Engineering Task Force (IETF) CCAMP WG";
+ contact
+ "
+ WG List: <mailto:ccamp@ietf.org>
+ ID-draft editor:
+ Haomian Zheng (zhenghaomian@huawei.com);
+ Italo Busi (italo.busi@huawei.com);
+ Aihua Guo (aihuaguo@huawei.com);
+ Yunbin Xu (xuyunbin@ritt.cn);
+ Yang Zhao (zhaoyangyjy@chinamobile.com);
+ Xufeng Liu (Xufeng_Liu@jabil.com);
+ Giuseppe Fioccola (giuseppe.fioccola@telecomitalia.it);
+ ";
+
+ description
+ "This module defines the ETH transport types.";
+
+ revision 2018-05-24 {
+ description
+ "Initial revision";
+ reference
+ "draft-zheng-ccamp-client-signal-yang";
+ }
+
+ /*
+ * Identities
+ */
+
+ identity eth-vlan-tag-type {
+ description
+ "ETH VLAN tag type.";
+ }
+
+ identity c-vlan-tag-type {
+ base eth-vlan-tag-type;
+ description
+ "802.1Q Customer VLAN";
+ }
+
+ identity s-vlan-tag-type {
+ base eth-vlan-tag-type;
+ description
+ "802.1Q Service VLAN (QinQ)";
+ }
+
+ identity service-classification-type {
+ description
+ "Service classification.";
+ }
+
+ identity port-classification {
+ base service-classification-type;
+ description
+ "Port classification.";
+ }
+
+ identity vlan-classification {
+ base service-classification-type;
+ description
+ "VLAN classification.";
+ }
+
+ identity eth-vlan-tag-classify {
+ description
+ "VLAN tag classification.";
+ }
+
+ identity classify-c-vlan {
+ base eth-vlan-tag-classify;
+ description
+ "Classify 802.1Q Customer VLAN tag.
+ Only C-tag type is accepted";
+ }
+
+ identity classify-s-vlan {
+ base eth-vlan-tag-classify;
+ description
+ "Classify 802.1Q Service VLAN (QinQ) tag.
+ Only S-tag type is accepted";
+ }
+
+ identity classify-s-or-c-vlan {
+ base eth-vlan-tag-classify;
+ description
+ "Classify S-VLAN or C-VLAN tag-classify.
+ Either tag is accepted";
+ }
+
+ identity bandwidth-profile-type {
+ description
+ "Bandwidth Profile Types";
+ }
+
+ identity mef-10-bwp {
+ base bandwidth-profile-type;
+ description
+ "MEF 10 Bandwidth Profile";
+ }
+ identity rfc-2697-bwp {
+ base bandwidth-profile-type;
+ description
+ "RFC 2697 Bandwidth Profile";
+ }
+
+ identity rfc-2698-bwp {
+ base bandwidth-profile-type;
+ description
+ "RFC 2698 Bandwidth Profile";
+ }
+
+ identity rfc-4115-bwp {
+ base bandwidth-profile-type;
+ description
+ "RFC 4115 Bandwidth Profile";
+ }
+
+ identity service-type {
+ description
+ "Type of Ethernet service.";
+ }
+
+ identity p2p-svc {
+ base service-type;
+ description
+ "Ethernet point-to-point service (EPL, EVPL).";
+ }
+
+ identity rmp-svc {
+ base service-type;
+ description
+ "Ethernet rooted-multitpoint service (E-TREE, EP-TREE).";
+ }
+
+ identity mp2mp-svc {
+ base service-type;
+ description
+ "Ethernet multipoint-to-multitpoint service (E-LAN, EP-LAN).";
+ }
+
+ /*
+ * Type Definitions
+ */
+
+ typedef eth-tag-type {
+ type identityref {
+ base eth-vlan-tag-type;
+ }
+ description
+ "Identifies a specific ETH VLAN tag type.";
+ }
+
+ typedef eth-tag-classify {
+ type identityref {
+ base eth-vlan-tag-classify;
+ }
+ description
+ "Identifies a specific VLAN tag classification.";
+ }
+
+ typedef vlanid {
+ type uint16 {
+ range "1..4094";
+ }
+ description
+ "The 12-bit VLAN-ID used in the VLAN Tag header.";
+ }
+
+ typedef vid-range-type {
+ type string {
+ pattern "([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?" +
+ "(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)";
+ }
+ description
+ "A list of VLAN Ids, or non overlapping VLAN ranges, in
+ ascending order, between 1 and 4094.
+ This type is used to match an ordered list of VLAN Ids, or
+ contiguous ranges of VLAN Ids. Valid VLAN Ids must be in the
+ range 1 to 4094, and included in the list in non overlapping
+ ascending order.
+ For example: 1,10-100,50,500-1000";
+ }
+
+ typedef bandwidth-profile-type {
+ type identityref {
+ base bandwidth-profile-type;
+ }
+ description
+ "Identifies a specific Bandwidth Profile type.";
+ }
+
+ typedef service-type {
+ type identityref {
+ base service-type;
+ }
+ description
+ "Identifies the type of Ethernet service.";
+ }
+
+ /*
+ * Grouping Definitions
+ */
+
+ grouping etht-bandwidth-profiles {
+ description
+ "Bandwidth profile configuration paramters.";
+
+ leaf bandwidth-profile-name {
+ type string;
+ description
+ "Name of the bandwidth profile.";
+ }
+ leaf bandwidth-profile-type {
+ type etht-types:bandwidth-profile-type;
+ description
+ "The type of bandwidth profile.";
+ }
+ leaf CIR {
+ type uint64;
+ description
+ "Committed Information Rate in Kbps";
+ }
+ leaf CBS {
+ type uint64;
+ description
+ "Committed Burst Size in in KBytes";
+ }
+ leaf EIR {
+ type uint64;
+/*
+ * Open Issue: need to indicate that EIR is not supported by RFC 2697
+ * must
+ * '../bw-profile-type = "mef-10-bwp" or ' +
+ * '../bw-profile-type = "rfc-2698-bwp" or ' +
+ * '../bw-profile-type = "rfc-4115-bwp"'
+ *
+ * must
+ * '../bw-profile-type != "rfc-2697-bwp"'
+*/
+ description
+ "Excess Information Rate in Kbps
+ In case of RFC 2698, PIR = CIR + EIR";
+ }
+ leaf EBS {
+ type uint64;
+ description
+ "Excess Burst Size in KBytes.
+ In case of RFC 2698, PBS = CBS + EBS";
+ }
+ leaf color-aware {
+ type boolean;
+ description
+ "Indicates weather the color-mode is color-aware or color-blind.";
+ }
+ leaf coupling-flag {
+ type boolean;
+/*
+ * Open issue: need to indicate that Coupling Flag is defined only for MEF 10
+ *
+ * must
+ * '../bw-profile-type = "mef-10-bwp"'
+ */
+ description
+ "Coupling Flag.";
+ }
+ }
+
+ grouping eth-bandwidth {
+ leaf eth-bandwidth {
+ type uint64 {
+ range "0..10000000000";
+ }
+ units "Kbps";
+ description
+ "Available bandwith value expressed in kilobits per second";
+ }
+ }
+
+ grouping eth-label-restriction {
+ container eth-label-restriction {
+ leaf tag-type {
+ type etht-types:eth-tag-type;
+ description "VLAN tag type.";
+ }
+ leaf priority {
+ type uint8;
+ description "priority.";
+ }
+ }
+ }
+
+ grouping eth-label {
+ leaf vlanid {
+ type etht-types:vlanid;
+ description
+ "VLAN tag id.";
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-inet-types.yang b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-inet-types.yang
new file mode 100644
index 000000000..c4033b808
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-inet-types.yang
@@ -0,0 +1,430 @@
+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)";
+ }
+
+} \ No newline at end of file
diff --git a/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-otn-tunnel@2018-06-07.yang b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-otn-tunnel@2018-06-07.yang
new file mode 100644
index 000000000..2c24a6fb5
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-otn-tunnel@2018-06-07.yang
@@ -0,0 +1,837 @@
+module ietf-otn-tunnel {
+ yang-version 1.1;
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-otn-tunnel";
+ prefix "otn-tunnel";
+
+ import ietf-te {
+ prefix "te";
+ }
+
+ import ietf-otn-types {
+ prefix "otn-types";
+ }
+
+ import ietf-te-types {
+ prefix "te-types";
+ }
+
+ import ietf-inet-types {
+ prefix "inet";
+ }
+
+ organization
+ "IETF CCAMP Working Group";
+ contact
+ "WG Web: <http://tools.ietf.org/wg/ccamp/>
+ WG List: <mailto:ccamp@ietf.org>
+
+ Editor: Haomian Zheng
+ <mailto:zhenghaomian@huawei.com>
+
+ Editor: Aihua Guo
+ <mailto:aihuaguo@huawei.com>
+
+ Editor: Italo Busi
+ <mailto:italo.busi@huawei.com>
+
+ Editor: Anurag Sharma
+ <mailto:ansha@google.com>
+
+ Editor: Rajan Rao
+ <mailto:rrao@infinera.com>
+
+ Editor: Sergio Belotti
+ <mailto:sergio.belotti@nokia.com>
+
+ Editor: Victor Lopez
+ <mailto:victor.lopezalvarez@telefonica.com>
+
+ Editor: Yunbo Li
+ <mailto:liyunbo@chinamobile.com>
+
+ Editor: Yunbin Xu
+ <mailto:xuyunbin@ritt.cn>";
+
+ description
+ "This module defines a model for OTN Tunnel Services.";
+
+ revision "2018-06-07" {
+ description
+ "Revision 0.5";
+ reference
+ "draft-ietf-ccamp-otn-tunnel-model-02";
+ }
+
+ /*
+ * Groupings
+ */
+
+ grouping otn-tunnel-endpoint {
+ description "Parameters for OTN tunnel";
+
+ leaf payload-treatment {
+ type enumeration {
+ enum switching {
+ description "Client signal is switched to another tunnel
+ in this domain";
+ }
+ enum transport {
+ description "Client signal is transparently transmitted
+ in this domain";
+ }
+ }
+ default switching;
+ description
+ "Treatment of the incoming payload. Payload can be switched
+ or transported.";
+ }
+
+ leaf src-client-signal {
+ type identityref {
+ base otn-types:client-signal;
+ }
+ description
+ "Client signal at the source endpoint of the tunnel";
+ }
+
+ leaf src-tpn {
+ type uint16 {
+ range "0..4095";
+ }
+ description
+ "Tributary Port Number. Applicable in case of mux services";
+ reference
+ "RFC7139: GMPLS Signaling Extensions for Control of Evolving
+ G.709 Optical Transport Networks";
+ }
+
+ leaf src-tsg {
+ type identityref {
+ base otn-types:tributary-slot-granularity;
+ }
+ description
+ "Tributary slot granularity.
+ Applicable in case of mux services";
+ reference
+ "G.709/Y.1331, February 2016: Interfaces for the
+ Optical Transport Network (OTN)";
+ }
+
+ leaf src-tributary-slot-count {
+ type uint16;
+ description
+ "Number of tributary slots used at the source.";
+ }
+
+ container src-tributary-slots {
+ description
+ "A list of tributary slots used by the client service.
+ Applicable in case of mux services";
+ leaf-list values {
+ type uint8;
+ description
+ "Tributary tributary slot value";
+ reference
+ "G.709/Y.1331, February 2016: Interfaces for the
+ Optical Transport Network (OTN)";
+ }
+ }
+
+ leaf dst-client-signal {
+ type identityref {
+ base otn-types:client-signal;
+ }
+ description
+ "Client signal at the destination endpoint of the tunnel";
+ }
+
+ leaf dst-tpn {
+ type uint16 {
+ range "0..4095";
+ }
+ description
+ "Tributary Port Number. Applicable in case of mux services";
+ reference
+ "RFC7139: GMPLS Signaling Extensions for Control of Evolving
+ G.709 Optical Transport Networks.";
+ }
+
+ leaf dst-tsg {
+ type identityref {
+ base otn-types:tributary-slot-granularity;
+ }
+ description
+ "Tributary slot granularity.
+ Applicable in case of mux services";
+ reference
+ "G.709/Y.1331, February 2016: Interfaces for the
+ Optical Transport Network (OTN)";
+ }
+
+ leaf dst-tributary-slot-count {
+ type uint16;
+ description
+ "Number of tributary slots used at the destination.";
+ }
+
+ container dst-tributary-slots {
+ description
+ "A list of tributary slots used by the client service.
+ Applicable in case of mux services";
+ leaf-list values {
+ type uint8;
+ description
+ "Tributary slot value";
+ reference
+ "G.709/Y.1331, February 2016: Interfaces for the
+ Optical Transport Network (OTN)";
+ }
+ }
+ }
+
+ /*
+ Note: Comment has been given to authors of TE Tunnel model to add
+ list of endpoints under config to support P2MP tunnel.
+ */
+
+ /*
+ * Data nodes
+ */
+
+ augment "/te:te/te:tunnels/te:tunnel" {
+ description
+ "Augment with additional parameters required for OTN service";
+ uses otn-tunnel-endpoint;
+ }
+
+ /*
+ * Augment TE bandwidth
+ */
+
+ /* Augment bandwidth of named-path-constraints */
+ augment "/te:te/te:globals/te:named-path-constraints/"
+ + "te:named-path-constraint/"
+ + "te:te-bandwidth/te:technology" {
+ description "OTN bandwidth.";
+ case otn {
+ uses otn-types:otn-path-bandwidth;
+ }
+ }
+
+ /* Augment bandwdith of tunnel */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:te-bandwidth/te:technology" {
+ description "OTN bandwidth.";
+ case otn {
+ uses otn-types:otn-path-bandwidth;
+ }
+ }
+
+ /* Augment bandwidth of primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:te-bandwidth/te:technology" {
+ description "OTN bandwidth.";
+ case otn {
+ uses otn-types:otn-path-bandwidth;
+ }
+ }
+
+ /* Augment bandwidth of reverse primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:p2p-reverse-primary-path/"
+ + "te:te-bandwidth/te:technology" {
+ description "OTN bandwidth.";
+ case otn {
+ uses otn-types:otn-path-bandwidth;
+ }
+ }
+
+ /* Augment bandwidht of secondary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-secondary-paths/te:p2p-secondary-path/"
+ + "te:te-bandwidth/te:technology" {
+ description "OTN bandwidth.";
+ case otn {
+ uses otn-types:otn-path-bandwidth;
+ }
+ }
+
+ /*
+ * Augment TE label.
+ */
+
+ /* Augment label hop of route-object-exclude-always of named-path-constraints */
+ augment "/te:te/te:globals/te:named-path-constraints/"
+ + "te:named-path-constraint/te:explicit-route-objects/"
+ + "te:route-object-exclude-always/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-object-include-exclude of named-path-constraints */
+ augment "/te:te/te:globals/te:named-path-constraints/"
+ + "te:named-path-constraint/te:explicit-route-objects/"
+ + "te:route-object-include-exclude/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+
+ /* Augment label hop of route-object-exclude-always of primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:explicit-route-objects/"
+ + "te:route-object-exclude-always/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-object-include-exclude of primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:explicit-route-objects/"
+ + "te:route-object-include-exclude/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-exclude of primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:optimizations/te:algorithm/te:metric/"
+ + "te:optimization-metric/te:explicit-route-exclude-objects/"
+ + "te:route-object-exclude-object/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-include of primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:optimizations/te:algorithm/te:metric/"
+ + "te:optimization-metric/te:explicit-route-include-objects/"
+ + "te:route-object-include-object/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of path-route of primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:state/te:path-properties/"
+ + "te:path-route-objects/te:path-computed-route-object/"
+ + "te:state/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /*
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:state/te:lsps/te:lsp/te:record-route-subobjects/"
+ + "te:record-route-subobject/"
+ + "te:state/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+ */
+
+ /* Augment label hop of path-route of primary LSP */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:state/te:lsps/te:lsp/te:path-properties/"
+ + "te:path-route-objects/te:path-computed-route-object/"
+ + "te:state/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-object-exclude-always of reverse primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:p2p-reverse-primary-path/"
+ + "te:explicit-route-objects/"
+ + "te:route-object-exclude-always/"
+ + "te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-object-include-exclude of reverse primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:p2p-reverse-primary-path/"
+ + "te:explicit-route-objects/"
+ + "te:route-object-include-exclude/"
+ + "te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-exclude of reverse primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:p2p-reverse-primary-path/"
+ + "te:optimizations/te:algorithm/te:metric/"
+ + "te:optimization-metric/te:explicit-route-exclude-objects/"
+ + "te:route-object-exclude-object/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-include of reverse primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:p2p-reverse-primary-path/"
+ + "te:optimizations/te:algorithm/te:metric/"
+ + "te:optimization-metric/te:explicit-route-include-objects/"
+ + "te:route-object-include-object/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of label hop of path-route of reverse primary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:p2p-reverse-primary-path/"
+ + "te:state/te:path-properties/"
+ + "te:path-route-objects/te:path-computed-route-object/"
+ + "te:state/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /*
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:p2p-reverse-primary-path/"
+ + "te:state/te:lsps/te:lsp/te:lsp-record-route-subobjects/"
+ + "te:record-route-subobject/"
+ + "te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+ */
+
+ /* Augment label hop of path-route of reverse primary LSP */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-primary-paths/te:p2p-primary-path/"
+ + "te:p2p-reverse-primary-path/"
+ + "te:state/te:lsps/te:lsp/te:path-properties/"
+ + "te:path-route-objects/te:path-computed-route-object/"
+ + "te:state/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-object-exclude-always of secondary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-secondary-paths/te:p2p-secondary-path/"
+ + "te:explicit-route-objects/"
+ + "te:route-object-exclude-always/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-object-include-exclude of secondary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-secondary-paths/te:p2p-secondary-path/"
+ + "te:explicit-route-objects/"
+ + "te:route-object-include-exclude/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-exclude of secondary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-secondary-paths/te:p2p-secondary-path/"
+ + "te:optimizations/te:algorithm/te:metric/"
+ + "te:optimization-metric/te:explicit-route-exclude-objects/"
+ + "te:route-object-exclude-object/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of route-include of secondary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-secondary-paths/te:p2p-secondary-path/"
+ + "te:optimizations/te:algorithm/te:metric/"
+ + "te:optimization-metric/te:explicit-route-include-objects/"
+ + "te:route-object-include-object/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /* Augment label hop of label hop of path-route of secondary path */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-secondary-paths/te:p2p-secondary-path/"
+ + "te:state/te:path-properties/te:path-route-objects/"
+ + "te:path-computed-route-object/te:state/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /*
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-secondary-paths/te:p2p-secondary-path/"
+ + "te:state/te:lsps/te:lsp/te:lsp-record-route-subobjects/"
+ + "te:record-route-subobject/"
+ + "te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+ */
+
+ /* Augment label hop of path-route of secondary LSP */
+ augment "/te:te/te:tunnels/te:tunnel/"
+ + "te:p2p-secondary-paths/te:p2p-secondary-path/"
+ + "te:state/te:lsps/te:lsp/te:path-properties/"
+ + "te:path-route-objects/"
+ + "te:path-computed-route-object/te:state/te:type/te:label/"
+ + "te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+
+ /*
+ augment "/te:te/te:lsp-state/"
+ + "te:lsp-record-route-subobjects/te:lsp-record-route-subobject/"
+ + "te:record-route-subobject/"
+ + "te:type/te:label/te:label-hop/te:te-label/te:technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+ */
+
+
+ grouping p2p-path-ero {
+ description
+ "TE tunnel ERO configuration grouping";
+
+ leaf te-default-metric {
+ type uint32;
+ description
+ "Traffic engineering metric.";
+ }
+ leaf te-delay-metric {
+ type uint32;
+ description
+ "Traffic engineering delay metric.";
+ }
+ leaf te-hop-metric {
+ type uint32;
+ description
+ "Traffic engineering hop metric.";
+ }
+ container explicit-route-objects {
+ description "Explicit route objects container";
+ list explicit-route-object {
+ key "index";
+ description
+ "List of explicit route objects";
+ leaf explicit-route-usage {
+ type identityref {
+ base te-types:route-usage-type;
+ }
+ description "An explicit-route hop action.";
+ }
+ uses te-types:explicit-route-hop {
+ augment "type/label/label-hop/te-label/technology" {
+ description "OTN label.";
+ case otn {
+ uses otn-types:otn-path-label;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ rpc otn-te-tunnel-path-compute {
+ description "OTN TE tunnel path computation";
+ input {
+ list request {
+ key "id";
+ description "A list of path computation requests.";
+
+ leaf id {
+ type uint8;
+ description
+ "Request ID.";
+ }
+ leaf type {
+ type identityref {
+ base te-types:tunnel-type;
+ }
+ description "TE tunnel type.";
+ }
+ leaf source {
+ type inet:ip-address;
+ description
+ "TE tunnel source address.";
+ }
+ leaf destination {
+ type inet:ip-address;
+ description
+ "TE tunnel destination address";
+ }
+ leaf src-tp-id {
+ type binary;
+ description
+ "TE tunnel source termination point identifier.";
+ }
+ leaf dst-tp-id {
+ type binary;
+ description
+ "TE tunnel destination termination point identifier.";
+ }
+ leaf switching-layer {
+ type identityref {
+ base te-types:switching-capabilities;
+ }
+ description
+ "Switching layer where the requests are computed.";
+ }
+ leaf encoding {
+ type identityref {
+ base te-types:lsp-encoding-types;
+ }
+ description "LSP encoding type";
+ }
+ leaf protection-type {
+ type identityref {
+ base te-types:lsp-protection-type;
+ }
+ description "LSP protection type";
+ }
+ leaf restoration-type {
+ type identityref {
+ base te-types:lsp-restoration-type;
+ }
+ description "LSP restoration type";
+ }
+ leaf provider-id {
+ type te-types:te-global-id;
+ description
+ "An identifier to uniquely identify a provider.";
+ }
+ leaf client-id {
+ type te-types:te-global-id;
+ description
+ "An identifier to uniquely identify a client.";
+ }
+ leaf te-topology-id {
+ type te-types:te-topology-id;
+ description
+ "It is presumed that a datastore will contain many
+ topologies. To distinguish between topologies it is
+ vital to have UNIQUE topology identifiers.";
+ }
+ leaf setup-priority {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "TE LSP setup priority";
+ }
+ leaf hold-priority {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "TE LSP hold priority";
+ }
+ leaf te-path-metric-type {
+ type identityref {
+ base te-types:path-metric-type;
+ }
+ default te-types:path-metric-te;
+ description
+ "The tunnel path metric type.";
+ }
+
+ leaf odu-type {
+ type identityref{
+ base otn-types:tributary-protocol-type;
+ }
+ description "Type of ODU";
+ }
+ container p2p-primary-paths {
+ description "Set of P2P primary paths container";
+ list p2p-primary-path {
+ key "name";
+ description
+ "List of primary paths for this tunnel.";
+ leaf name {
+ type string;
+ description "TE path name";
+ }
+ uses p2p-path-ero;
+ }
+ }
+ container p2p-secondary-paths {
+ description "Set of P2P secondary paths container";
+ list p2p-secondary-path {
+ key "name";
+ description
+ "List of secondary paths for this tunnel.";
+ leaf name {
+ type string;
+ description "TE path name";
+ }
+ uses p2p-path-ero;
+ }
+ }
+ uses otn-tunnel-endpoint;
+ }
+ }
+ output {
+ leaf return-code {
+ type enumeration {
+ enum success {
+ description "success";
+ }
+ enum aborted {
+ description "aborted";
+ }
+ enum destination-not-found {
+ description "destination-not-found";
+ }
+ enum invalid-argument {
+ description "invalid-argument";
+ }
+ enum no-memory {
+ description "no-memory";
+ }
+ enum no-path-found {
+ description "no-path-found";
+ }
+ enum other-error {
+ description "other-error";
+ }
+ enum some-path-not-found {
+ description "some-path-not-found";
+ }
+ enum source-not-found {
+ description "source-not-found";
+ }
+ enum topology-error {
+ description "topology-error";
+ }
+ }
+ description
+ "Return code";
+ }
+ list result {
+ key "id";
+ description
+ "A list of results for all requests.";
+
+ leaf id {
+ type uint8;
+ description
+ "Request ID";
+ }
+ container p2p-primary-paths {
+ description "Set of P2P primary paths container";
+ list p2p-primary-path {
+ key "name";
+ description
+ "List of resultant primary paths for this tunnel.";
+ leaf name {
+ type string;
+ description "TE path name";
+ }
+ uses p2p-path-ero;
+ }
+ }
+ container p2p-secondary-paths {
+ description "Set of P2P secondary paths container";
+ list p2p-secondary-path {
+ key "name";
+ description
+ "List of resultant secondary paths for this tunnel.";
+ leaf name {
+ type string;
+ description "TE path name";
+ }
+ uses p2p-path-ero;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-otn-types@2018-06-07.yang b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-otn-types@2018-06-07.yang
new file mode 100644
index 000000000..dd02b8aa4
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-otn-types@2018-06-07.yang
@@ -0,0 +1,565 @@
+module ietf-otn-types {
+ namespace "urn:ietf:params:xml:ns:yang:ietf-otn-types";
+ prefix "otn-types";
+
+ organization
+ "IETF CCAMP Working Group";
+ contact
+ "WG Web: <http://tools.ietf.org/wg/ccamp/>
+ WG List: <mailto:ccamp@ietf.org>
+
+ Editor: Haomian Zheng
+ <mailto:zhenghaomian@huawei.com>
+
+ Editor: Aihua Guo
+ <mailto:aihuaguo@huawei.com>
+
+ Editor: Italo Busi
+ <mailto:italo.busi@huawei.com>
+
+ Editor: Anurag Sharma
+ <mailto:ansha@google.com>
+
+ Editor: Rajan Rao
+ <mailto:rrao@infinera.com>
+
+ Editor: Sergio Belotti
+ <mailto:sergio.belotti@nokia.com>
+
+ Editor: Victor Lopez
+ <mailto:victor.lopezalvarez@telefonica.com>
+
+ Editor: Yunbo Li
+ <mailto:liyunbo@chinamobile.com>
+
+ Editor: Yunbin Xu
+ <mailto:xuyunbin@ritt.cn>";
+
+ description
+ "This module defines OTN types.";
+
+ revision "2018-06-07" {
+ description
+ "Revision 0.5";
+ reference
+ "draft-ietf-ccamp-otn-tunnel-model-02";
+ }
+
+ identity tributary-slot-granularity {
+ description
+ "Tributary slot granularity";
+ reference
+ "G.709/Y.1331, February 2016: Interfaces for the Optical
+ Transport Network (OTN)";
+ }
+
+ identity tsg-1.25G {
+ base tributary-slot-granularity;
+ description
+ "1.25G tributary slot granularity";
+ }
+
+ identity tsg-2.5G {
+ base tributary-slot-granularity;
+ description
+ "2.5G tributary slot granularity";
+ }
+/*
+ identity tsg-1.25Gand2.5G {
+ base tributary-slot-granularity;
+ description
+ "Both 1.25G and 2.5G tributary slot granularity";
+ }
+*/
+ identity tributary-protocol-type {
+ description
+ "Base identity for protocol framing used by tributary signals";
+ }
+
+ identity prot-OTU1 {
+ base tributary-protocol-type;
+ description
+ "OTU1 protocol (2.66G)";
+ }
+/*
+ identity prot-OTU1e {
+ base tributary-protocol-type;
+ description
+ "OTU1e type (11.04G)";
+ }
+
+ identity prot-OTU1f {
+ base tributary-protocol-type;
+ description
+ "OTU1f type (11.27G)";
+ }
+*/
+ identity prot-OTU2 {
+ base tributary-protocol-type;
+ description
+ "OTU2 type (10.70G)";
+ }
+
+ identity prot-OTU2e {
+ base tributary-protocol-type;
+ description
+ "OTU2e type (11.09G)";
+ }
+/*
+ identity prot-OTU2f {
+ base tributary-protocol-type;
+ description
+ "OTU2f type (11.31G)";
+ }
+*/
+ identity prot-OTU3 {
+ base tributary-protocol-type;
+ description
+ "OTU3 type (43.01G)";
+ }
+/*
+ identity prot-OTU3e1 {
+ base tributary-protocol-type;
+ description
+ "OTU3e1 type (44.57G)";
+ }
+
+ identity prot-OTU3e2 {
+ base tributary-protocol-type;
+ description
+ "OTU3e2 type (44.58G)";
+ }
+*/
+ identity prot-OTU4 {
+ base tributary-protocol-type;
+ description
+ "OTU4 type (111.80G)";
+ }
+
+ identity prot-OTUCn {
+ base tributary-protocol-type;
+ description
+ "OTUCn type (beyond 100G)";
+ }
+
+ identity prot-ODU0 {
+ base tributary-protocol-type;
+ description
+ "ODU0 protocol (1.24G)";
+ }
+
+ identity prot-ODU1 {
+ base tributary-protocol-type;
+ description
+ "ODU1 protocol (2.49G)";
+ }
+/*
+ identity prot-ODU1e {
+ base tributary-protocol-type;
+ description
+ "ODU1e protocol (10.35G).";
+ }
+
+ identity prot-ODU1f {
+ base tributary-protocol-type;
+ description
+ "ODU1f protocol (10.56G).";
+ }
+*/
+ identity prot-ODU2 {
+ base tributary-protocol-type;
+ description
+ "ODU2 protocol (10.03G)";
+ }
+
+ identity prot-ODU2e {
+ base tributary-protocol-type;
+ description
+ "ODU2e protocol (10.39G)";
+ }
+/*
+ identity prot-ODU2f {
+ base tributary-protocol-type;
+ description
+ "ODU2f protocol (10.60G).";
+ }
+*/
+ identity prot-ODU3 {
+ base tributary-protocol-type;
+ description
+ "ODU3 protocol (40.31G)";
+ }
+/*
+ identity prot-ODU3e1 {
+ base tributary-protocol-type;
+ description
+ "ODU3e1 protocol (41.77G).";
+ }
+
+ identity prot-ODU3e2 {
+ base tributary-protocol-type;
+ description
+ "ODU3e2 protocol (41.78G).";
+ }
+*/
+ identity prot-ODU4 {
+ base tributary-protocol-type;
+ description
+ "ODU4 protocol (104.79G)";
+ }
+
+ identity prot-ODUFlex-cbr {
+ base tributary-protocol-type;
+ description
+ "ODU Flex CBR protocol for transporting constant bit rate
+ signal";
+ }
+
+ identity prot-ODUFlex-gfp {
+ base tributary-protocol-type;
+ description
+ "ODU Flex GFP protocol for transporting stream of packets
+ using Generic Framing Procedure";
+ }
+
+ identity prot-ODUCn {
+ base tributary-protocol-type;
+ description
+ "ODUCn protocol (beyond 100G)";
+ }
+
+ identity prot-1GbE {
+ base tributary-protocol-type;
+ description
+ "1G Ethernet protocol";
+ }
+ identity prot-10GbE-LAN {
+ base tributary-protocol-type;
+ description
+ "10G Ethernet LAN protocol";
+ }
+
+ identity prot-40GbE {
+ base tributary-protocol-type;
+ description
+ "40G Ethernet protocol";
+ }
+
+ identity prot-100GbE {
+ base tributary-protocol-type;
+ description
+ "100G Ethernet protocol";
+ }
+
+ identity client-signal {
+ description
+ "Base identity from which specific client signals for the
+ tunnel are derived";
+ }
+
+ identity client-signal-1GbE {
+ base client-signal;
+ description
+ "Client signal type of 1GbE";
+ }
+
+ identity client-signal-10GbE-LAN {
+ base client-signal;
+ description
+ "Client signal type of 10GbE LAN";
+ }
+
+ identity client-signal-10GbE-WAN {
+ base client-signal;
+ description
+ "Client signal type of 10GbE WAN";
+ }
+
+ identity client-signal-40GbE {
+ base client-signal;
+ description
+ "Client signal type of 40GbE";
+ }
+
+ identity client-signal-100GbE {
+ base client-signal;
+ description
+ "Client signal type of 100GbE";
+ }
+
+ identity client-signal-OC3_STM1 {
+ base client-signal;
+ description
+ "Client signal type of OC3 & STM1";
+ }
+
+ identity client-signal-OC12_STM4 {
+ base client-signal;
+ description
+ "Client signal type of OC12 & STM4";
+ }
+
+ identity client-signal-OC48_STM16 {
+ base client-signal;
+ description
+ "Client signal type of OC48 & STM16";
+ }
+
+ identity client-signal-OC192_STM64 {
+ base client-signal;
+ description
+ "Client signal type of OC192 & STM64";
+ }
+
+ identity client-signal-OC768_STM256 {
+ base client-signal;
+ description
+ "Client signal type of OC768 & STM256";
+ }
+
+ identity client-signal-ODU0 {
+ base client-signal;
+ description
+ "Client signal type of ODU0 (1.24G)";
+ }
+
+ identity client-signal-ODU1 {
+ base client-signal;
+ description
+ "ODU1 protocol (2.49G)";
+ }
+
+ identity client-signal-ODU2 {
+ base client-signal;
+ description
+ "Client signal type of ODU2 (10.03G)";
+ }
+
+ identity client-signal-ODU2e {
+ base client-signal;
+ description
+ "Client signal type of ODU2e (10.39G)";
+ }
+
+ identity client-signal-ODU3 {
+ base client-signal;
+ description
+ "Client signal type of ODU3 (40.31G)";
+ }
+/*
+ identity client-signal-ODU3e2 {
+ base client-signal;
+ description
+ "Client signal type of ODU3e2 (41.78G)";
+ }
+*/
+ identity client-signal-ODU4 {
+ base client-signal;
+ description
+ "Client signal type of ODU4 (104.79G)";
+ }
+
+ identity client-signal-ODUflex-cbr {
+ base client-signal;
+ description
+ "Client signal type of ODU Flex CBR";
+ }
+
+ identity client-signal-ODUflex-gfp {
+ base client-signal;
+ description
+ "Client signal type of ODU Flex GFP";
+ }
+
+ identity client-signal-ODUCn {
+ base client-signal;
+ description
+ "Client signal type of ODUCn (beyond 100G)";
+ }
+
+ identity client-signal-FC400 {
+ base client-signal;
+ description
+ "Client signal type of Fibre Channel FC400";
+ }
+
+ identity client-signal-FC800 {
+ base client-signal;
+ description
+ "Client signal type of Fibre Channel FC800";
+ }
+
+ identity client-signal-FICON-4G {
+ base client-signal;
+ description
+ "Client signal type of Fibre Connection 4G";
+ }
+
+ identity client-signal-FICON-8G {
+ base client-signal;
+ description
+ "Client signal type of Fibre Connection 8G";
+ }
+
+ identity client-signal-OTU1 {
+ base client-signal;
+ description
+ "Client signal type of OTU1";
+ }
+
+ identity client-signal-OTU2 {
+ base client-signal;
+ description
+ "Client signal type of OTU2";
+ }
+
+ identity client-signal-OTU2e {
+ base client-signal;
+ description
+ "Client signal type of OTU2e";
+ }
+
+ identity client-signal-OTU3 {
+ base client-signal;
+ description
+ "Client signal type of OTU3";
+ }
+
+ identity client-signal-OTU4 {
+ base client-signal;
+ description
+ "Client signal type of OTU4";
+ }
+
+ identity otn-label-range-type {
+ description
+ "Base identity from which specific OTN label
+ range types derived";
+ }
+
+ identity label-range-trib-slot {
+ base otn-label-range-type;
+ description
+ "Defines a range of OTN tributary slots";
+ }
+
+ identity label-range-trib-port {
+ base otn-label-range-type;
+ description
+ "Defines a range of OTN tributary ports";
+ }
+
+ grouping otn-link-bandwidth {
+ list odulist {
+ key "odu-type";
+ description
+ "OTN bandwidth definition";
+ leaf odu-type {
+ type identityref {
+ base otn-types:tributary-protocol-type;
+ }
+ description "ODU type";
+ }
+ leaf number {
+ type uint16;
+ description "Number of ODUs";
+ }
+ }
+ }
+
+ grouping otn-path-bandwidth {
+ leaf odu-type {
+ type identityref {
+ base otn-types:tributary-protocol-type;
+ }
+ description "ODU type";
+ }
+ }
+
+ grouping otn-label-restriction {
+ leaf range-type {
+ type identityref {
+ base otn-types:otn-label-range-type;
+ }
+ }
+ leaf tsg {
+ type identityref {
+ base otn-types:tributary-slot-granularity;
+ }
+ description "Tributary slot granularity.";
+ reference
+ "G.709/Y.1331, February 2016: Interfaces for the
+ Optical Transport Network (OTN)";
+ }
+ leaf priority {
+ type uint8;
+ description "priority.";
+ }
+ }
+
+
+ grouping otn-link-label {
+ choice otn-label-type {
+ description
+ "OTN label type";
+ case tributary-port {
+ leaf tpn {
+ type uint16 {
+ range "1..4095";
+ }
+ description
+ "Tributary Port Number. Applicable in case of mux services.";
+ reference
+ "RFC7139: GMPLS Signaling Extensions for Control of Evolving
+ G.709 Optical Transport Networks.";
+ }
+ }
+ case tributary-slot {
+ leaf ts {
+ type uint16 {
+ range "1..4095";
+ }
+ description
+ "Tributary Slot Number. Applicable in case of mux services.";
+ reference
+ "RFC7139: GMPLS Signaling Extensions for Control of Evolving
+ G.709 Optical Transport Networks.";
+ }
+ }
+ }
+ }
+
+ grouping otn-path-label {
+ leaf tpn {
+ type uint16 {
+ range "1..4095";
+ }
+ description
+ "Tributary Port Number. Applicable in case of mux services.";
+ reference
+ "RFC7139: GMPLS Signaling Extensions for Control of Evolving
+ G.709 Optical Transport Networks.";
+ }
+ leaf tsg {
+ type identityref {
+ base otn-types:tributary-slot-granularity;
+ }
+ description "Tributary slot granularity.";
+ reference
+ "G.709/Y.1331, February 2016: Interfaces for the
+ Optical Transport Network (OTN)";
+ }
+ leaf ts-list {
+ type string {
+ pattern "([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?"
+ + "(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)";
+ }
+ description
+ "A list of available tributary slots ranging
+ between 1 and 9999.
+ For example 1-20,25,50-1000";
+ reference "RFC 7139: GMPLS Signaling Extensions for Control
+ of Evolving G.709 Optical Transport Networks";
+ }
+ }
+}
diff --git a/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-routing-types@2017-10-13.yang b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-routing-types@2017-10-13.yang
new file mode 100644
index 000000000..e33c4bc70
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-routing-types@2017-10-13.yang
@@ -0,0 +1,733 @@
+module ietf-routing-types {
+ namespace "urn:ietf:params:xml:ns:yang:ietf-routing-types";
+ prefix rt-types;
+
+ import ietf-yang-types {
+ prefix yang;
+ }
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ organization
+ "IETF RTGWG - Routing Area Working Group";
+ contact
+ "WG Web: <http://tools.ietf.org/wg/rtgwg/>
+ WG List: <mailto:rtgwg@ietf.org>
+ Editor: Xufeng Liu
+ <mailto:Xufeng_Liu@jabail.com>
+ Yingzhen Qu
+ <mailto:yingzhen.qu@huawei.com>
+ Acee Lindem
+ <mailto:acee@cisco.com>
+ Christian Hopps
+ <mailto:chopps@chopps.org>
+ Lou Berger
+ <mailto:lberger@labn.com>";
+ description
+ "This module contains a collection of YANG data types
+ considered generally useful for routing protocols.
+ Copyright (c) 2017 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 XXXX; see
+ the RFC itself for full legal notices.";
+ reference "RFC XXXX";
+
+ revision 2017-10-13 {
+ description "Initial revision.";
+ reference "RFC TBD: Routing YANG Data Types";
+ }
+
+ /*** Identities related to MPLS/GMPLS ***/
+
+ identity mpls-label-special-purpose-value {
+ description
+ "Base identity for deriving identities describing
+ special-purpose Multiprotocol Label Switching (MPLS) label
+ values.";
+ reference
+ "RFC7274: Allocating and Retiring Special-Purpose MPLS
+ Labels.";
+ }
+
+ identity ipv4-explicit-null-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the IPv4 Explicit NULL Label.";
+ reference "RFC3032: MPLS Label Stack Encoding. Section 2.1.";
+ }
+
+ identity router-alert-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the Router Alert Label.";
+ reference "RFC3032: MPLS Label Stack Encoding. Section 2.1.";
+ }
+
+ identity ipv6-explicit-null-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the IPv6 Explicit NULL Label.";
+ reference "RFC3032: MPLS Label Stack Encoding. Section 2.1.";
+ }
+
+ identity implicit-null-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the Implicit NULL Label.";
+ reference "RFC3032: MPLS Label Stack Encoding. Section 2.1.";
+ }
+
+ identity entropy-label-indicator {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the Entropy Label Indicator.";
+ reference
+ "RFC6790: The Use of Entropy Labels in MPLS Forwarding.
+ Sections 3 and 10.1.";
+ }
+
+ identity gal-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the Generic Associated Channel
+ Label (GAL).";
+ reference
+ "RFC5586: MPLS Generic Associated Channel.
+ Sections 4 and 10.";
+ }
+
+ identity oam-alert-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the OAM Alert Label.";
+ reference
+ "RFC3429: Assignment of the 'OAM Alert Label' for
+ Multiprotocol Label Switching Architecture (MPLS)
+ Operation and Maintenance (OAM) Functions.
+ Sections 3 and 6.";
+ }
+
+ identity extension-label {
+ base mpls-label-special-purpose-value;
+ description
+ "This identity represents the Extension Label.";
+ reference
+ "RFC7274: Allocating and Retiring Special-Purpose MPLS
+ Labels. Sections 3.1 and 5.";
+ }
+
+ /*** Collection of types related to routing ***/
+
+ typedef router-id {
+ type yang:dotted-quad;
+ description
+ "A 32-bit number in the dotted quad format assigned to each
+ router. This number uniquely identifies the router within
+ an Autonomous System.";
+ }
+
+ /*** Collection of types related to VPN ***/
+
+ typedef route-target {
+ type string {
+ pattern
+ '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
+ + '42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
+ + '42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
+ + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
+ + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
+ + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
+ + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
+ + '655[0-2][0-9]|'
+ + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|'
+ + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|'
+ + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(6(:[a-fA-F0-9]{2}){6})|'
+ + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
+ + '[0-9a-fA-F]{1,12})';
+ }
+ description
+ "A route target is an 8-octet BGP extended community
+ initially identifying a set of sites in a BGP
+ VPN (RFC 4364). However, it has since taken on a more
+ general role in BGP route filtering.
+ A route target consists of two or three fields:
+ a 2-octet type field, an administrator field,
+ and, optionally, an assigned number field.
+ According to the data formats for type 0, 1, 2, and 6
+ defined in RFC4360, RFC5668, and RFC7432, the encoding
+ pattern is defined as:
+ 0:2-octet-asn:4-octet-number
+ 1:4-octet-ipv4addr:2-octet-number
+ 2:4-octet-asn:2-octet-number.
+ 6:6-octet-mac-address.
+ Additionally, a generic pattern is defined for future
+ route target types:
+ 2-octet-other-hex-number:6-octet-hex-number
+ Some valid examples are: 0:100:100, 1:1.1.1.1:100,
+ 2:1234567890:203 and 6:26:00:08:92:78:00";
+ reference
+ "RFC4360: BGP Extended Communities Attribute.
+ RFC4364: BGP/MPLS IP Virtual Private Networks (VPNs)
+ RFC5668: 4-Octet AS Specific BGP Extended Community.
+ RFC7432: BGP MPLS-Based Ethernet VPN";
+ }
+
+ typedef ipv6-route-target {
+ 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]|1[0-9]{2}|[1-9]?[0-9])\.){3}'
+ + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))'
+ + ':'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
+ pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+ + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))'
+ + ':'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
+ }
+ description
+ "An IPv6 route target is a 20-octet BGP IPv6 address
+ specific extended community serving the same function
+ as a standard 8-octet route target only allowing for
+ an IPv6 address as the global administrator. The format
+ is <ipv6-address:2-octet-number>.
+ Some valid examples are: 2001:DB8::1:6544 and
+ 2001:DB8::5eb1:791:6b37:17958";
+ reference
+ "RFC5701: IPv6 Address Specific BGP Extended Community
+ Attribute";
+ }
+
+ typedef route-target-type {
+ type enumeration {
+ enum "import" {
+ value 0;
+ description
+ "The route target applies to route import.";
+ }
+ enum "export" {
+ value 1;
+ description
+ "The route target applies to route export.";
+ }
+ enum "both" {
+ value 2;
+ description
+ "The route target applies to both route import and
+ route export.";
+ }
+ }
+ description
+ "Indicates the role a route target takes
+ in route filtering.";
+ reference "RFC4364: BGP/MPLS IP Virtual Private Networks
+ (VPNs).";
+ }
+
+ typedef route-distinguisher {
+ type string {
+ pattern
+ '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
+ + '42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
+ + '42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
+ + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
+ + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
+ + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
+ + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
+ + '655[0-2][0-9]|'
+ + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|'
+ + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|'
+ + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(6(:[a-fA-F0-9]{2}){6})|'
+ + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
+ + '[0-9a-fA-F]{1,12})';
+ }
+ description
+ "A route distinguisher is an 8-octet value used to
+ distinguish routes from different BGP VPNs (RFC 4364).
+ As per RFC 4360, a route distinguisher will have the same
+ format as a route target and will consist of two or three
+ fields including a 2-octet type field, an administrator
+ field, and, optionally, an assigned number field.
+ According to the data formats for type 0, 1, 2, and 6
+ defined in RFC4360, RFC5668, and RFC7432, the encoding
+ pattern is defined as:
+ 0:2-octet-asn:4-octet-number
+ 1:4-octet-ipv4addr:2-octet-number
+ 2:4-octet-asn:2-octet-number.
+ 6:6-octet-mac-address.
+ Additionally, a generic pattern is defined for future
+ route discriminator types:
+ 2-octet-other-hex-number:6-octet-hex-number
+ Some valid examples are: 0:100:100, 1:1.1.1.1:100,
+ 2:1234567890:203 and 6:26:00:08:92:78:00";
+ reference
+ "RFC4360: BGP Extended Communities Attribute.
+ RFC4364: BGP/MPLS IP Virtual Private Networks (VPNs)
+ RFC5668: 4-Octet AS Specific BGP Extended Community.
+ RFC7432: BGP MPLS-Based Ethernet VPN";
+ }
+
+ typedef route-origin {
+ type string {
+ pattern
+ '(0:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0):(429496729[0-5]|'
+ + '42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|429496[0-6][0-9]{3}|'
+ + '42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|429[0-3][0-9]{6}|'
+ + '42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0))|'
+ + '(1:((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|'
+ + '25[0-5])\.){3}([0-9]|[1-9][0-9]|'
+ + '1[0-9]{2}|2[0-4][0-9]|25[0-5])):(6553[0-5]|'
+ + '655[0-2][0-9]|'
+ + '65[0-4][0-9]{2}|6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(2:(429496729[0-5]|42949672[0-8][0-9]|'
+ + '4294967[01][0-9]{2}|'
+ + '429496[0-6][0-9]{3}|42949[0-5][0-9]{4}|'
+ + '4294[0-8][0-9]{5}|'
+ + '429[0-3][0-9]{6}|42[0-8][0-9]{7}|4[01][0-9]{8}|'
+ + '[1-3][0-9]{9}|[1-9][0-9]{0,8}|0):'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0))|'
+ + '(6(:[a-fA-F0-9]{2}){6})|'
+ + '(([3-57-9a-fA-F]|[1-9a-fA-F][0-9a-fA-F]{1,3}):'
+ + '[0-9a-fA-F]{1,12})';
+ }
+ description
+ "A route origin is an 8-octet BGP extended community
+ identifying the set of sites where the BGP route
+ originated (RFC 4364). A route target consists of two
+ or three fields: a 2-octet type field, an administrator
+ field, and, optionally, an assigned number field.
+ According to the data formats for type 0, 1, 2, and 6
+ defined in RFC4360, RFC5668, and RFC7432, the encoding
+ pattern is defined as:
+ 0:2-octet-asn:4-octet-number
+ 1:4-octet-ipv4addr:2-octet-number
+ 2:4-octet-asn:2-octet-number.
+ 6:6-octet-mac-address.
+ Additionally, a generic pattern is defined for future
+ route origin types:
+ 2-octet-other-hex-number:6-octet-hex-number
+ Some valid examples are: 0:100:100, 1:1.1.1.1:100,
+ 2:1234567890:203 and 6:26:00:08:92:78:00";
+ reference
+ "RFC4360: BGP Extended Communities Attribute.
+ RFC4364: BGP/MPLS IP Virtual Private Networks (VPNs)
+ RFC5668: 4-Octet AS Specific BGP Extended Community.
+ RFC7432: BGP MPLS-Based Ethernet VPN";
+ }
+
+ typedef ipv6-route-origin {
+ 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]|1[0-9]{2}|[1-9]?[0-9])\.){3}'
+ + '(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])))'
+ + ':'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
+ pattern '((([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
+ + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?))'
+ + ':'
+ + '(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|'
+ + '6[0-4][0-9]{3}|'
+ + '[1-5][0-9]{4}|[1-9][0-9]{0,3}|0)';
+ }
+ description
+ "An IPv6 route origin is a 20-octet BGP IPv6 address
+ specific extended community serving the same function
+ as a standard 8-octet route only allowing for
+ an IPv6 address as the global administrator. The format
+ is <ipv6-address:2-octet-number>.
+ Some valid examples are: 2001:DB8::1:6544 and
+ 2001:DB8::5eb1:791:6b37:17958";
+ reference
+ "RFC5701: IPv6 Address Specific BGP Extended Community
+ Attribute";
+ }
+
+ /*** Collection of types common to multicast ***/
+
+ typedef ipv4-multicast-group-address {
+ type inet:ipv4-address {
+ pattern '(2((2[4-9])|(3[0-9]))\.).*';
+ }
+ description
+ "This type represents an IPv4 multicast group address,
+ which is in the range from 224.0.0.0 to 239.255.255.255.";
+ reference "RFC1112: Host Extensions for IP Multicasting.";
+ }
+
+ typedef ipv6-multicast-group-address {
+ type inet:ipv6-address {
+ pattern
+ '(([fF]{2}[0-9a-fA-F]{2}):).*';
+ }
+ description
+ "This type represents an IPv6 multicast group address,
+ which is in the range of FF00::/8.";
+ reference
+ "RFC4291: IP Version 6 Addressing Architecture. Sec 2.7.
+ RFC7346: IPv6 Multicast Address Scopes.";
+ }
+
+ typedef ip-multicast-group-address {
+ type union {
+ type ipv4-multicast-group-address;
+ type ipv6-multicast-group-address;
+ }
+ description
+ "This type represents a version-neutral IP multicast group
+ address. The format of the textual representation implies
+ the IP version.";
+ }
+
+ typedef ipv4-multicast-source-address {
+ type union {
+ type enumeration {
+ enum "*" {
+ description
+ "Any source address.";
+ }
+ }
+ type inet:ipv4-address;
+ }
+ description
+ "Multicast source IPv4 address type.";
+ }
+
+ typedef ipv6-multicast-source-address {
+ type union {
+ type enumeration {
+ enum "*" {
+ description
+ "Any source address.";
+ }
+ }
+ type inet:ipv6-address;
+ }
+ description
+ "Multicast source IPv6 address type.";
+ }
+
+ /*** Collection of types common to protocols ***/
+
+ typedef bandwidth-ieee-float32 {
+ type string {
+ pattern
+ '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|'
+ + '1(\.([0-9a-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|'
+ + '1[01][0-9]|0?[0-9]?[0-9])?)';
+ }
+ description
+ "Bandwidth in IEEE 754 floating point 32-bit binary format:
+ (-1)**(S) * 2**(Exponent-127) * (1 + Fraction),
+ where Exponent uses 8 bits, and Fraction uses 23 bits.
+ The units are octets per second.
+ The encoding format is the external hexadecimal-significant
+ character sequences specified in IEEE 754 and C99. The
+ format is restricted to be normalized, non-negative, and
+ non-fraction: 0x1.hhhhhhp{+}d, 0X1.HHHHHHP{+}D, or 0x0p0,
+ where 'h' and 'H' are hexadecimal digits and'd' and 'D' are
+ integers in the range of [0..127].
+ When six hexadecimal digits are used for 'hhhhhh' or
+ 'HHHHHH', the least significant digit must be an even
+ number. 'x' and 'X' indicate hexadecimal; 'p' and 'P'
+ indicate power of two. Some examples are: 0x0p0, 0x1p10, and
+ 0x1.abcde2p+20";
+ reference
+ "IEEE Std 754-2008: IEEE Standard for Floating-Point
+ Arithmetic.";
+ }
+
+ typedef link-access-type {
+ type enumeration {
+ enum "broadcast" {
+ description
+ "Specify broadcast multi-access network.";
+ }
+ enum "non-broadcast-multiaccess" {
+ description
+ "Specify Non-Broadcast Multi-Access (NBMA) network.";
+ }
+ enum "point-to-multipoint" {
+ description
+ "Specify point-to-multipoint network.";
+ }
+ enum "point-to-point" {
+ description
+ "Specify point-to-point network.";
+ }
+ }
+ description
+ "Link access type.";
+ }
+
+ typedef timer-multiplier {
+ type uint8;
+ description
+ "The number of timer value intervals that should be
+ interpreted as a failure.";
+ }
+
+ typedef timer-value-seconds16 {
+ type union {
+ type uint16 {
+ range "1..65535";
+ }
+ type enumeration {
+ enum "infinity" {
+ description
+ "The timer is set to infinity.";
+ }
+ enum "not-set" {
+ description
+ "The timer is not set.";
+ }
+ }
+ }
+ units "seconds";
+ description
+ "Timer value type, in seconds (16-bit range).";
+ }
+
+ typedef timer-value-seconds32 {
+ type union {
+ type uint32 {
+ range "1..4294967295";
+ }
+ type enumeration {
+ enum "infinity" {
+ description
+ "The timer is set to infinity.";
+ }
+ enum "not-set" {
+ description
+ "The timer is not set.";
+ }
+ }
+ }
+ units "seconds";
+ description
+ "Timer value type, in seconds (32-bit range).";
+ }
+ typedef timer-value-milliseconds {
+ type union {
+ type uint32 {
+ range "1..4294967295";
+ }
+ type enumeration {
+ enum "infinity" {
+ description
+ "The timer is set to infinity.";
+ }
+ enum "not-set" {
+ description
+ "The timer is not set.";
+ }
+ }
+ }
+ units "milliseconds";
+ description
+ "Timer value type, in milliseconds.";
+ }
+
+ typedef percentage {
+ type uint8 {
+ range "0..100";
+ }
+ description
+ "Integer indicating a percentage value";
+ }
+
+ typedef timeticks64 {
+ type uint64;
+ description
+ "This type is based on the timeticks type defined in
+ RFC 6991, but with 64-bit width. It represents the time,
+ modulo 2^64, in hundredths of a second between two epochs.";
+ reference "RFC 6991 - Common YANG Data Types";
+ }
+
+ typedef uint24 {
+ type uint32 {
+ range "0 .. 16777215";
+ }
+ description
+ "24-bit unsigned integer";
+ }
+
+ /*** Collection of types related to MPLS/GMPLS ***/
+
+ typedef generalized-label {
+ type binary;
+ description
+ "Generalized label. Nodes sending and receiving the
+ Generalized Label are aware of the link-specific
+ label context and type.";
+ reference "RFC3471: Section 3.2";
+ }
+
+ typedef mpls-label-special-purpose {
+ type identityref {
+ base mpls-label-special-purpose-value;
+ }
+ description
+ "This type represents the special-purpose Multiprotocol Label
+ Switching (MPLS) label values.";
+ reference
+ "RFC3032: MPLS Label Stack Encoding.
+ RFC7274: Allocating and Retiring Special-Purpose MPLS
+ Labels.";
+ }
+
+ typedef mpls-label-general-use {
+ type uint32 {
+ range "16..1048575";
+ }
+ description
+ "The 20-bit label values in an MPLS label stack entry,
+ specified in RFC3032. This label value does not include
+ the encodings of Traffic Class and TTL (time to live).
+ The label range specified by this type is for general use,
+ with special-purpose MPLS label values excluded.";
+ reference "RFC3032: MPLS Label Stack Encoding.";
+ }
+
+ typedef mpls-label {
+ type union {
+ type mpls-label-special-purpose;
+ type mpls-label-general-use;
+ }
+ description
+ "The 20-bit label values in an MPLS label stack entry,
+ specified in RFC3032. This label value does not include
+ the encodings of Traffic Class and TTL (time to live).";
+ reference "RFC3032: MPLS Label Stack Encoding.";
+ }
+
+ /*** Groupings **/
+ grouping mpls-label-stack {
+ description
+ "This grouping specifies an MPLS label stack. The label
+ stack is encoded as a list of label stack entries. The
+ list key is an identifier which indicates relative
+ ordering of each entry, with the lowest value identifier
+ corresponding to the top of the label stack.";
+ container mpls-label-stack {
+ description
+ "Container for a list of MPLS label stack entries.";
+ list entry {
+ key "id";
+ description
+ "List of MPLS label stack entries.";
+ leaf id {
+ type uint8;
+ description
+ "Identifies the entry in a sequence of MPLS label
+ stack entries. An entry with a smaller identifier
+ value precedes an entry with a larger identifier
+ value in the label stack. The value of this ID has
+ no semantic meaning other than relative ordering
+ and referencing the entry.";
+ }
+ leaf label {
+ type rt-types:mpls-label;
+ description
+ "Label value.";
+ }
+ leaf ttl {
+ type uint8;
+ description
+ "Time to Live (TTL).";
+ reference "RFC3032: MPLS Label Stack Encoding.";
+ }
+ leaf traffic-class {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "Traffic Class (TC).";
+ reference
+ "RFC5462: Multiprotocol Label Switching (MPLS) Label
+ Stack Entry: 'EXP' Field Renamed to 'Traffic Class'
+ Field.";
+ }
+ }
+ }
+ }
+
+ grouping vpn-route-targets {
+ description
+ "A grouping that specifies Route Target import-export rules
+ used in the BGP enabled Virtual Private Networks (VPNs).";
+ reference
+ "RFC4364: BGP/MPLS IP Virtual Private Networks (VPNs).
+ RFC4664: Framework for Layer 2 Virtual Private Networks
+ (L2VPNs)";
+ list vpn-target {
+ key "route-target";
+ description
+ "List of Route Targets.";
+ leaf route-target {
+ type rt-types:route-target;
+ description
+ "Route Target value";
+ }
+ leaf route-target-type {
+ type rt-types:route-target-type;
+ mandatory true;
+ description
+ "Import/export type of the Route Target.";
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-te-types@2018-07-01.yang b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-te-types@2018-07-01.yang
new file mode 100644
index 000000000..7a50210e0
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-te-types@2018-07-01.yang
@@ -0,0 +1,2457 @@
+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";
+ }
+
+ import ietf-routing-types {
+ prefix "rt-types";
+ }
+
+ 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: Igor Bryskin
+ <mailto:Igor.Bryskin@huawei.com>";
+
+ description
+ "This module contains a collection of generally
+ useful TE specific YANG data type defintions.";
+
+ revision "2018-07-01" {
+ description "Latest revision of TE types";
+ reference "RFC3209";
+ }
+
+ /*
+ * Identities
+ */
+ identity association-type {
+ description "Base identity for tunnel association";
+ reference "RFC6780, RFC4872, RFC4873";
+ }
+ identity association-type-recovery {
+ base association-type;
+ description
+ "Association Type Recovery used to association LSPs of
+ same tunnel for recovery";
+ reference "RFC4872";
+ }
+ identity association-type-resource-sharing {
+ base association-type;
+ description
+ "Association Type Resource Sharing used to enable resource
+ sharing during make-before-break.";
+ reference "RFC4873";
+ }
+ identity association-type-double-sided-bidir {
+ base association-type;
+ description
+ "Association Type Double Sided bidirectional used to associate
+ two LSPs of two tunnels that are independently configured on
+ either endpoint";
+ reference "RFC7551";
+ }
+ identity association-type-single-sided-bidir {
+ base association-type;
+ description
+ "Association Type Single Sided bidirectional used to associate
+ two LSPs of two tunnels, where a tunnel is configured on one
+ side/endpoint, and the other tunnel is dynamically created on
+ the other endpoint";
+ reference "RFC7551";
+ }
+
+ identity objective-function-type {
+ description "Base objective function type";
+ reference "RFC4657";
+ }
+ identity of-minimize-cost-path {
+ base objective-function-type;
+ description
+ "Mimimuze cost of path objective function";
+ }
+ identity of-minimize-load-path {
+ base objective-function-type;
+ description
+ "Minimize the load on path(s) objective
+ function";
+ }
+ identity of-maximize-residual-bandwidth {
+ base objective-function-type;
+ description
+ "Maximize the residual bandwidth objective
+ function";
+ }
+ identity of-minimize-agg-bandwidth-consumption {
+ base objective-function-type;
+ description
+ "minimize the aggregate bandwidth consumption
+ objective function";
+ }
+ identity of-minimize-load-most-loaded-link {
+ base objective-function-type;
+ description
+ "Minimize the load on the most loaded link
+ objective function";
+ }
+ identity of-minimize-cost-path-set {
+ base objective-function-type;
+ description
+ "Minimize the cost on a path set objective
+ function";
+ }
+
+ identity path-computation-method {
+ description
+ "base identity for supported path computation
+ mechanisms";
+ }
+
+ identity path-locally-computed {
+ base path-computation-method;
+ description
+ "indicates a constrained-path LSP in which the
+ path is computed by the local LER";
+ }
+
+ identity path-externally-queried {
+ base path-computation-method;
+ description
+ "Constrained-path LSP in which the path is
+ obtained by querying an external source, such as a PCE server.
+ In the case that an LSP is defined to be externally queried, it
+ may also have associated explicit definitions (provided
+ to the external source to aid computation); and the path that is
+ returned by the external source is not required to provide a
+ wholly resolved path back to the originating system - that is to
+ say, some local computation may also be required";
+ }
+
+ identity path-explicitly-defined {
+ base path-computation-method;
+ description
+ "constrained-path LSP in which the path is
+ explicitly specified as a collection of strict or/and loose
+ hops";
+ }
+ /**
+ * Typedefs
+ */
+
+ typedef te-bandwidth {
+ type string {
+ pattern
+ '0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|'
+ + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|'
+ + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+'
+ + '(,(0[xX](0((\.0?)?[pP](\+)?0?|(\.0?))|'
+ + '1(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|'
+ + '1[01]\d|0?\d?\d)?)|0[xX][\da-fA-F]{1,8}|\d+))*';
+ }
+ description
+ "This is the generic bandwidth type that is a string containing
+ a list of numbers separated by commas, with each of these
+ number can be non-negative decimal, hex integer, or hex float:
+ (dec | hex | float)[*(','(dec | hex | float))]
+ For packet switching type, a float number is used, such as
+ 0x1p10.
+ For OTN switching type, a list of integers can be used, such
+ as '0,2,3,1', indicating 2 odu0's and 1 odu3.
+ For DWDM, a list of pairs of slot number and width can be
+ used, such as '0, 2, 3, 3', indicating a frequency slot 0 with
+ slot width 2 and a frequency slot 3 with slot width 3.";
+ } // te-bandwidth
+
+ typedef te-ds-class {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "The Differentiatied Class-Type of traffic.";
+ reference "RFC4124: section-4.3.1";
+ }
+
+ typedef te-link-direction {
+ type enumeration {
+ enum INCOMING {
+ description
+ "explicit route represents an incoming link on a node";
+ }
+ enum OUTGOING {
+ description
+ "explicit route represents an outgoing link on a node";
+ }
+ }
+ description
+ "enumerated type for specifying direction of link on a node";
+ }
+
+ typedef te-label-direction {
+ type enumeration {
+ enum FORWARD {
+ description
+ "Label allocated for the forward LSP direction";
+ }
+ enum REVERSE {
+ description
+ "Label allocated for the reverse LSP direction";
+ }
+ }
+ description
+ "enumerated type for specifying the forward or reverse
+ label";
+ }
+
+ typedef te-hop-type {
+ type enumeration {
+ enum LOOSE {
+ description
+ "loose hop in an explicit path";
+ }
+ enum STRICT {
+ description
+ "strict hop in an explicit path";
+ }
+ }
+ description
+ "enumerated type for specifying loose or strict
+ paths";
+ reference "RFC3209: section-4.3.2";
+ }
+
+ identity LSP_METRIC_TYPE {
+ description
+ "Base identity for types of LSP metric specification";
+ }
+
+ identity LSP_METRIC_RELATIVE {
+ base LSP_METRIC_TYPE;
+ description
+ "The metric specified for the LSPs to which this identity refers
+ is specified as a relative value to the IGP metric cost to the
+ LSP's tail-end.";
+ }
+
+ identity LSP_METRIC_ABSOLUTE {
+ base LSP_METRIC_TYPE;
+ description
+ "The metric specified for the LSPs to which this identity refers
+ is specified as an absolute value";
+ }
+
+ identity LSP_METRIC_INHERITED {
+ base LSP_METRIC_TYPE;
+ description
+ "The metric for for the LSPs to which this identity refers is
+ not specified explicitly - but rather inherited from the IGP
+ cost directly";
+ }
+
+ 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.";
+ reference "RFC4875";
+ }
+
+ identity tunnel-action-type {
+ description
+ "Base identity from which specific tunnel action types
+ are derived.";
+ }
+
+ identity tunnel-action-resetup {
+ base tunnel-action-type;
+ description
+ "TE tunnel action resetup. Tears the
+ tunnel's current LSP (if any) and
+ attempts to re-establish a new LSP";
+ }
+
+ identity tunnel-action-reoptimize {
+ base tunnel-action-type;
+ description
+ "TE tunnel action reoptimize.
+ Reoptimizes placement of the tunnel LSP(s)";
+ }
+
+ identity tunnel-action-switchpath {
+ base tunnel-action-type;
+ description
+ "TE tunnel action reoptimize
+ Switches the tunnel's LSP to use the specified path";
+ }
+
+ identity te-action-result {
+ description
+ "Base identity from which specific TE action results
+ are derived.";
+ }
+
+ identity te-action-success {
+ base te-action-result;
+ description "TE action successul.";
+ }
+
+ identity te-action-fail {
+ base te-action-result;
+ description "TE action failed.";
+ }
+
+ identity tunnel-action-inprogress {
+ base te-action-result;
+ description "TE action inprogress.";
+ }
+
+ identity tunnel-admin-state-type {
+ description
+ "Base identity for TE tunnel admin states";
+ }
+
+ identity tunnel-admin-state-up {
+ base tunnel-admin-state-type;
+ description "Tunnel administratively state up";
+ }
+
+ identity tunnel-admin-state-down {
+ base tunnel-admin-state-type;
+ description "Tunnel administratively state down";
+ }
+
+ identity tunnel-state-type {
+ description
+ "Base identity for TE tunnel states";
+ }
+
+ identity tunnel-state-up {
+ base tunnel-state-type;
+ description "Tunnel state up";
+ }
+
+ identity tunnel-state-down {
+ base tunnel-state-type;
+ description "Tunnel state down";
+ }
+
+ identity lsp-state-type {
+ description
+ "Base identity for TE LSP states";
+ }
+
+ identity lsp-path-computing {
+ base lsp-state-type;
+ description
+ "State path compute in progress";
+ }
+
+ identity lsp-path-computation-ok {
+ base lsp-state-type;
+ description
+ "State path compute successful";
+ }
+
+ identity lsp-path-computatione-failed {
+ base lsp-state-type;
+ description
+ "State path compute failed";
+ }
+
+ identity lsp-state-setting-up {
+ base lsp-state-type;
+ description
+ "State setting up";
+ }
+
+ identity lsp-state-setup-ok {
+ base lsp-state-type;
+ description
+ "State setup successful";
+ }
+
+ identity lsp-state-setup-failed {
+ base lsp-state-type;
+ description
+ "State setup failed";
+ }
+
+ identity lsp-state-up {
+ base lsp-state-type;
+ description "State up";
+ }
+
+ identity lsp-state-tearing-down {
+ base lsp-state-type;
+ description
+ "State tearing down";
+ }
+
+ identity lsp-state-down {
+ base lsp-state-type;
+ description "State down";
+ }
+
+ identity path-invalidation-action-type {
+ description
+ "Base identity for TE path invalidation action types";
+ }
+
+ identity path-invalidation-action-drop-type {
+ base path-invalidation-action-type;
+ description
+ "TE path invalidation action drop";
+ }
+
+ identity path-invalidation-action-drop-tear {
+ base path-invalidation-action-type;
+ description
+ "TE path invalidation action tear";
+ }
+
+ identity lsp-restoration-type {
+ description
+ "Base identity from which LSP restoration types are
+ derived.";
+ }
+
+ identity lsp-restoration-restore-any {
+ base lsp-restoration-type;
+ description
+ "Restores when any of the LSPs is affected by a failure";
+ }
+
+ identity lsp-restoration-restore-all {
+ base lsp-restoration-type;
+ description
+ "Restores when all the tunnel LSPs are affected by failure";
+ }
+
+ identity restoration-scheme-type {
+ description
+ "Base identity for LSP restoration schemes";
+ reference "RFC4872";
+ }
+
+ identity restoration-scheme-preconfigured {
+ base restoration-scheme-type;
+ description
+ "Restoration LSP is preconfigured prior to the failure";
+ }
+
+ identity restoration-scheme-precomputed {
+ base restoration-scheme-type;
+ description
+ "Restoration LSP is precomputed prior to the failure";
+ }
+
+ identity restoration-scheme-presignaled {
+ base restoration-scheme-type;
+ description
+ "Restoration LSP is presignaledd prior to the failure";
+ }
+
+ identity lsp-protection-type {
+ description
+ "Base identity from which LSP protection types are
+ derived.";
+ }
+
+ identity lsp-protection-unprotected {
+ base lsp-protection-type;
+ description
+ "LSP protection 'Unprotected'";
+ reference "RFC4872";
+ }
+
+ identity lsp-protection-reroute-extra {
+ base lsp-protection-type;
+ description
+ "LSP protection '(Full) Rerouting'";
+ reference "RFC4872";
+ }
+
+ identity lsp-protection-reroute {
+ base lsp-protection-type;
+ description
+ "LSP protection 'Rerouting without Extra-Traffic'";
+ reference "RFC4872";
+ }
+
+ identity lsp-protection-1-for-n {
+ base lsp-protection-type;
+ description
+ "LSP protection '1:N Protection with Extra-Traffic'";
+ reference "RFC4872";
+ }
+
+ identity lsp-protection-unidir-1-to-1 {
+ base lsp-protection-type;
+ description
+ "LSP protection '1+1 Unidirectional Protection'";
+ reference "RFC4872";
+ }
+
+ identity lsp-protection-bidir-1-to-1 {
+ base lsp-protection-type;
+ description
+ "LSP protection '1+1 Bidirectional Protection'";
+ reference "RFC4872";
+ }
+
+ identity lsp-protection-extra-traffic {
+ base lsp-protection-type;
+ description
+ "LSP protection 'Extra-Traffic'";
+ reference
+ "ITU-T G.808, RFC 4427.";
+ }
+
+ identity lsp-protection-state {
+ description
+ "Base identity of protection states for reporting
+ purposes.";
+ }
+
+ identity normal {
+ base lsp-protection-state;
+ description "Normal state.";
+ }
+
+ identity signal-fail-of-protection {
+ base lsp-protection-state;
+ description
+ "There is a SF condition on the protection transport
+ entity which has higher priority than the FS command.";
+ reference
+ "ITU-T G.873.1, G.8031, G.8131";
+ }
+
+ identity lockout-of-protection {
+ base lsp-protection-state;
+ description
+ "A Loss of Protection (LoP) command is active.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity forced-switch {
+ base lsp-protection-state;
+ description
+ "A forced switch (FS) command is active.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity signal-fail {
+ base lsp-protection-state;
+ description
+ "There is a SF condition on either the working
+ or the protection path.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity signal-degrade {
+ base lsp-protection-state;
+ description
+ "There is an SD condition on either the working or the
+ protection path.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity manual-switch {
+ base lsp-protection-state;
+ description
+ "A manual switch (MS) command is active.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity wait-to-restore {
+ base lsp-protection-state;
+ description
+ "A wait time to restore (WTR) is running.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity do-not-revert {
+ base lsp-protection-state;
+ description
+ "A DNR condition is active because of a non-revertive
+ behavior.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity failure-of-protocol {
+ base lsp-protection-state;
+ description
+ "The protection is not working because of a failure of
+ protocol condition.";
+ reference
+ "ITU-T G.873.1, G.8031, G.8131";
+ }
+
+ identity protection-external-commands {
+ description
+ "Protection external commands for trouble shooting
+ purposes.";
+ }
+
+ identity action-freeze {
+ base protection-external-commands;
+ description
+ "A temporary configuration action initiated by an operator
+ command to prevent any switch action to be taken and as such
+ freezes the current state.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity clear-freeze {
+ base protection-external-commands;
+ description
+ "An action that clears the active freeze state.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity action-lockout-of-normal {
+ base protection-external-commands;
+ description
+ "A temporary configuration action initiated by an operator
+ command to ensure that the normal traffic is not allowed
+ to use the protection transport entity.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity clear-lockout-of-normal {
+ base protection-external-commands;
+ description
+ "An action that clears the active lockout of normal state.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity action-lockout-of-protection {
+ base protection-external-commands;
+ description
+ "A temporary configuration action initiated by an operator
+ command to ensure that the protection transport entity is
+ temporarily not available to transport a traffic signal
+ (either normal or extra traffic).";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity action-forced-switch {
+ base protection-external-commands;
+ description
+ "A switch action initiated by an operator command to swith
+ the extra traffic signal, the normal traffic signal, or the
+ null signal to the protection transport entity, unless an
+ equal or higher priority switch command is in effect.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity action-manual-switch {
+ base protection-external-commands;
+ description
+ "A switch action initiated by an operator command to swith
+ the extra traffic signal, the normal traffic signal #i, or
+ the null signal to the protection transport entity, unless
+ a fault condition exists on other transport entities or an
+ equal or higher priority switch command is in effect.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity action-exercise {
+ base protection-external-commands;
+ description
+ "An action to start testing if the APS communication is
+ operating correctly. It is lower priority than any other
+ state or command.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity clear {
+ base protection-external-commands;
+ description
+ "An action that clears the active near-end lockout of
+ protection, forced switch, manual switch, WTR state,
+ or exercise command.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+
+ identity switching-capabilities {
+ description
+ "Base identity for interface switching capabilities";
+ reference "RFC3471";
+ }
+
+ identity switching-psc1 {
+ base switching-capabilities;
+ description
+ "Packet-Switch Capable-1 (PSC-1)";
+ reference "RFC3471";
+ }
+
+ identity switching-evpl {
+ base switching-capabilities;
+ description
+ "Ethernet Virtual Private Line (EVPL)";
+ }
+
+ identity switching-l2sc {
+ base switching-capabilities;
+ description
+ "Layer-2 Switch Capable (L2SC)";
+ reference "RFC3471";
+ }
+
+ identity switching-tdm {
+ base switching-capabilities;
+ description
+ "Time-Division-Multiplex Capable (TDM)";
+ reference "RFC3471";
+ }
+
+ 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)";
+ reference "RFC3471";
+ }
+
+ identity switching-fsc {
+ base switching-capabilities;
+ description
+ "Fiber-Switch Capable (FSC)";
+ reference "RFC3471";
+ }
+
+ identity lsp-encoding-types {
+ description
+ "Base identity for encoding types";
+ reference "RFC3471";
+ }
+
+ identity lsp-encoding-packet {
+ base lsp-encoding-types;
+ description
+ "Packet LSP encoding";
+ reference "RFC3471";
+ }
+
+ identity lsp-encoding-ethernet {
+ base lsp-encoding-types;
+ description
+ "Ethernet LSP encoding";
+ reference "RFC3471";
+ }
+
+ identity lsp-encoding-pdh {
+ base lsp-encoding-types;
+ description
+ "ANSI/ETSI LSP encoding";
+ reference "RFC3471";
+ }
+
+ identity lsp-encoding-sdh {
+ base lsp-encoding-types;
+ description
+ "SDH ITU-T G.707 / SONET ANSI T1.105 LSP encoding";
+ reference "RFC3471";
+ }
+
+ identity lsp-encoding-digital-wrapper {
+ base lsp-encoding-types;
+ description
+ "Digital Wrapper LSP encoding";
+ reference "RFC3471";
+ }
+
+ identity lsp-encoding-lambda {
+ base lsp-encoding-types;
+ description
+ "Lambda (photonic) LSP encoding";
+ reference "RFC3471";
+ }
+
+ identity lsp-encoding-fiber {
+ base lsp-encoding-types;
+ description
+ "Fiber LSP encoding";
+ reference "RFC3471";
+ }
+
+ identity lsp-encoding-fiber-channel {
+ base lsp-encoding-types;
+ description
+ "FiberChannel LSP encoding";
+ reference "RFC3471";
+ }
+
+ 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 LSPs path
+ setup types are derived";
+ }
+
+ identity path-setup-static {
+ base path-signaling-type;
+ description
+ "Static LSP provisioning path setup";
+ }
+
+ identity path-setup-rsvp {
+ base path-signaling-type;
+ description
+ "RSVP-TE signaling path setup";
+ reference "RFC3209";
+ }
+
+ identity path-setup-sr {
+ base path-signaling-type;
+ description
+ "Segment-routing path setup";
+ }
+
+ identity path-scope-type {
+ description
+ "base identity from which specific path
+ scope types are derived";
+ }
+
+ identity path-scope-segment {
+ base path-scope-type;
+ description
+ "Path scope segment";
+ }
+
+ identity path-scope-end-to-end {
+ base path-scope-type;
+ description
+ "Path scope end to end";
+ }
+
+ /* TE basic features */
+ feature p2mp-te {
+ description
+ "Indicates support for P2MP-TE";
+ reference "RFC4875";
+ }
+
+ feature frr-te {
+ description
+ "Indicates support for TE FastReroute (FRR)";
+ reference "RFC4090";
+ }
+
+ feature extended-admin-groups {
+ description
+ "Indicates support for TE link extended admin
+ groups.";
+ reference "RFC7308";
+ }
+
+ 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";
+ }
+
+ feature path-optimization-metric {
+ description
+ "Indicates support for path optimization metric";
+ }
+
+ feature path-optimization-objective-function {
+ description
+ "Indicates support for path optimization objective function";
+ }
+
+ 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";
+ reference "RFC3785";
+ }
+
+ identity path-metric-igp {
+ base path-metric-type;
+ description
+ "IGP path metric";
+ reference "RFC3785";
+ }
+
+ identity path-metric-hop {
+ base path-metric-type;
+ description
+ "Hop path metric";
+ }
+
+ identity path-metric-delay-average {
+ base path-metric-type;
+ description
+ "Unidirectional average link delay";
+ reference "RFC7471";
+ }
+
+ identity path-metric-residual-bandwidth {
+ base path-metric-type;
+ description
+ "Unidirectional Residual Bandwidth, which is defined to be
+ Maximum Bandwidth [RFC3630] minus the bandwidth currently
+ allocated to LSPs.";
+ reference "RFC7471";
+ }
+ identity path-metric-optimize-includes {
+ base path-metric-type;
+ description
+ "A metric that optimizes the number of included resources
+ specified in a set";
+ }
+
+ identity path-metric-optimize-excludes {
+ base path-metric-type;
+ description
+ "A metric that optimizes the number of excluded resources
+ specified in a set";
+ }
+
+ 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.";
+ reference "RFC7551";
+ }
+
+ identity bidir-provisioning-single-sided {
+ base bidir-provisioning-mode;
+ description
+ "Single-sided bidirectional provioning mode";
+ reference "RFC7551";
+ }
+
+ identity bidir-provisioning-double-sided {
+ base bidir-provisioning-mode;
+ description
+ "Double-sided bidirectional provioning mode";
+ reference "RFC7551";
+ }
+
+ identity bidir-association-type {
+ description
+ "Base identity for bidirectional association type";
+ reference "RFC7551";
+ }
+
+ identity bidir-assoc-corouted {
+ base bidir-association-type;
+ description
+ "Co-routed bidirectional association type";
+ reference "RFC7551";
+ }
+
+ identity bidir-assoc-non-corouted {
+ base bidir-association-type;
+ description
+ "Non co-routed bidirectional association type";
+ reference "RFC7551";
+ }
+
+ identity resource-affinities-type {
+ description
+ "Base identity for resource affinities";
+ reference "RFC2702";
+ }
+
+ 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";
+ reference "RFC2702 and RFC3209";
+ }
+
+ 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";
+ reference "RFC2702 and RFC3209";
+ }
+
+ 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";
+ reference "RFC2702 and RFC3209";
+ }
+
+ typedef optimization-goal {
+ type enumeration {
+ enum minimize {
+ description "Pick lowest path metric goal";
+ }
+ enum maximize {
+ description "Pick highest path metric goal";
+ }
+ enum randomize {
+ description
+ "Pick a path at random from list of
+ equally favorable ones";
+ }
+ }
+ description "TE optimization goal";
+ }
+
+ 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 percentage {
+ type uint8 {
+ range "0..100";
+ }
+ description
+ "Integer indicating a percentage value";
+ }
+
+ 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-path-disjointness {
+ type bits {
+ bit node {
+ position 0;
+ description "Node disjoint.";
+ }
+ bit link {
+ position 1;
+ description "Link disjoint.";
+ }
+ bit srlg {
+ position 2;
+ description "SRLG (Shared Risk Link Group) disjoint.";
+ }
+ }
+ description
+ "Type of the resource disjointness for a TE tunnel path.";
+ reference
+ "RFC4872: RSVP-TE Extensions in Support of End-to-End
+ Generalized Multi-Protocol Label Switching (GMPLS)
+ Recovery";
+ } // te-path-disjointness
+
+ 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\-_.]+)(/[a-zA-Z0-9\-_.]+)*';
+ }
+ description
+ "An identifier for a topology.
+ It is optional to have one or more prefixes at the begining,
+ separated by colons. The prefixes can be the network-types,
+ defined in ietf-network.yang, to help user to understand the
+ topology better before further inquiry.";
+ }
+
+ 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 admin-group {
+ type binary {
+ length 4;
+ }
+ description
+ "Administrative group/Resource class/Color.";
+ reference "RFC3630 and RFC5305";
+ }
+
+ typedef extended-admin-group {
+ type binary;
+ description
+ "Extended administrative group/Resource class/Color.";
+ reference "RFC7308";
+ }
+
+ 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";
+ reference "RFC4203 and RFC5307";
+ }
+
+ 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";
+ reference "RFC3785";
+ }
+
+ /**
+ * TE bandwidth groupings
+ **/
+ identity otn-rate-type {
+ description
+ "Base type to identify OTN bit rates of various information
+ structures.";
+ reference "RFC7139";
+ }
+ identity odu0 {
+ base otn-rate-type;
+ description
+ "ODU0 bit rate.";
+ }
+ identity odu1 {
+ base otn-rate-type;
+ description
+ "ODU1 bit rate.";
+ }
+ identity odu2 {
+ base otn-rate-type;
+ description
+ "ODU2 bit rate.";
+ }
+ identity odu3 {
+ base otn-rate-type;
+ description
+ "ODU3 bit rate.";
+ }
+ identity odu4 {
+ base otn-rate-type;
+ description
+ "ODU4 bit rate.";
+ }
+ identity odu2e {
+ base otn-rate-type;
+ description
+ "ODU2e bit rate.";
+ }
+ identity oduc {
+ base otn-rate-type;
+ description
+ "ODUCn bit rate.";
+ }
+ identity oduflex {
+ base otn-rate-type;
+ description
+ "ODUflex bit rate.";
+ }
+
+ identity wdm-spectrum-type {
+ description
+ "Base type to identify WDM spectrum type.";
+ }
+ identity cwdm {
+ base wdm-spectrum-type;
+ description "CWDM.";
+ reference "RFC6205";
+ }
+ identity dwdm {
+ base wdm-spectrum-type;
+ description "DWDM.";
+ reference "RFC6205";
+ }
+ identity flexible-grid {
+ base wdm-spectrum-type;
+ description "Flexible grid.";
+ reference "RFC6205";
+ }
+
+ grouping te-bandwidth {
+ description
+ "This grouping defines the generic TE bandwidth.
+ For some known data plane technologies, specific modeling
+ structures are specified. The string encoded te-bandwidth
+ type is used for un-specified technologies.
+ The modeling structure can be augmented later for other
+ technologies.";
+ container te-bandwidth {
+ description
+ "Container that specifies TE bandwidth.";
+ choice technology {
+ default generic;
+ description
+ "Data plane technology type.";
+ case generic {
+ leaf generic {
+ type te-bandwidth;
+ description
+ "Bandwidth specified in a generic format.";
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * TE label groupings
+ **/
+ grouping te-label {
+ description
+ "This grouping defines the generic TE label.
+ The modeling structure can be augmented for each technology.
+ For un-specified technologies, rt-types:generalized-label
+ is used.";
+ container te-label {
+ description
+ "Container that specifies TE label.";
+ choice technology {
+ default generic;
+ description
+ "Data plane technology type.";
+ case generic {
+ leaf generic {
+ type rt-types:generalized-label;
+ description
+ "TE label specified in a generic format.";
+ }
+ }
+ }
+ leaf direction {
+ type te-label-direction;
+ description "Label direction";
+ }
+ }
+ }
+ /**
+ * TE performance metric groupings
+ **/
+ grouping performance-metric-container {
+ description
+ "A container containing performance metric attributes.";
+ container 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;
+ }
+ uses performance-metric-throttle-container;
+ }
+ } // performance-metric-container
+
+ grouping te-topology-identifier {
+ description
+ "Augmentation for TE topology.";
+ container te-topology-identifier {
+ description "TE topology identifier container";
+ leaf provider-id {
+ type te-types:te-global-id;
+ description
+ "An identifier to uniquely identify a provider.";
+ }
+ leaf client-id {
+ type te-types:te-global-id;
+ description
+ "An identifier to uniquely identify a client.";
+ }
+ leaf topology-id {
+ type te-types:te-topology-id;
+ description
+ "It is presumed that a datastore will contain many
+ topologies. To distinguish between topologies it is
+ vital to have UNIQUE topology identifiers.";
+ }
+ }
+ }
+
+ 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 rt-types:bandwidth-ieee-float32;
+ 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 rt-types:bandwidth-ieee-float32;
+ 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 rt-types:bandwidth-ieee-float32;
+ 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 throttle {
+ 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
+
+ /**
+ * TE tunnel generic groupings
+ **/
+
+ /* Tunnel path selection parameters */
+ grouping explicit-route-hop {
+ description
+ "The explicit route subobject grouping";
+ leaf index {
+ type uint32;
+ description "ERO subobject index";
+ }
+ choice type {
+ description
+ "The explicit route subobject type";
+ case num-unnum-hop {
+ container num-unnum-hop {
+ leaf node-id {
+ type te-types:te-node-id;
+ description
+ "The identifier of a node in the TE topology.";
+ }
+ leaf link-tp-id {
+ type te-types:te-tp-id;
+ description
+ "TE link termination point identifier. The combination
+ of TE link ID and the TE node ID is used to identify an
+ unnumbered TE link.";
+ }
+ leaf hop-type {
+ type te-hop-type;
+ description "strict or loose hop";
+ }
+ leaf direction {
+ type te-link-direction;
+ description "Unnumbered Link ERO direction";
+ }
+ description
+ "Numbered and Unnumbered link/node explicit route
+ subobject";
+ reference
+ "RFC3209: section 4.3 for EXPLICIT_ROUTE in RSVP-TE
+ RFC3477: Signalling Unnumbered Links in RSVP-TE";
+ }
+ }
+ case as-number {
+ container as-number-hop {
+ leaf as-number {
+ type binary {
+ length 16;
+ }
+ description "AS number";
+ }
+ leaf hop-type {
+ type te-hop-type;
+ description
+ "strict or loose hop";
+ }
+ description
+ "Autonomous System explicit route subobject";
+ }
+ }
+ case label {
+ container label-hop {
+ description "Label hop type";
+ uses te-label;
+ }
+ description
+ "The Label ERO subobject";
+ }
+ }
+ }
+
+ grouping record-route-subobject_state {
+ description
+ "The record route subobject grouping";
+ leaf index {
+ type uint32;
+ description "RRO subobject index";
+ }
+ choice type {
+ description
+ "The record route subobject type";
+ case numbered {
+ leaf address {
+ type te-types:te-tp-id;
+ description
+ "Numbered link TE termination point address.";
+ }
+ leaf ip-flags {
+ type binary {
+ length 8;
+ }
+ description
+ "RRO IP address sub-object flags";
+ reference "RFC3209";
+ }
+ }
+ case unnumbered {
+ leaf node-id {
+ type te-types:te-node-id;
+ description
+ "The identifier of a node in the TE topology.";
+ }
+ leaf link-tp-id {
+ type te-types:te-tp-id;
+ description
+ "TE link termination point identifier, used
+ together with te-node-id to identify the
+ link termination point";
+ }
+ description
+ "Unnumbered link record route subobject";
+ reference
+ "RFC3477: Signalling Unnumbered Links in
+ RSVP-TE";
+ }
+ case label {
+ container label-hop {
+ description "Label hop type";
+ uses te-label;
+ leaf label-flags {
+ type binary {
+ length 8;
+ }
+ description
+ "Label sub-object flags";
+ reference "RFC3209";
+ }
+ }
+ description
+ "The Label RRO subobject";
+ }
+ }
+ }
+
+ grouping label-restriction-info {
+ description "Label set item info";
+ leaf restriction {
+ 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 index {
+ type uint32;
+ description
+ "Then index of the label restriction list entry.";
+ }
+ container label-start {
+ description
+ "This is the starting label if a label range is specified.
+ This is the label value if a single label is specified,
+ in which case, attribute 'label-end' is not set.";
+ uses te-label;
+ }
+ container label-end {
+ description
+ "The ending label if a label range is specified;
+ This attribute is not set, If a single label is
+ specified.";
+ uses te-label;
+ }
+ 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.";
+ }
+ }
+
+ grouping label-set-info {
+ description
+ "Grouping for List of label restrictions specifying what labels
+ may or may not be used on a link connectivity.";
+ container label-restrictions {
+ description
+ "The label restrictions container";
+ list label-restriction {
+ key "index";
+ description
+ "The absence of label-set implies that all labels are
+ acceptable; otherwise only restricted labels are
+ available.";
+ reference
+ "RFC7579: General Network Element Constraint Encoding
+ for GMPLS-Controlled Networks";
+ uses label-restriction-info;
+ }
+ }
+ }
+
+ /*** End of TE tunnel groupings ***/
+ grouping optimizations_config {
+ description "Optimization metrics configuration grouping";
+ leaf metric-type {
+ type identityref {
+ base te-types:path-metric-type;
+ }
+ description "TE path metric type";
+ }
+ leaf weight {
+ type uint8;
+ description "TE path metric normalization weight";
+ }
+ container explicit-route-exclude-objects {
+ when "../metric-type = " +
+ "'te-types:path-metric-optimize-excludes'";
+ description
+ "Container for the exclude route object list";
+ uses path-route-exclude-objects;
+ }
+ container explicit-route-include-objects {
+ when "../metric-type = " +
+ "'te-types:path-metric-optimize-includes'";
+ description
+ "Container for the include route object list";
+ uses path-route-include-objects;
+ }
+ }
+
+ grouping common-constraints_config {
+ description
+ "Common constraints grouping that can be set on
+ a constraint set or directly on the tunnel";
+
+ uses te-types:te-bandwidth {
+ description
+ "A requested bandwidth to use for path computation";
+ }
+
+ leaf setup-priority {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "TE LSP requested setup priority";
+ reference "RFC3209";
+ }
+ leaf hold-priority {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "TE LSP requested hold priority";
+ reference "RFC3209";
+ }
+ leaf signaling-type {
+ type identityref {
+ base te-types:path-signaling-type;
+ }
+ description "TE tunnel path signaling type";
+ }
+ }
+
+ grouping tunnel-constraints_config {
+ description
+ "Tunnel constraints grouping that can be set on
+ a constraint set or directly on the tunnel";
+ uses te-types:te-topology-identifier;
+ uses te-types:common-constraints_config;
+ }
+
+ grouping path-metrics-bounds_config {
+ description "TE path metric bounds grouping";
+ leaf metric-type {
+ type identityref {
+ base te-types:path-metric-type;
+ }
+ description "TE path metric type";
+ }
+ leaf upper-bound {
+ type uint64;
+ description "Upper bound on end-to-end TE path metric";
+ }
+ }
+
+ grouping path-objective-function_config {
+ description "Optimization metrics configuration grouping";
+ leaf objective-function-type {
+ type identityref {
+ base te-types:objective-function-type;
+ }
+ description
+ "Objective function entry";
+ }
+ }
+
+ /**
+ * TE interface generic groupings
+ **/
+ grouping path-route-objects {
+ description
+ "List of EROs to be included or excluded when performing
+ the path computation.";
+ container explicit-route-objects {
+ description
+ "Container for the exclude route object list";
+ list route-object-exclude-always {
+ key index;
+ description
+ "List of explicit route objects to always exclude
+ from path computation";
+ uses te-types:explicit-route-hop;
+ }
+ list route-object-include-exclude {
+ key index;
+ description
+ "List of explicit route objects to include or
+ exclude in path computation";
+ leaf explicit-route-usage {
+ type identityref {
+ base te-types:route-usage-type;
+ }
+ description "Explicit-route usage.";
+ }
+ uses te-types:explicit-route-hop {
+ augment "type" {
+ case srlg {
+ container srlg {
+ description "SRLG container";
+ leaf srlg {
+ type uint32;
+ description "SRLG value";
+ }
+ }
+ description "An SRLG value to be included or excluded";
+ }
+ description
+ "Augmentation to generic explicit route for SRLG
+ exclusion";
+ }
+ }
+ }
+ }
+ }
+
+ grouping path-route-include-objects {
+ description
+ "List of EROs to be included when performing
+ the path computation.";
+ list route-object-include-object {
+ key index;
+ description
+ "List of explicit route objects to be included
+ in path computation";
+ uses te-types:explicit-route-hop;
+ }
+ }
+
+ grouping path-route-exclude-objects {
+ description
+ "List of EROs to be included when performing
+ the path computation.";
+ list route-object-exclude-object {
+ key index;
+ description
+ "List of explicit route objects to be excluded
+ in path computation";
+ uses te-types:explicit-route-hop {
+ augment "type" {
+ case srlg {
+ container srlg {
+ description "SRLG container";
+ leaf srlg {
+ type uint32;
+ description "SRLG value";
+ }
+ }
+ description "An SRLG value to be included or excluded";
+ }
+ description
+ "Augmentation to generic explicit route for SRLG exclusion";
+ }
+ }
+ }
+ }
+
+ grouping generic-path-metric-bounds {
+ description "TE path metric bounds grouping";
+ container path-metric-bounds {
+ description "TE path metric bounds container";
+ list path-metric-bound {
+ key metric-type;
+ description "List of TE path metric bounds";
+ uses path-metrics-bounds_config;
+ }
+ }
+ }
+
+ grouping generic-path-optimization {
+ description "TE generic path optimization grouping";
+
+ container optimizations {
+ description
+ "The objective function container that includes
+ attributes to impose when computing a TE path";
+
+ choice algorithm {
+ description "Optimizations algorithm.";
+ case metric {
+ if-feature path-optimization-metric;
+ /* Optimize by metric */
+ list optimization-metric {
+ key "metric-type";
+ description "TE path metric type";
+ uses optimizations_config;
+ }
+ /* Tiebreakers */
+ container tiebreakers {
+ description
+ "The list of tiebreaker criterion to apply
+ on an equally favored set of paths to pick best";
+ list tiebreaker {
+ key "tiebreaker-type";
+ description
+ "The list of tiebreaker criterion to apply
+ on an equally favored set of paths to pick best";
+ leaf tiebreaker-type {
+ type identityref {
+ base te-types:path-metric-type;
+ }
+ description "The objective function";
+ }
+ }
+ }
+ }
+ case objective-function {
+ if-feature path-optimization-objective-function;
+ /* Objective functions */
+ container objective-function {
+ description
+ "The objective function container that includes
+ attributes to impose when computing a TE path";
+ uses path-objective-function_config;
+ }
+ }
+ }
+ }
+ }
+
+ grouping generic-path-affinities {
+ description
+ "Path affinities grouping";
+ container path-affinities {
+ description
+ "Path affinities container";
+ list constraint {
+ key "usage";
+ description
+ "List of named affinity constraints";
+ leaf usage {
+ type identityref {
+ base resource-affinities-type;
+ }
+ description "Affinities usage";
+ }
+ leaf value {
+ type admin-groups;
+ description "Affinity value";
+ }
+ }
+ }
+ }
+
+ grouping generic-path-srlgs {
+ description
+ "Path SRLG grouping";
+ container path-srlgs {
+ description
+ "Path SRLG properties container";
+ leaf usage {
+ type identityref {
+ base te-types:route-exclude-srlg;
+ }
+ description "SRLG usage";
+ }
+ leaf-list values {
+ type srlg;
+ description "SRLG value";
+ }
+ }
+ }
+
+ grouping generic-path-disjointness {
+ description "Path disjointness grouping";
+ leaf disjointness {
+ type te-types:te-path-disjointness;
+ description
+ "The type of resource disjointness.
+ Under primary path, disjointness level applies to
+ all secondary LSPs. Under secondary, disjointness
+ level overrides the one under primary";
+ }
+ }
+
+ grouping common-path-constraints-attributes {
+ description
+ "Common path constraints configuration grouping";
+ uses common-constraints_config;
+ uses generic-path-metric-bounds;
+ uses generic-path-affinities;
+ uses generic-path-srlgs;
+ }
+
+ grouping generic-path-constraints {
+ description
+ "Global named path constraints configuration
+ grouping";
+ container path-constraints {
+ description "TE named path constraints container";
+ uses common-path-constraints-attributes;
+ uses generic-path-disjointness;
+ }
+ }
+
+ grouping generic-path-properties {
+ description "TE generic path properties grouping";
+ container path-properties {
+ config false;
+ description "The TE path properties";
+ list path-metric {
+ key metric-type;
+ description "TE path metric type";
+ leaf metric-type {
+ type identityref {
+ base te-types:path-metric-type;
+ }
+ description "TE path metric type";
+ }
+ leaf accumulative-value {
+ type uint64;
+ description "TE path metric accumulative value";
+ }
+ }
+ uses generic-path-affinities;
+ uses generic-path-srlgs;
+ container path-route-objects {
+ description
+ "Container for the list of route objects either returned by
+ the computation engine or actually used by an LSP";
+ list path-route-object {
+ key index;
+ description
+ "List of route objects either returned by the computation
+ engine or actually used by an LSP";
+ uses explicit-route-hop;
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-te@2018-03-03.yang b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-te@2018-03-03.yang
new file mode 100644
index 000000000..c9e59cab3
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-te@2018-03-03.yang
@@ -0,0 +1,1562 @@
+module ietf-te {
+ yang-version 1.1;
+
+ namespace "urn:ietf:params:xml:ns:yang:ietf-te";
+
+ /* Replace with IANA when assigned */
+ prefix "te";
+
+ /* Import TE generic types */
+ import ietf-te-types {
+ prefix te-types;
+ }
+
+ import ietf-inet-types {
+ prefix inet;
+ }
+
+ 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@jabil.com>
+
+ Editor: Igor Bryskin
+ <mailto:Igor.Bryskin@huawei.com>";
+
+ description
+ "YANG data module for TE configuration,
+ state, RPC and notifications.";
+
+ revision "2018-03-03" {
+ description "Latest update to TE generic YANG module.";
+ reference "TBA";
+ }
+
+ typedef tunnel-ref {
+ type leafref {
+ path "/te:te/te:tunnels/te:tunnel/te:name";
+ }
+ description
+ "This type is used by data models that need to reference
+ configured TE tunnel.";
+ }
+
+/**** TODO: FIXME Hesam
+ typedef path-ref {
+ type union {
+ type leafref {
+ path "/te:te/te:tunnels/te:tunnel/" +
+ "te:p2p-primary-paths/te:p2p-primary-path/te:name";
+ }
+ type leafref {
+ path "/te:te/te:tunnels/te:tunnel/" +
+ "te:p2p-secondary-paths/te:p2p-secondary-path/te:name";
+ }
+ }
+ description
+ "This type is used by data models that need to reference
+ configured primary or secondary path of a TE tunnel.";
+ }
+***** TODO****/
+
+ typedef tunnel-p2mp-ref {
+ type leafref {
+ path "/te:te/te:tunnels/te:tunnel-p2mp/te:name";
+ }
+ description
+ "This type is used by data models that need to reference
+ configured P2MP TE tunnel.";
+ reference "RFC4875";
+ }
+
+ /**
+ * TE tunnel generic groupings
+ */
+ grouping path-affinities-contents_config {
+ description
+ "Path affinities constraints grouping";
+ reference "RFC3630 and RFC5305";
+ leaf usage {
+ type identityref {
+ base te-types:resource-affinities-type;
+ }
+ description "Affinities usage";
+ }
+ choice style {
+ description
+ "Path affinities representation style";
+ case value {
+ leaf value {
+ type te-types:admin-groups;
+ description
+ "Bitmap indicating what bits are of significance";
+ }
+ }
+ case named {
+ list affinity-names {
+ key "name";
+ leaf name {
+ type string;
+ description "Affinity name";
+ }
+ description "List of named affinities";
+ }
+ }
+ }
+ }
+
+ grouping path-affinities {
+ description "Path affinities grouping";
+ container path-affinities {
+ description "Path affinities container";
+ list constraints {
+ key "usage";
+ description "List of named affinity constraints";
+ uses path-affinities-contents_config;
+ }
+ }
+ }
+
+ grouping path-srlgs-values_config {
+ description "Path SRLG values properties grouping";
+ reference "RFC4203 and RFC5307";
+ leaf usage {
+ type identityref {
+ base te-types:route-exclude-srlg;
+ }
+ description "SRLG usage";
+ }
+ leaf-list values {
+ type te-types:srlg;
+ description "SRLG value";
+ reference "RFC4203 and RFC5307";
+ }
+ }
+
+ grouping path-srlgs {
+ description "Path SRLG properties grouping";
+ container path-srlgs {
+ description "Path SRLG properties container";
+ choice style {
+ description "Type of SRLG representation";
+ case values {
+ uses path-srlgs-values_config;
+ }
+ case named {
+ container constraints {
+ description "SRLG named constraints";
+ list constraint {
+ key "usage";
+ leaf usage {
+ type identityref {
+ base te-types: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 bidirectional-association_config {
+ description
+ "TE tunnel associated bidirectional leaves
+ grouping";
+ reference "RFC7551";
+ 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 te-types:bidir-association-type;
+ }
+ default te-types:bidir-assoc-non-corouted;
+ description "The TE tunnel association type.";
+ }
+ leaf provisioning {
+ type identityref {
+ base te-types: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";
+ }
+ }
+
+ grouping bidir-assoc-properties {
+ description
+ "TE tunnel associated bidirectional properties
+ grouping";
+ reference "RFC7551";
+ container bidirectional {
+ description
+ "TE tunnel associated bidirectional attributes.";
+ container association {
+ description
+ "Tunnel bidirectional association properties";
+ uses bidirectional-association_config;
+ }
+ }
+ }
+
+ grouping p2p-reverse-primary-path-properties {
+ description "tunnel path properties.";
+ reference "RFC7551";
+ container p2p-reverse-primary-path {
+ description "Tunnel reverse primary path properties";
+ uses p2p-path-reverse-properties_config;
+ container state {
+ config false;
+ description
+ "Configuration applied parameters and state";
+ uses p2p-path-properties_state;
+ }
+ container p2p-reverse-secondary-path {
+ description "Tunnel reverse secondary path properties";
+ uses p2p-reverse-path-candidate-secondary-path-config;
+ }
+ }
+ }
+
+ grouping p2p-secondary-path-properties {
+ description "tunnel path properties.";
+ uses p2p-path-properties_config;
+ uses protection-restoration-params_config;
+ container state {
+ config false;
+ description
+ "Configuration applied parameters and state";
+ uses p2p-path-properties_state;
+ }
+ }
+
+ grouping p2p-primary-path-properties {
+ description
+ "TE tunnel primary path properties grouping";
+ uses hierarchical-link;
+ uses p2p-path-properties_config;
+ container state {
+ config false;
+ description
+ "Configuration applied parameters and state";
+ uses p2p-path-properties_state;
+ }
+ }
+
+ grouping path-properties_state {
+ description "Computed path properties grouping";
+ leaf metric-type {
+ type identityref {
+ base te-types:path-metric-type;
+ }
+ description "TE path metric type";
+ }
+ leaf accumulative-value {
+ type uint64;
+ description "TE path metric accumulative value";
+ }
+ }
+
+ grouping path-properties {
+ description "TE computed path properties grouping";
+ container path-properties {
+ description "The TE path computed properties";
+ list path-metric {
+ key metric-type;
+ description "TE path metric type";
+ leaf metric-type {
+ type leafref {
+ path "../state/metric-type";
+ }
+ description "TE path metric type";
+ }
+ container state {
+ config false;
+ description
+ "Configuration applied parameters and state";
+ uses path-properties_state;
+ }
+ }
+ uses path-affinities;
+ uses path-srlgs;
+ container path-route-objects {
+ description
+ "Container for the list of computed route objects
+ as returned by the computation engine";
+ list path-computed-route-object {
+ key index;
+ description
+ "List of computed route objects returned by the
+ computation engine";
+ leaf index {
+ type leafref {
+ path "../state/index";
+ }
+ description "Index of computed route object";
+ }
+ container state {
+ config false;
+ description
+ "Configuration applied parameters and state";
+ uses te-types:explicit-route-hop;
+ }
+ }
+ }
+ uses shared-resources-tunnels;
+ }
+ }
+
+ grouping p2p-path-properties_state {
+ description "TE per path state parameters";
+ uses path-properties {
+ description "The TE path computed properties";
+ }
+ container lsps {
+ description "TE LSPs container";
+ list lsp {
+ key
+ "source destination tunnel-id lsp-id "+
+ "extended-tunnel-id";
+ description "List of LSPs associated with the tunnel.";
+ uses lsp-properties_state;
+ uses shared-resources-tunnels_state;
+ uses lsp-record-route-information_state;
+ uses path-properties {
+ description "The TE path actual properties";
+ }
+ }
+ }
+ }
+
+ grouping p2p-path-properties-common_config {
+ description
+ "TE tunnel common path properties configuration grouping";
+ leaf name {
+ type string;
+ description "TE path name";
+ }
+ leaf path-setup-protocol {
+ type identityref {
+ base te-types:path-signaling-type;
+ }
+ description
+ "Signaling protocol used to set up this tunnel";
+ }
+ leaf path-computation-method {
+ type identityref {
+ base te-types:path-computation-method;
+ }
+ default te-types:path-locally-computed;
+ description
+ "The method used for computing the path, either
+ locally computed, queried from a server or not
+ computed at all (explicitly configured).";
+ }
+ leaf path-computation-server {
+ when "../path-computation-method = "+
+ "'te-types:path-externally-queried'" {
+ description
+ "The path-computation server when the path is
+ externally queried";
+ }
+ type inet:ip-address;
+ description
+ "Address of the external path computation
+ server";
+ }
+ leaf compute-only {
+ type empty;
+ description
+ "When set, the path is computed and updated whenever
+ the topology is updated. No resources are committed
+ or reserved in the network.";
+ }
+ leaf use-path-computation {
+ when "../path-computation-method =" +
+ " 'te-types:path-locally-computed'";
+ type boolean;
+ description "A CSPF dynamically computed path";
+ }
+ leaf lockdown {
+ type empty;
+ description
+ "Indicates no reoptimization to be attempted for
+ this path.";
+ }
+ leaf path-scope {
+ type identityref {
+ base te-types:path-scope-type;
+ }
+ default te-types:path-scope-end-to-end;
+ description "Path scope if segment or an end-to-end path";
+ }
+ }
+
+ grouping p2p-path-reverse-properties_config {
+ description
+ "TE tunnel reverse path properties configuration
+ grouping";
+ uses p2p-path-properties-common_config;
+ uses path-constraints_config;
+ uses te-types:generic-path-optimization;
+ leaf named-path-constraint {
+ if-feature te-types:named-path-constraints;
+ type leafref {
+ path "../../../../../../globals/"
+ + "named-path-constraints/named-path-constraint/"
+ + "name";
+ }
+ description
+ "Reference to a globally defined named path
+ constraint set";
+ }
+ }
+
+ grouping p2p-path-properties_config {
+ description
+ "TE tunnel path properties configuration grouping";
+ uses p2p-path-properties-common_config;
+ uses path-constraints_config;
+ uses te-types:generic-path-optimization;
+ leaf preference {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Specifies a preference for this path. The lower the
+ number higher the preference";
+ }
+ leaf named-path-constraint {
+ if-feature te-types:named-path-constraints;
+ type leafref {
+ path "../../../../../globals/"
+ + "named-path-constraints/named-path-constraint/"
+ + "name";
+ }
+ description
+ "Reference to a globally defined named path
+ constraint set";
+ }
+ }
+
+ /* TE tunnel configuration data */
+ grouping tunnel-p2mp-params_config {
+ description
+ "Configuration parameters relating to TE tunnel";
+ leaf name {
+ type string;
+ description "TE tunnel name.";
+ }
+ leaf identifier {
+ type uint16;
+ description
+ "TE tunnel Identifier.";
+ }
+ leaf description {
+ type string;
+ description
+ "Textual description for this TE tunnel";
+ }
+ }
+
+ grouping hierarchical-link_config {
+ description
+ "Hierarchical link configuration grouping";
+ reference "RFC4206";
+ leaf local-te-node-id {
+ type te-types:te-node-id;
+ description
+ "Local TE node identifier";
+ }
+ leaf local-te-link-tp-id {
+ type te-types:te-tp-id;
+ description
+ "Local TE link termination point identifier";
+ }
+ leaf remote-te-node-id {
+ type te-types:te-node-id;
+ description
+ "Remote TE node identifier";
+ }
+ uses te-types:te-topology-identifier;
+ }
+
+ grouping hierarchical-link {
+ description
+ "Hierarchical link grouping";
+ reference "RFC4206";
+ container hierarchical-link {
+ description
+ "Identifies a hierarchical link (in client layer)
+ that this tunnel is associated with.";
+ uses hierarchical-link_config;
+ }
+ }
+
+ grouping protection-restoration-params_state {
+ description
+ "Protection parameters grouping";
+ leaf lockout-of-normal {
+ type boolean;
+ description
+ "
+ When set to 'True', it represents a lockout of normal
+ traffic external command. When set to 'False', it
+ represents a clear lockout of normal traffic external
+ command. The lockout of normal traffic command applies
+ to this Tunnel.
+ ";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+ leaf freeze {
+ type boolean;
+ description
+ "
+ When set to 'True', it represents a freeze external
+ command. When set to 'False', it represents a clear
+ freeze external command. The freeze command command
+ applies to all the Tunnels which are sharing the
+ protection resources with this Tunnel.
+ ";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+ leaf lsp-protection-role {
+ type enumeration {
+ enum working {
+ description
+ "A working LSP must be a primary LSP whilst a protecting
+ LSP can be either a primary or a secondary LSP. Also,
+ known as protected LSPs when working LSPs are associated
+ with protecting LSPs.";
+ }
+ enum protecting {
+ description
+ "A secondary LSP is an LSP that has been provisioned
+ in the control plane only; e.g. resource allocation
+ has not been committed at the data plane";
+ }
+ }
+ description "LSP role type";
+ reference "rfc4872, section 4.2.1";
+ }
+
+ leaf lsp-protection-state {
+ type identityref {
+ base te-types:lsp-protection-state;
+ }
+ description
+ "The state of the APS state machine controlling which
+ tunnels is using the resources of the protecting LSP.";
+ }
+ leaf protection-group-ingress-node-id {
+ type te-types:te-node-id;
+ description
+ "Indicates the te-node-id of the protection group
+ ingress node when the APS state represents an extenal
+ command (LoP, SF, MS) applied to it or a WTR timer
+ running on it. If the external command is not applied to
+ the ingress node or the WTR timer is not running on it,
+ this attribute is not specified. If value 0.0.0.0 is used
+ when the te-node-id of the protection group ingress node is
+ unknown (e.g., because the ingress node is outside the scope
+ of control of the server)";
+ }
+ leaf protection-group-egress-node-id {
+ type te-types:te-node-id;
+ description
+ "Indicates the te-node-id of the protection group egress node
+ when the APS state represents an extenal command (LoP, SF,
+ MS) applied to it or a WTR timer running on it. If the
+ external command is not applied to the ingress node or
+ the WTR timer is not running on it, this attribute is not
+ specified. If value 0.0.0.0 is used when the te-node-id of
+ the protection group ingress node is unknown (e.g., because
+ the ingress node is outside the scope of control of the
+ server)";
+ }
+ }
+
+ grouping protection-restoration-params_config {
+ description "Protection and restoration parameters";
+ container protection {
+ description "Protection parameters";
+ leaf enable {
+ type boolean;
+ default 'false';
+ description
+ "A flag to specify if LSP protection is enabled";
+ reference "rfc4427";
+ }
+ leaf protection-type {
+ type identityref {
+ base te-types:lsp-protection-type;
+ }
+ description "LSP protection type.";
+ }
+ leaf protection-reversion-disable {
+ type boolean;
+ description "Disable protection reversion to working path";
+ }
+ leaf hold-off-time {
+ type uint32;
+ units "milli-seconds";
+ default 0;
+ description
+ "The time between the declaration of an SF or SD condition
+ and the initialization of the protection switching
+ algorithm.";
+ }
+ leaf wait-to-revert {
+ type uint16;
+ units seconds;
+ description
+ "Time to wait before attempting LSP reversion";
+ }
+ leaf aps-signal-id {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "The APS signal number used to reference the traffic of this
+ tunnel. The default value for normal traffic is 1.
+ The default value for extra-traffic is 255. If not specified,
+ non-default values can be assigned by the server,
+ if and only if, the server controls both endpoints.";
+ reference
+ "ITU-T G.808.1";
+ }
+ }
+ container restoration {
+ description "Restoration parameters";
+ leaf enable {
+ type boolean;
+ default 'false';
+ description
+ "A flag to specify if LSP restoration is enabled";
+ reference "rfc4427";
+ }
+ leaf restoration-type {
+ type identityref {
+ base te-types:lsp-restoration-type;
+ }
+ description "LSP restoration type.";
+ }
+ leaf restoration-scheme {
+ type identityref {
+ base te-types:restoration-scheme-type;
+ }
+ description "LSP restoration scheme.";
+ }
+ leaf restoration-reversion-disable {
+ type boolean;
+ description "Disable restoration reversion to working path";
+ }
+ leaf hold-off-time {
+ type uint32;
+ units "milli-seconds";
+ description
+ "The time between the declaration of an SF or SD condition
+ and the initialization of the protection switching
+ algorithm.";
+ }
+ leaf wait-to-restore {
+ type uint16;
+ units seconds;
+ description
+ "Time to wait before attempting LSP restoration";
+ }
+ leaf wait-to-revert {
+ type uint16;
+ units seconds;
+ description
+ "Time to wait before attempting LSP reversion";
+ }
+ }
+ }
+
+ grouping p2p-dependency-tunnels_config {
+ description
+ "Groupong for tunnel dependency list of tunnels";
+ container dependency-tunnels {
+ description "Dependency tunnels list";
+ list dependency-tunnel {
+ key "name";
+ description "Dependency tunnel entry";
+ leaf name {
+ type leafref {
+ path "../../../../../tunnels/tunnel/name";
+ require-instance false;
+ }
+ description "Dependency tunnel name";
+ }
+ leaf encoding {
+ type identityref {
+ base te-types:lsp-encoding-types;
+ }
+ description "LSP encoding type";
+ reference "RFC3945";
+ }
+ leaf switching-type {
+ type identityref {
+ base te-types:switching-capabilities;
+ }
+ description "LSP switching type";
+ reference "RFC3945";
+ }
+ }
+ }
+ }
+
+ grouping tunnel-p2p-params_config {
+ description
+ "Configuration parameters relating to TE tunnel";
+ leaf name {
+ type string;
+ description "TE tunnel name.";
+ }
+ leaf identifier {
+ type uint16;
+ description
+ "TE tunnel Identifier.";
+ }
+ leaf description {
+ type string;
+ description
+ "Textual description for this TE tunnel";
+ }
+ leaf encoding {
+ type identityref {
+ base te-types:lsp-encoding-types;
+ }
+ description "LSP encoding type";
+ reference "RFC3945";
+ }
+ leaf switching-type {
+ type identityref {
+ base te-types:switching-capabilities;
+ }
+ description "LSP switching type";
+ reference "RFC3945";
+ }
+ leaf provisioning-state {
+ type identityref {
+ base te-types:tunnel-state-type;
+ }
+ default te-types:tunnel-state-up;
+ description "TE tunnel administrative state.";
+ }
+ leaf preference {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Specifies a preference for this tunnel.
+ A lower number signifies a better preference";
+ }
+ leaf reoptimize-timer {
+ type uint16;
+ units seconds;
+ description
+ "frequency of reoptimization of
+ a traffic engineered LSP";
+ }
+ leaf source {
+ type inet:ip-address;
+ description
+ "TE tunnel source address.";
+ }
+ leaf destination {
+ type inet:ip-address;
+ description
+ "P2P tunnel destination address";
+ }
+ leaf src-tp-id {
+ type binary;
+ description
+ "TE tunnel source termination point identifier.";
+ }
+ leaf dst-tp-id {
+ type binary;
+ description
+ "TE tunnel destination termination point identifier.";
+ }
+ uses protection-restoration-params_config;
+ uses te-types:tunnel-constraints_config;
+ uses p2p-dependency-tunnels_config;
+ }
+
+ grouping tunnel-p2p-params_state {
+ description
+ "State parameters relating to TE tunnel";
+ leaf operational-state {
+ type identityref {
+ base te-types:tunnel-state-type;
+ }
+ default te-types:tunnel-state-up;
+ description "TE tunnel administrative state.";
+ }
+ }
+
+ grouping access-segment-info {
+ description
+ "info related to a segment";
+ container forward {
+ description
+ "for the forward direction of this tunnel";
+ uses te-types:label-set-info;
+ }
+ container reverse {
+ description
+ "for the reverse direction of this tunnel";
+ uses te-types:label-set-info;
+ }
+ }
+
+ grouping path-access-segment-info {
+ description
+ "If an end-to-end tunnel crosses multiple domains using
+ the same technology, some additional constraints have to be
+ taken in consideration in each domain";
+ container path-in-segment {
+ presence
+ "The end-to-end tunnel starts in a previous domain;
+ this tunnel is a segment in the current domain.";
+ description
+ "This tunnel is a segment that needs to be coordinated
+ with previous segment stitched on head-end side.";
+ uses access-segment-info;
+ }
+ container path-out-segment {
+ presence
+ "The end-to-end tunnel is not terminated in this domain;
+ this tunnel is a segment in the current domain.";
+ description
+ "This tunnel is a segment that needs to be coordinated
+ with previous segment stitched on head-end side.";
+ uses access-segment-info;
+ }
+ }
+
+ /* TE tunnel configuration/state grouping */
+ grouping tunnel-p2mp-properties {
+ description
+ "Top level grouping for P2MP tunnel properties.";
+ uses tunnel-p2mp-params_config;
+ container state {
+ config false;
+ description
+ "Configuration applied parameters and state";
+ leaf operational-state {
+ type identityref {
+ base te-types:tunnel-state-type;
+ }
+ default te-types:tunnel-state-up;
+ description "TE tunnel administrative state.";
+ }
+ }
+ }
+
+ grouping p2p-path-candidate-secondary-path-config {
+ description
+ "Configuration parameters relating to a secondary path which
+ is a candidate for a particular primary path";
+
+ leaf secondary-path {
+ type leafref {
+ path "../../../../../p2p-secondary-paths/" +
+ "p2p-secondary-path/name";
+ }
+ description
+ "A reference to the secondary path that should be utilised
+ when the containing primary path option is in use";
+ }
+
+ leaf path-setup-protocol {
+ type identityref {
+ base te-types:path-signaling-type;
+ }
+ description
+ "Signaling protocol used to set up this tunnel";
+ }
+ }
+
+ grouping p2p-reverse-path-candidate-secondary-path-config {
+ description
+ "Configuration parameters relating to a secondary path which
+ is a candidate for a particular primary path";
+
+ leaf secondary-path {
+ type leafref {
+ path "../../../../../p2p-secondary-paths/" +
+ "p2p-secondary-path/name";
+ }
+ description
+ "A reference to the secondary path that should be utilised
+ when the containing primary path option is in use";
+ }
+
+ leaf path-setup-protocol {
+ type identityref {
+ base te-types:path-signaling-type;
+ }
+ description
+ "Signaling protocol used to set up this tunnel";
+ }
+ }
+
+ grouping p2p-path-candidate-secondary-path-state {
+ description
+ "Operational state parameters relating to a secondary path
+ which is a candidate for a particular primary path";
+
+ leaf active {
+ type boolean;
+ description
+ "Indicates the current active path option that has
+ been selected of the candidate secondary paths";
+ }
+ }
+
+ grouping tunnel-p2p-properties {
+ description
+ "Top level grouping for tunnel properties.";
+ uses tunnel-p2p-params_config;
+ container state {
+ config false;
+ description
+ "Configuration applied parameters and state";
+ uses tunnel-p2p-params_state;
+ }
+ uses bidir-assoc-properties;
+ container p2p-primary-paths {
+ description "Set of P2P primary aths container";
+ list p2p-primary-path {
+ key "name";
+ description
+ "List of primary paths for this tunnel.";
+ uses p2p-primary-path-properties;
+ uses p2p-reverse-primary-path-properties;
+ container candidate-p2p-secondary-paths {
+ description
+ "The set of candidate secondary paths which may be used
+ for this primary path. When secondary paths are specified
+ in the list the path of the secondary LSP in use must be
+ restricted to those path options referenced. The
+ priority of the secondary paths is specified within the
+ list. Higher priority values are less preferred - that is
+ to say that a path with priority 0 is the most preferred
+ path. In the case that the list is empty, any secondary
+ path option may be utilised when the current primary path
+ is in use.";
+ list candidate-p2p-secondary-path {
+ key "secondary-path";
+ description
+ "List of secondary paths for this tunnel.";
+ uses p2p-path-candidate-secondary-path-config;
+
+ container state {
+ config false;
+ description
+ "Configuration applied parameters and state";
+ uses p2p-path-candidate-secondary-path-state;
+ }
+ }
+ }
+ }
+ }
+ container p2p-secondary-paths {
+ description "Set of P2P secondary paths container";
+ list p2p-secondary-path {
+ key "name";
+ description
+ "List of secondary paths for this tunnel.";
+ uses p2p-secondary-path-properties;
+ }
+ }
+ }
+
+ grouping shared-resources-tunnels_state {
+ description
+ "The specific tunnel that is using the shared secondary path
+ resources";
+ leaf lsp-shared-resources-tunnel {
+ type te:tunnel-ref;
+ description
+ "Reference to the tunnel that sharing secondary path
+ resources with this tunnel";
+ }
+ }
+ grouping shared-resources-tunnels {
+ description
+ "Set of tunnels that share secondary path resources with
+ this tunnnel";
+ container shared-resources-tunnels {
+ description
+ "Set of tunnels that share secondary path resources with
+ this tunnnel";
+ leaf-list lsp-shared-resources-tunnel {
+ type te:tunnel-ref;
+ description
+ "Reference to the tunnel that sharing secondary path
+ resources with this tunnel";
+ }
+ }
+ }
+
+ grouping tunnel-actions {
+ description "Tunnel actions";
+ /***TODO: FIXME: Hesam: actions are not supported by yangtools yet
+ action tunnel-action {
+ description "Tunnel action";
+ input {
+ leaf action-type {
+ type identityref {
+ base te-types:tunnel-action-type;
+ }
+ description "Tunnel action type";
+ }
+ }
+ output {
+ leaf action-result {
+ type identityref {
+ base te-types:te-action-result;
+ }
+ description "The result of the RPC operation";
+ }
+ }
+ }
+ ****TODO: FIXME****/
+ }
+ grouping tunnel-protection-actions {
+ description
+ "Protection external command actions";
+ /***TODO: FIXME: Hesam: actions are not supported by yangtools yet
+ action protection-external-commands {
+ input {
+ leaf protection-external-command {
+ type identityref {
+ base te-types:protection-external-commands;
+ }
+ description
+ "Protection external command";
+ }
+ leaf protection-group-ingress-node-id {
+ type te-types:te-node-id;
+ description
+ "Indicates the te-node-id of the protection group
+ ingress node when the extenal command has to be
+ applied to it. If the external command is not applied
+ to the ingress node, this attribute is not specified.";
+ }
+ leaf protection-group-egress-node-id {
+ type te-types:te-node-id;
+ description
+ "Indicates the te-node-id of the protection group egress
+ node when the extenal command has to be applied to it.
+ If the external command is not applied to the egress node,
+ This attribute is not specified.";
+ }
+ leaf path-ref {
+ type path-ref;
+ description
+ "Indicates to which path the external command applies to.";
+ }
+ leaf traffic-type {
+ type enumeration {
+ enum normal-traffic {
+ description
+ "The manual-switch or forced-switch command applies to
+ the normal traffic (this Tunnel).";
+ }
+ enum null-traffic {
+ description
+ "The manual-switch or forced-switch command applies to
+ the null traffic.";
+ }
+ enum extra-traffic {
+ description
+ "The manual-switch or forced-switch command applies to
+ the extra traffic (the extra-traffic Tunnel sharing
+ protection bandwidth with this Tunnel).";
+ }
+ }
+ description
+ "Indicates whether the manual-switch or forced-switch
+ commands applies to the normal traffic, the null traffic
+ or the extra-traffic.";
+ reference
+ "ITU-T G.808, RFC 4427";
+ }
+ leaf extra-traffic-tunnel-ref {
+ type te:tunnel-ref;
+ description
+ "In case there are multiple extra-traffic tunnels sharing
+ protection bandwidth with this Tunnel (m:n protection),
+ represents which extra-traffic Tunnel the manual-switch or
+ forced-switch to extra-traffic command applies to.";
+ }
+ }
+ }
+ ****TODO: FIXME****/
+ }
+
+ /*** End of TE tunnel groupings ***/
+
+ /**
+ * LSP related generic groupings
+ */
+ grouping lsp-record-route-information_state {
+ description "recorded route information grouping";
+ container lsp-record-route-subobjects {
+ description "RSVP recorded route object information";
+ list record-route-subobject {
+ when "../../origin-type = 'ingress'" {
+ description "Applicable on non-ingress LSPs only";
+ }
+ key "index";
+ description "Record route sub-object list";
+ uses te-types:record-route-subobject_state;
+ }
+ }
+ }
+
+ grouping lsps-state-grouping {
+ description
+ "LSPs state operational data grouping";
+ container lsps-state {
+ config false;
+ description "TE LSPs state container";
+ list lsp {
+ key
+ "source destination tunnel-id lsp-id "+
+ "extended-tunnel-id";
+ description "List of LSPs associated with the tunnel.";
+ uses lsp-properties_state;
+ uses lsp-record-route-information_state;
+ }
+ }
+ }
+
+ /*** End of TE LSP groupings ***/
+
+ /**
+ * TE global generic groupings
+ */
+
+ /* Global named admin-groups configuration data */
+ grouping named-admin-groups_config {
+ description
+ "Global named administrative groups configuration
+ grouping";
+ leaf name {
+ type string;
+ description
+ "A string name that uniquely identifies a TE
+ interface named admin-group";
+ }
+ leaf bit-position {
+ type uint32;
+ description
+ "Bit position representing the administrative group";
+ }
+ }
+ grouping named-admin-groups {
+ description
+ "Global named administrative groups configuration
+ grouping";
+ container named-admin-groups {
+ description "TE named admin groups container";
+ list named-admin-group {
+ if-feature te-types:extended-admin-groups;
+ if-feature te-types:named-extended-admin-groups;
+ key "name";
+ description
+ "List of named TE admin-groups";
+ uses named-admin-groups_config;
+ }
+ }
+ }
+
+ /* Global named admin-srlgs configuration data */
+ grouping named-srlgs_config {
+ description
+ "Global named SRLGs configuration grouping";
+ leaf name {
+ type string;
+ description
+ "A string name that uniquely identifies a TE
+ interface named srlg";
+ }
+ leaf group {
+ type te-types:srlg;
+ description "An SRLG value";
+ }
+ leaf cost {
+ type uint32;
+ description
+ "SRLG associated cost. Used during path to append
+ the path cost when traversing a link with this SRLG";
+ }
+ }
+
+ grouping named-srlgs {
+ description
+ "Global named SRLGs configuration grouping";
+ container named-srlgs {
+ description "TE named SRLGs container";
+ list named-srlg {
+ if-feature te-types:named-srlg-groups;
+ key "name";
+ description
+ "A list of named SRLG groups";
+ uses named-srlgs_config;
+ }
+ }
+ }
+
+ /* Global named paths constraints configuration data */
+ grouping path-constraints_state {
+ description
+ "TE path constraints state";
+ leaf bandwidth-generic_state {
+ type te-types:te-bandwidth;
+ description
+ "A technology agnostic requested bandwidth to use
+ for path computation";
+ }
+ leaf disjointness_state {
+ type te-types:te-path-disjointness;
+ description
+ "The type of resource disjointness.";
+ }
+ }
+
+ grouping path-constraints_config {
+ description
+ "Global named path constraints configuration
+ grouping";
+ uses te-types:common-constraints_config;
+ uses te-types:generic-path-disjointness;
+ uses te-types:generic-path-metric-bounds;
+ uses path-affinities;
+ uses path-srlgs;
+ uses te-types:path-route-objects;
+ uses shared-resources-tunnels {
+ description
+ "Set of tunnels that are allowed to share secondary path
+ resources of this tunnel";
+ }
+ uses path-access-segment-info {
+ description
+ "Tunnel constraints induced by other segments.";
+ }
+ }
+
+ grouping path-constraints {
+ description "Per path constraints";
+ uses path-constraints_config;
+ container state {
+ config false;
+ description
+ "Configuration applied parameters and state";
+ uses path-constraints_state;
+ }
+ }
+
+ grouping named-path-constraints {
+ description
+ "Global named path constraints configuration
+ grouping";
+ container named-path-constraints {
+ description "TE named path constraints container";
+ list named-path-constraint {
+ if-feature te-types:named-path-constraints;
+ key "name";
+ leaf name {
+ type string;
+ description
+ "A string name that uniquely identifies a
+ path constraint set";
+ }
+ uses path-constraints;
+ description
+ "A list of named path constraints";
+ }
+ }
+ }
+
+ /* TE globals container data */
+ grouping globals-grouping {
+ description
+ "Globals TE system-wide configuration data grouping";
+ container globals {
+ description
+ "Globals TE system-wide configuration data container";
+ uses named-admin-groups;
+ uses named-srlgs;
+ uses named-path-constraints;
+ }
+ }
+
+ /* TE tunnels container data */
+ grouping tunnels-grouping {
+ description
+ "Tunnels TE configuration data grouping";
+ container tunnels {
+ description
+ "Tunnels TE configuration data container";
+
+ list tunnel {
+ key "name";
+ description "P2P TE tunnels list.";
+ uses tunnel-p2p-properties;
+ uses tunnel-actions;
+ uses tunnel-protection-actions;
+ }
+ list tunnel-p2mp {
+ key "name";
+ unique "identifier";
+ description "P2MP TE tunnels list.";
+ uses tunnel-p2mp-properties;
+ }
+ }
+ }
+
+ /* TE LSPs ephemeral state container data */
+ grouping lsp-properties_state {
+ description
+ "LSPs state operational data grouping";
+ leaf source {
+ type inet:ip-address;
+ description
+ "Tunnel sender address extracted from
+ SENDER_TEMPLATE object";
+ reference "RFC3209";
+ }
+ leaf destination {
+ type inet:ip-address;
+ description
+ "Tunnel endpoint address extracted from
+ SESSION object";
+ reference "RFC3209";
+ }
+ leaf tunnel-id {
+ type uint16;
+ description
+ "Tunnel identifier used in the SESSION
+ that remains constant over the life
+ of the tunnel.";
+ reference "RFC3209";
+ }
+ leaf lsp-id {
+ type uint16;
+ description
+ "Identifier used in the SENDER_TEMPLATE
+ and the FILTER_SPEC that can be changed
+ to allow a sender to share resources with
+ itself.";
+ reference "RFC3209";
+ }
+ leaf extended-tunnel-id {
+ type inet:ip-address;
+ description
+ "Extended Tunnel ID of the LSP.";
+ reference "RFC3209";
+ }
+ leaf operational-state {
+ type identityref {
+ base te-types:lsp-state-type;
+ }
+ description "LSP operational state.";
+ }
+ leaf path-setup-protocol {
+ type identityref {
+ base te-types:path-signaling-type;
+ }
+ description
+ "Signaling protocol used to set up this tunnel";
+ }
+ leaf origin-type {
+ type enumeration {
+ enum ingress {
+ description
+ "Origin ingress";
+ }
+ enum egress {
+ description
+ "Origin egress";
+ }
+ enum transit {
+ description
+ "transit";
+ }
+ }
+ description
+ "Origin type of LSP relative to the location
+ of the local switch in the path.";
+ }
+
+ leaf lsp-resource-status {
+ type enumeration {
+ enum primary {
+ description
+ "A primary LSP is a fully established LSP for
+ which the resource allocation has been committed
+ at the data plane";
+ }
+ enum secondary {
+ description
+ "A secondary LSP is an LSP that has been provisioned
+ in the control plane only; e.g. resource allocation
+ has not been committed at the data plane";
+ }
+ }
+ description "LSP resource allocation type";
+ reference "rfc4872, section 4.2.1";
+ }
+
+ uses protection-restoration-params_state;
+ }
+ /*** End of TE global groupings ***/
+
+ /**
+ * TE configurations container
+ */
+ container te {
+ presence "Enable TE feature.";
+ description
+ "TE global container.";
+
+ /* TE Global Configuration Data */
+ uses globals-grouping;
+
+ /* TE Tunnel Configuration Data */
+ uses tunnels-grouping;
+
+ /* TE LSPs State Data */
+ uses lsps-state-grouping;
+
+ }
+
+ /* TE Global RPCs/execution Data */
+ rpc globals-rpc {
+ description
+ "Execution data for TE global.";
+ }
+
+ /* TE interfaces RPCs/execution Data */
+ rpc interfaces-rpc {
+ description
+ "Execution data for TE interfaces.";
+ }
+
+ /* TE Tunnel RPCs/execution Data */
+ rpc tunnels-rpc {
+ description "TE tunnels RPC nodes";
+ input {
+ container tunnel-info {
+ description "Tunnel Identification";
+ choice type {
+ description "Tunnel information type";
+ case tunnel-p2p {
+ leaf p2p-id {
+ type te:tunnel-ref;
+ description "P2P TE tunnel";
+ }
+ }
+ case tunnel-p2mp {
+ leaf p2mp-id {
+ type te:tunnel-p2mp-ref;
+ description "P2MP TE tunnel";
+ }
+ }
+ }
+ }
+ }
+ output {
+ container result {
+ description
+ "The container result of the RPC operation";
+ leaf result {
+ type enumeration {
+ enum success {
+ description "Origin ingress";
+ }
+ enum in-progress {
+ description "Origin egress";
+ }
+ enum fail {
+ description "transit";
+ }
+ }
+ description "The result of the RPC operation";
+ }
+ }
+ }
+ }
+
+ /* TE Global Notification Data */
+ notification globals-notif {
+ description
+ "Notification messages for Global TE.";
+ }
+
+ /* TE Tunnel Notification Data */
+ notification tunnels-notif {
+ description
+ "Notification messages for TE tunnels.";
+ }
+}
diff --git a/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-yang-types.yang b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-yang-types.yang
new file mode 100644
index 000000000..5231f6a35
--- /dev/null
+++ b/plugins/restconf-client/provider/src/test/test-yang/sotn/ietf-yang-types.yang
@@ -0,0 +1,438 @@
+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.";
+ }
+} \ No newline at end of file