[ONOS-7331] YANG Runtime: Add UT to validate te-scheduler based anydata.
Change-Id: Id92d44eb3a4eecc084a62157e3ee60ae07ddcd74
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestUtils.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestUtils.java
index ddd4f55..f62127d 100644
--- a/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestUtils.java
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/TestUtils.java
@@ -61,6 +61,11 @@
public static final String LMNG = "yrt.Logistics-manager";
public static final String LMNG_N = "Logistics-manager";
public static final String TANY_NS = "yrt:list.test.anydata";
+ public static final String ACTN_SCHD_NS =
+ "urn:ietf:params:xml:ns:yang:actn-ietf-schedule";
+ public static final String ACTN_TE =
+ "urn:ietf:params:xml:ns:yang:actn-ietf-te";
+
// Logger list is used for walker testing.
private static final List<String> LOGGER = new ArrayList<>();
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/YobActnAnydataTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/YobActnAnydataTest.java
new file mode 100644
index 0000000..e1e3cc2
--- /dev/null
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/YobActnAnydataTest.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.runtime.impl;
+
+import org.junit.Test;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.DefaultConfigurationSchedules;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.Operation;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.configurationschedules.DefaultTarget;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.configurationschedules.target.DefaultDataValue;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.schedules.Schedules;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.schedules.schedules.Schedule;
+import org.onosproject.yang.gen.v11.actnietfte.rev20170310.actnietfte.tunnelp2pproperties.Config;
+import org.onosproject.yang.gen.v11.actnietfte.rev20170310.actnietfte.tunnelsgrouping.tunnels.DefaultTunnel;
+import org.onosproject.yang.model.DataNode;
+import org.onosproject.yang.model.DefaultResourceData;
+import org.onosproject.yang.model.ModelObject;
+import org.onosproject.yang.model.ModelObjectData;
+import org.onosproject.yang.model.ResourceData;
+
+import java.util.List;
+
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.core.Is.is;
+import static org.onosproject.yang.runtime.SerializerHelper.initializeDataNode;
+import static org.onosproject.yang.runtime.impl.serializerhelper.ActnIetfNetAnydataTest.actnDataTree;
+import static org.onosproject.yang.runtime.impl.serializerhelper.ActnIetfNetAnydataTest.validateDataNodeTree;
+
+/**
+ * Tests the YANG object building for the YANG data nodes based on the non
+ * schema augmented nodes.
+ */
+public class YobActnAnydataTest {
+ private static final String NW_TOPO_NAME_SPACE = "urn:ietf:params:xml:ns:yang:yrt-ietf-network-topology";
+ TestYangSerializerContext context = new TestYangSerializerContext();
+
+ @Test
+ public void anydataTest() {
+ DataNode.Builder dBlr = initializeDataNode(context);
+ context.getRegistry().registerAnydataSchema(
+ DefaultDataValue.class, DefaultTunnel.class);
+ DataNode dataNode = actnDataTree(dBlr);
+ ResourceData data = DefaultResourceData.builder()
+ .addDataNode(dataNode).build();
+ DefaultYobBuilder builder = new DefaultYobBuilder(context.getRegistry());
+ ModelObjectData modelObjectData = builder.getYangObject(data);
+ List<ModelObject> modelObjectList = modelObjectData.modelObjects();
+ ModelObject modelObject = modelObjectList.get(0);
+ DefaultConfigurationSchedules c1 = ((DefaultConfigurationSchedules) modelObject);
+ DefaultTarget target = ((DefaultTarget) c1.target().get(0));
+ assertThat(target.object().toString(), is("te-links"));
+
+ Operation obj = target.operation();
+ assertThat(obj.enumeration().toString(), is("configure"));
+
+ DefaultDataValue dataValue = (DefaultDataValue) target.dataValue();
+ DefaultTunnel tunnel = dataValue.anydata(DefaultTunnel.class);
+ assertThat(tunnel.name().toString(), is("p2p"));
+
+ Config config = tunnel.config();
+ assertThat(config.name().toString(), is("p2p"));
+
+ Schedules schedules = target.schedules();
+ Schedule schedule = schedules.schedule().get(0);
+ assertThat(((Long) schedule.scheduleId()).toString(), is("11"));
+ assertThat(schedule.start().toString(), is("2016-09-12T23:20:50.52Z"));
+ assertThat(schedule.scheduleDuration().toString(), is("PT108850373514M"));
+
+ validateDataNodeTree(dataNode);
+ }
+}
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/YtbAtcnAnydataTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/YtbAtcnAnydataTest.java
new file mode 100644
index 0000000..4560a75
--- /dev/null
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/YtbAtcnAnydataTest.java
@@ -0,0 +1,119 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.runtime.impl;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.onosproject.yang.gen.v1.yrtietfyangtypes.rev20130715.yrtietfyangtypes.DateAndTime;
+import org.onosproject.yang.gen.v1.yrtietfyangtypes.rev20130715.yrtietfyangtypes.Xpath10;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.DefaultConfigurationSchedules;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.Operation;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.configurationschedules.DefaultTarget;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.configurationschedules.target.DefaultDataValue;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.schedules.DefaultSchedules;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.schedules.schedules.DefaultSchedule;
+import org.onosproject.yang.gen.v11.actnietfte.rev20170310.actnietfte.tunnelp2pproperties.DefaultConfig;
+import org.onosproject.yang.gen.v11.actnietfte.rev20170310.actnietfte.tunnelsgrouping.tunnels.DefaultTunnel;
+import org.onosproject.yang.model.DataNode;
+import org.onosproject.yang.model.DefaultModelObjectData.Builder;
+import org.onosproject.yang.model.ModelObjectId;
+import org.onosproject.yang.model.NodeKey;
+import org.onosproject.yang.model.ResourceData;
+import org.onosproject.yang.model.ResourceId;
+import org.onosproject.yang.model.SchemaId;
+
+import java.util.List;
+
+import static org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.operation.OperationEnum.CONFIGURE;
+import static org.onosproject.yang.runtime.impl.MockYangSchemaNodeProvider.processSchemaRegistry;
+import static org.onosproject.yang.runtime.impl.MockYangSchemaNodeProvider.registry;
+import static org.onosproject.yang.runtime.impl.serializerhelper.ActnIetfNetAnydataTest.validateDataNodeTree;
+
+/**
+ * Unit test cases for resource id conversion from model object id.
+ */
+public class YtbAtcnAnydataTest {
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+ private ResourceData rscData;
+ private DefaultDataTreeBuilder treeBuilder;
+ private ResourceId id;
+ private List<NodeKey> keys;
+ private SchemaId sid;
+ private ModelObjectId mid;
+ private Builder data;
+ DefaultYangModelRegistry reg;
+
+ /**
+ * Prior setup for each UT.
+ */
+ @Before
+ public void setUp() {
+ processSchemaRegistry();
+ reg = registry();
+ treeBuilder = new DefaultDataTreeBuilder(reg);
+ }
+
+
+ /**
+ * Processes anydata with augmented node as child.
+ */
+ @Test
+ public void processAnydataTest() {
+
+ reg.registerAnydataSchema(
+ DefaultDataValue.class, DefaultTunnel.class);
+ DefaultConfigurationSchedules c1 = new DefaultConfigurationSchedules();
+ DefaultTarget target = new DefaultTarget();
+ target.object(new Xpath10("te-links"));
+ target.operation(new Operation(CONFIGURE));
+
+ DefaultTunnel tunnel = new DefaultTunnel();
+ tunnel.name("p2p");
+
+ DefaultConfig config = new DefaultConfig();
+ config.name("p2p");
+
+ tunnel.config(config);
+ DefaultDataValue dataValue = new DefaultDataValue();
+ dataValue.addAnydata(tunnel);
+
+ DefaultSchedules schedules = new DefaultSchedules();
+ DefaultSchedule schedule = new DefaultSchedule();
+ schedule.scheduleDuration("PT108850373514M");
+ schedule.start(DateAndTime.of("2016-09-12T23:20:50.52Z"));
+
+ long val = 11;
+ schedule.scheduleId(val);
+ schedules.addToSchedule(schedule);
+ target.schedules(schedules);
+
+ target.dataValue(dataValue);
+ c1.addToTarget(target);
+ data = new Builder();
+ data.addModelObject(c1);
+ rscData = treeBuilder.getResourceData(data.build());
+
+ List<DataNode> nodes = rscData.dataNodes();
+ DataNode n = nodes.get(0);
+
+ validateDataNodeTree(n);
+ }
+}
diff --git a/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/ActnIetfNetAnydataTest.java b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/ActnIetfNetAnydataTest.java
new file mode 100644
index 0000000..a859803
--- /dev/null
+++ b/runtime/src/test/java/org/onosproject/yang/runtime/impl/serializerhelper/ActnIetfNetAnydataTest.java
@@ -0,0 +1,227 @@
+/*
+ * Copyright 2017-present Open Networking Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onosproject.yang.runtime.impl.serializerhelper;
+
+import org.junit.Test;
+import org.onosproject.yang.gen.v11.actnietfschedule.rev20170306.actnietfschedule.configurationschedules.target.DefaultDataValue;
+import org.onosproject.yang.gen.v11.actnietfte.rev20170310.actnietfte.tunnelsgrouping.tunnels.DefaultTunnel;
+import org.onosproject.yang.model.DataNode;
+import org.onosproject.yang.model.InnerNode;
+import org.onosproject.yang.model.KeyLeaf;
+import org.onosproject.yang.model.ListKey;
+import org.onosproject.yang.runtime.impl.TestYangSerializerContext;
+
+import java.util.Iterator;
+
+import static org.onosproject.yang.model.DataNode.Type.MULTI_INSTANCE_NODE;
+import static org.onosproject.yang.model.DataNode.Type.SINGLE_INSTANCE_LEAF_VALUE_NODE;
+import static org.onosproject.yang.model.DataNode.Type.SINGLE_INSTANCE_NODE;
+import static org.onosproject.yang.runtime.SerializerHelper.addDataNode;
+import static org.onosproject.yang.runtime.SerializerHelper.exitDataNode;
+import static org.onosproject.yang.runtime.SerializerHelper.initializeDataNode;
+import static org.onosproject.yang.runtime.impl.TestUtils.ACTN_SCHD_NS;
+import static org.onosproject.yang.runtime.impl.TestUtils.ACTN_TE;
+import static org.onosproject.yang.runtime.impl.TestUtils.validateDataNode;
+import static org.onosproject.yang.runtime.impl.TestUtils.validateLeafDataNode;
+import static org.onosproject.yang.runtime.impl.TestUtils.walkINTree;
+
+/**
+ * Tests the serializer helper methods.
+ */
+public class ActnIetfNetAnydataTest {
+
+
+ private static final String[] EXPECTED = {
+ "Entry Node is configuration-schedules.",
+ "Entry Node is target.",
+ "Entry Node is object.",
+ "Exit Node is object.",
+ "Entry Node is operation.",
+ "Exit Node is operation.",
+ "Entry Node is data-value.",
+ "Entry Node is tunnel.",
+ "Entry Node is name.",
+ "Exit Node is name.",
+ "Entry Node is config.",
+ "Entry Node is name.",
+ "Exit Node is name.",
+ "Exit Node is config.",
+ "Exit Node is tunnel.",
+ "Exit Node is data-value.",
+ "Entry Node is schedules.",
+ "Entry Node is schedule.",
+ "Entry Node is schedule-id.",
+ "Exit Node is schedule-id.",
+ "Entry Node is start.",
+ "Exit Node is start.",
+ "Entry Node is schedule-duration.",
+ "Exit Node is schedule-duration.",
+ "Exit Node is schedule.",
+ "Exit Node is schedules.",
+ "Exit Node is target.",
+ "Exit Node is configuration-schedules."
+ };
+
+ /**
+ * Test anydata add to data node builder.
+ */
+ @Test
+ public void atcnDataNodeTest() {
+
+ TestYangSerializerContext context = new TestYangSerializerContext();
+ DataNode.Builder dBlr = initializeDataNode(context);
+ context.getRegistry().registerAnydataSchema(
+ DefaultDataValue.class, DefaultTunnel.class);
+ DataNode n = actnDataTree(dBlr);
+ validateDataNodeTree(n);
+ }
+
+ /**
+ * Creates the data node tree for actn anydata test case.
+ *
+ * @param dBlr data node builder
+ */
+ public static DataNode actnDataTree(DataNode.Builder dBlr) {
+
+ String value = null;
+ // Adding container configuration-schedules
+ dBlr = addDataNode(dBlr, "configuration-schedules", ACTN_SCHD_NS, value, null);
+ // Adding list target
+ dBlr = addDataNode(dBlr, "target", ACTN_SCHD_NS, value, null);
+ value = "te-links";
+ dBlr = addDataNode(dBlr, "object", ACTN_SCHD_NS, value, null);
+ dBlr = exitDataNode(dBlr);
+ value = "configure";
+ dBlr = addDataNode(dBlr, "operation", ACTN_SCHD_NS, value, null);
+ dBlr = exitDataNode(dBlr);
+ // Adding anydata container
+ value = null;
+ dBlr = addDataNode(dBlr, "data-value", ACTN_SCHD_NS, value, null);
+
+ dBlr = addDataNode(dBlr, "tunnel", ACTN_TE, value, null);
+ value = "p2p";
+ dBlr = addDataNode(dBlr, "name", null, value, null);
+ dBlr = exitDataNode(dBlr);
+
+ value = null;
+ dBlr = addDataNode(dBlr, "config", null, value, null);
+ value = "p2p";
+ dBlr = addDataNode(dBlr, "name", null, value, null);
+ dBlr = exitDataNode(dBlr);
+
+ dBlr = exitDataNode(dBlr); // config
+ dBlr = exitDataNode(dBlr); // tunnel
+ dBlr = exitDataNode(dBlr); // data-value
+
+ value = null;
+ // Adding container schedules
+ dBlr = addDataNode(dBlr, "schedules", ACTN_SCHD_NS, value, null);
+ // Adding list schedules
+ dBlr = addDataNode(dBlr, "schedule", null, value, null);
+ value = "11";
+ dBlr = addDataNode(dBlr, "schedule-id", null, value, null);
+ dBlr = exitDataNode(dBlr);
+ value = "2016-09-12T23:20:50.52Z";
+ dBlr = addDataNode(dBlr, "start", null, value, null);
+ dBlr = exitDataNode(dBlr);
+ value = "PT108850373514M";
+ dBlr = addDataNode(dBlr, "schedule-duration", null, value, null);
+ dBlr = exitDataNode(dBlr);
+ dBlr = exitDataNode(dBlr);
+ dBlr = exitDataNode(dBlr);
+ dBlr = exitDataNode(dBlr);
+ return dBlr.build();
+ }
+
+ /**
+ * Validates the given data node sub-tree.
+ *
+ * @param node data node which needs to be validated
+ */
+ public static void validateDataNodeTree(DataNode node) {
+ // Validating the data node.
+ DataNode n = node;
+
+ validateDataNode(n, "configuration-schedules", ACTN_SCHD_NS,
+ SINGLE_INSTANCE_NODE, true, null);
+ Iterator<DataNode> it = ((InnerNode) n).childNodes().values().iterator();
+ n = it.next();
+ validateDataNode(n, "target", ACTN_SCHD_NS, MULTI_INSTANCE_NODE,
+ true, null);
+ Iterator<KeyLeaf> keyIt = ((ListKey) n.key()).keyLeafs().iterator();
+ validateLeafDataNode(keyIt.next(), "object", ACTN_SCHD_NS, "te-links");
+
+ Iterator<DataNode> it1 = ((InnerNode) n).childNodes().values()
+ .iterator();
+ n = it1.next();
+ validateDataNode(n, "object", ACTN_SCHD_NS, SINGLE_INSTANCE_LEAF_VALUE_NODE,
+ false, "te-links");
+ n = it1.next();
+ validateDataNode(n, "operation", ACTN_SCHD_NS, SINGLE_INSTANCE_LEAF_VALUE_NODE,
+ false, "configure");
+
+ n = it1.next();
+ validateDataNode(n, "data-value", ACTN_SCHD_NS, SINGLE_INSTANCE_NODE,
+ true, null);
+
+ Iterator<DataNode> it3 = ((InnerNode) n).childNodes().values()
+ .iterator();
+ n = it3.next();
+ validateDataNode(n, "tunnel", ACTN_TE, MULTI_INSTANCE_NODE,
+ true, null);
+ keyIt = ((ListKey) n.key()).keyLeafs().iterator();
+ validateLeafDataNode(keyIt.next(), "name", ACTN_TE, "p2p");
+
+ it3 = ((InnerNode) n).childNodes().values().iterator();
+ n = it3.next();
+ validateDataNode(n, "name", ACTN_TE, SINGLE_INSTANCE_LEAF_VALUE_NODE,
+ false, "p2p");
+ n = it3.next();
+ validateDataNode(n, "config", ACTN_TE, SINGLE_INSTANCE_NODE,
+ true, null);
+ it3 = ((InnerNode) n).childNodes().values().iterator();
+ n = it3.next();
+ validateDataNode(n, "name", ACTN_TE, SINGLE_INSTANCE_LEAF_VALUE_NODE,
+ false, "p2p");
+
+ n = it1.next();
+ validateDataNode(n, "schedules", ACTN_SCHD_NS, SINGLE_INSTANCE_NODE,
+ true, null);
+
+ Iterator<DataNode> it2 = ((InnerNode) n).childNodes().values()
+ .iterator();
+ n = it2.next();
+ validateDataNode(n, "schedule", ACTN_SCHD_NS, MULTI_INSTANCE_NODE,
+ true, null);
+ keyIt = ((ListKey) n.key()).keyLeafs().iterator();
+ validateLeafDataNode(keyIt.next(), "schedule-id", ACTN_SCHD_NS, "11");
+
+ it1 = ((InnerNode) n).childNodes().values().iterator();
+ n = it1.next();
+ validateDataNode(n, "schedule-id", ACTN_SCHD_NS,
+ SINGLE_INSTANCE_LEAF_VALUE_NODE, false, "11");
+ n = it1.next();
+ validateDataNode(n, "start", ACTN_SCHD_NS, SINGLE_INSTANCE_LEAF_VALUE_NODE,
+ false, "2016-09-12T23:20:50.52Z");
+
+ n = it1.next();
+ validateDataNode(n, "schedule-duration", ACTN_SCHD_NS,
+ SINGLE_INSTANCE_LEAF_VALUE_NODE, false, "PT108850373514M");
+
+ walkINTree(node, EXPECTED);
+ }
+}
diff --git a/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-routing-types.yang b/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-routing-types.yang
new file mode 100644
index 0000000..faf0f28
--- /dev/null
+++ b/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-routing-types.yang
@@ -0,0 +1,713 @@
+module actn-ietf-routing-types {
+
+ namespace "urn:ietf:params:xml:ns:yang:actn-ietf-routing-types";
+ prefix "rt-types";
+
+ import yrt-ietf-yang-types {
+ prefix "yang";
+ }
+
+ import yrt-ietf-inet-types {
+ prefix "inet";
+ }
+
+ organization "IETF Routing Area Working Group (rtgwg)";
+
+ contact
+ "Routing Area Working Group - <rtgwg@ietf.org>";
+
+ description
+ "This module contains a collection of YANG data types
+ considered generally useful for routing protocols.";
+
+ revision 2017-02-27 {
+ description
+ "Initial revision.";
+ reference
+ "RFC TBD: Routing YANG Data Types";
+ }
+
+ /*** 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.";
+ }
+
+ // address-family
+ identity address-family {
+ description
+ "Base identity from which identities describing address
+ families are derived.";
+ }
+
+ identity ipv4 {
+ base address-family;
+ description
+ "This identity represents IPv4 address family.";
+ }
+
+ identity ipv6 {
+ base address-family;
+ description
+ "This identity represents IPv6 address family.";
+ }
+
+ //The rest of the values deinfed in the IANA registry
+
+ identity nsap {
+ base address-family;
+ description
+ "Address family from IANA registry.";
+ }
+ identity hdlc {
+ base address-family;
+ description
+ "(8-bit multidrop)
+ Address family from IANA registry.";
+ }
+ identity bbn1822 {
+ base address-family;
+ description
+ "AHIP (BBN report #1822)
+ Address family from IANA registry.";
+ }
+ identity ieee802 {
+ base address-family;
+ description
+ "(includes all 802 media plus Ethernet canonical format)
+ Address family from IANA registry.";
+ }
+ identity e163 {
+ base address-family;
+ description
+ "Address family from IANA registry.";
+ }
+ identity e164 {
+ base address-family;
+ description
+ "SMDS, Frame Relay, ATM
+ Address family from IANA registry.";
+ }
+ identity f69 {
+ base address-family;
+ description
+ "(Telex)
+ Address family from IANA registry.";
+ }
+ identity x121 {
+ base address-family;
+ description
+ "(X.25, Frame Relay)
+ Address family from IANA registry.";
+ }
+ identity ipx {
+ base address-family;
+ description
+ "Address family from IANA registry.";
+ }
+ identity appletalk {
+ base address-family;
+ description
+ "Address family from IANA registry.";
+ }
+ identity decnet-iv {
+ base address-family;
+ description
+ "Decnet IV
+ Address family from IANA registry.";
+ }
+ identity vines {
+ base address-family;
+ description
+ "Banyan Vines
+ Address family from IANA registry.";
+ }
+ identity e164-nsap {
+ base address-family;
+ description
+ "E.164 with NSAP format subaddress
+ Address family from IANA registry.";
+ }
+ identity dns {
+ base address-family;
+ description
+ "Domain Name System
+ Address family from IANA registry.";
+ }
+ identity dn {
+ base address-family;
+ description
+ "Distinguished Name
+ Address family from IANA registry.";
+ }
+ identity as-num {
+ base address-family;
+ description
+ "AS Number
+ Address family from IANA registry.";
+ }
+ identity xtp-v4 {
+ base address-family;
+ description
+ "XTP over IPv4
+ Address family from IANA registry.";
+ }
+ identity xtp-v6 {
+ base address-family;
+ description
+ "XTP over IPv6
+ Address family from IANA registry.";
+ }
+ identity xtp {
+ base address-family;
+ description
+ "XTP native mode XTP
+ Address family from IANA registry.";
+ }
+ identity fc-port {
+ base address-family;
+ description
+ "Fibre Channel World-Wide Port Name
+ Address family from IANA registry.";
+ }
+ identity fc-node {
+ base address-family;
+ description
+ "Fibre Channel World-Wide Node Name
+ Address family from IANA registry.";
+ }
+ identity gwid {
+ base address-family;
+ description
+ "Address family from IANA registry.";
+ }
+ identity l2vpn {
+ base address-family;
+ description
+ "Address family from IANA registry.";
+ }
+ identity mpls-tp-section-eid {
+ base address-family;
+ description
+ "MPLS-TP Section Endpoint Identifier
+ Address family from IANA registry.";
+ }
+ identity mpls-tp-lsp-eid {
+ base address-family;
+ description
+ "MPLS-TP LSP Endpoint Identifier
+ Address family from IANA registry.";
+ }
+ identity mpls-tp-pwe-eid {
+ base address-family;
+ description
+ "MPLS-TP Pseudowire Endpoint Identifier
+ Address family from IANA registry.";
+ }
+ identity mt-v4 {
+ base address-family;
+ description
+ "Multi-Topology IPv4.
+ Address family from IANA registry.";
+ }
+ identity mt-v6 {
+ base address-family;
+ description
+ "Multi-Topology IPv6.
+ Address family from IANA registry.";
+ }
+
+ /*** collection of types related to VPN ***/
+ typedef route-target {
+ type string {
+ pattern
+ '(0:(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|'
+ + '[0-5]?\d{0,3}\d):(429496729[0-5]|42949672[0-8]\d|'
+ + '4294967[01]\d{2}|429496[0-6]\d{3}|42949[0-5]\d{4}|'
+ + '4294[0-8]\d{5}|429[0-3]\d{6}|42[0-8]\d{7}|4[01]\d{8}|'
+ + '[0-3]?\d{0,8}\d))|'
+ + '(1:(((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|'
+ + '1\d{2}|2[0-4]\d|25[0-5])):(6553[0-5]|655[0-2]\d|'
+ + '65[0-4]\d{2}|6[0-4]\d{3}|[0-5]?\d{0,3}\d))|'
+ + '(2:(429496729[0-5]|42949672[0-8]\d|4294967[01]\d{2}|'
+ + '429496[0-6]\d{3}|42949[0-5]\d{4}|4294[0-8]\d{5}|'
+ + '429[0-3]\d{6}|42[0-8]\d{7}|4[01]\d{8}|[0-3]?\d{0,8}\d):'
+ + '(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|'
+ + '[0-5]?\d{0,3}\d))';
+ }
+ 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 three fields:
+ a 2-octet type field, an administrator field,
+ and an assigned number field.
+ According to the data formats for type 0, 1, and 2 defined in
+ RFC4360 and RFC5668, 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.
+
+ Some valid examples are: 0:100:100, 1:1.1.1.1:100, and
+ 2:1234567890:203.";
+ reference
+ "RFC4360: BGP Extended Communities Attribute.
+ RFC5668: 4-Octet AS Specific BGP Extended Community.";
+ }
+
+ 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]\d|65[0-4]\d{2}|6[0-4]\d{3}|'
+ + '[0-5]?\d{0,3}\d):(429496729[0-5]|42949672[0-8]\d|'
+ + '4294967[01]\d{2}|429496[0-6]\d{3}|42949[0-5]\d{4}|'
+ + '4294[0-8]\d{5}|429[0-3]\d{6}|42[0-8]\d{7}|4[01]\d{8}|'
+ + '[0-3]?\d{0,8}\d))|'
+ + '(1:(((\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|'
+ + '1\d{2}|2[0-4]\d|25[0-5])):(6553[0-5]|655[0-2]\d|'
+ + '65[0-4]\d{2}|6[0-4]\d{3}|[0-5]?\d{0,3}\d))|'
+ + '(2:(429496729[0-5]|42949672[0-8]\d|4294967[01]\d{2}|'
+ + '429496[0-6]\d{3}|42949[0-5]\d{4}|4294[0-8]\d{5}|'
+ + '429[0-3]\d{6}|42[0-8]\d{7}|4[01]\d{8}|[0-3]?\d{0,8}\d):'
+ + '(6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|'
+ + '[0-5]?\d{0,3}\d))|'
+ + '(([3-9a-fA-F]|[1-9a-fA-F][\da-fA-F]{1,3}):'
+ + '[\da-fA-F]{1,12})';
+ }
+ description
+ "A route distinguisher is an 8-octet value used to distinguish
+ routes from different BGP VPNs (RFC 4364). A route
+ distinguisher consists of three fields: A 2-octet type field,
+ an administrator field, and an assigned number field.
+ According to the data formats for type 0, 1, and 2 defined in
+ RFC4364, 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.
+ 2-octet-other-hex-number:6-octet-hex-number
+
+ Some valid examples are: 0:100:100, 1:1.1.1.1:100, and
+ 2:1234567890:203.";
+ reference
+ "RFC4364: BGP/MPLS IP Virtual Private Networks (VPNs).";
+ }
+
+ /*** 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 an IP multicast group address and is IP
+ version neutral. The format of the textual representation
+ implies the IP version.";
+ }
+
+ typedef ipv4-multicast-source-address {
+ type union {
+ type enumeration {
+ //TODO: FIXME
+ //enum '*' {
+ enum 'any-src-addr' {
+ description
+ "Any source address.";
+ }
+ }
+ type inet:ipv4-address;
+ }
+ description
+ "Multicast source IPv4 address type.";
+ }
+
+ typedef ipv6-multicast-source-address {
+ type union {
+ type enumeration {
+ //TODO: FIXME
+ //enum '*' {
+ enum 'any-src-addr' {
+ 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(\.([\da-fA-F]{0,5}[02468aAcCeE]?)?)?[pP](\+)?(12[0-7]|'
+ + '1[01]\d|0?\d?\d)?)';
+ }
+ 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-significand
+ character sequences specified in IEEE 754 and C99,
+ restricted to be normalized, non-negative, and non-fraction:
+ 0x1.hhhhhhp{+}d or 0X1.HHHHHHP{+}D
+ where 'h' and 'H' are hexadecimal digits, '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.";
+ }
+
+ /*** collection of types related to MPLS/GMPLS ***/
+ typedef generalized-label {
+ type binary;
+ description
+ "Generalized label. Nodes sending and receiving the
+ Generalized Label know the kinds of link they are
+ using. Hence, the Generalized Label does not identify
+ its type. Instead, nodes are expected to know from
+ the context and type of label to expect.";
+ reference "RFC3471: Section 3.2";
+ }
+
+ 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.";
+ }
+
+ 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 bits 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 bits 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
+ "A grouping that specifies an MPLS 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 sequence of an MPLS label stack entries.
+ An entry with smaller ID value is precedes an entry in
+ the label stack with a smaller ID.";
+ }
+ 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.";
+ }
+ }
+ }
+ } // mpls-label-stack
+
+ 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.";
+ }
+ }
+ } // vpn-route-targets
+}
diff --git a/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-schedule@2017-03-06.yang b/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-schedule@2017-03-06.yang
new file mode 100644
index 0000000..3fdd3dd
--- /dev/null
+++ b/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-schedule@2017-03-06.yang
@@ -0,0 +1,224 @@
+ module actn-ietf-schedule {
+ yang-version 1.1;
+ namespace "urn:ietf:params:xml:ns:yang:actn-ietf-schedule";
+
+ prefix "sch";
+ import yrt-ietf-yang-types {
+ prefix "yang";
+ }
+
+ organization "TBD";
+ contact "TBD";
+ description
+ "The model allows time scheduling parameters to be specified.";
+
+ revision "2017-03-06" {
+ description "Initial revision";
+ reference "TBD";
+ }
+
+ /*
+ * Typedefs
+ */
+ typedef operation {
+ type enumeration {
+ enum configure {
+ description
+ "Create the configuration data.";
+ }
+ enum deconfigure {
+ description
+ "Remove the configuration data.";
+ }
+ enum set {
+ description
+ "Set the specified configuration data.";
+ }
+ enum reset {
+ description
+ "Revert the specified configuration data back to the
+ original value.";
+ }
+ }
+ description "Operation type.";
+ }
+ /*
+ * Groupings
+ */
+
+ grouping schedule-config-attributes {
+ description
+ "A group of attributes for a schedule.";
+
+ leaf inclusive-exclusive {
+ type enumeration {
+ enum inclusive {
+ description
+ "The schedule element is inclusive, i.e., the schedule
+ specifies the time at which the element is enabled.";
+ }
+ enum exclusive {
+ description
+ "The schedule element is exclusive. i.e., the schedule
+ specifies the time at which the element is disabled.";
+ }
+ }
+ default "inclusive";
+ description
+ "Whether the list item is inclusive or exclusive.";
+ }
+ leaf start {
+ type yang:date-and-time;
+ description "Start time.";
+ }
+ leaf schedule-duration {
+ type string {
+ pattern
+ 'P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?T(\d+H)?(\d+M)?(\d+S)?';
+ }
+ description "Schedule duration in ISO 8601 format.";
+ }
+ leaf repeat-interval {
+ type string {
+ pattern
+ 'R\d*/P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?T(\d+H)?(\d+M)?'
+ + '(\d+S)?';
+ }
+ description "Repeat interval in ISO 8601 format.";
+ }
+ } // schedule-config-attributes
+
+ grouping schedule-config-notification {
+ description
+ "A group of attributes for a schedule notification.";
+
+/****TODO: FIXME: cannot handle notification as child under a container??
+ notification execution {
+ description
+ "Notification event for an execution performed on a target
+ object.";
+ leaf operation {
+ type operation;
+ mandatory true;
+ description "Operation type.";
+ }
+ leaf datetime {
+ type yang:date-and-time;
+ description
+ "The date and time when the execution was performed.";
+ }
+ anydata results {
+ description
+ "This chunk of data contains the results of the execution
+ performed on the target object. The results are the same
+ or equivalent to the contents of a <rpc-reply> message,
+ Because of the nature of such a target execution, a
+ <rpc-reply> message is not used to return the execution
+ results. Instead, this notification is used to serve
+ the same purpose.";
+ }
+ }
+***TODO: FIXME***/
+ } // schedule-config-notification
+
+ grouping schedule-state-attributes {
+ description
+ "State attributes for a schedule.";
+ container future-executions {
+ description
+ "The state information of the nexte scheduled event.";
+ list execution {
+ key "start";
+ description
+ "List of scheduled future executions.";
+ leaf start {
+ type yang:date-and-time;
+ description "Start time.";
+ }
+ leaf duration {
+ type string {
+ pattern
+ 'P(\d+Y)?(\d+M)?(\d+W)?(\d+D)?T(\d+H)?(\d+M)?(\d+S)?';
+ }
+ description "Schedule duration in ISO 8601 format.";
+ }
+ leaf operation {
+ type operation;
+ description "Operation type.";
+ }
+ } // event
+ } // future-events
+ } // schedule-state-attributes
+
+ grouping schedules {
+ description
+ "A list of schedules defining when a particular
+ configuration takes effect.";
+ container schedules {
+ description
+ "Container of a schedule list defining when a particular
+ configuration takes effect.";
+ list schedule {
+ key "schedule-id";
+ description "A list of schedule elements.";
+ leaf schedule-id {
+ type uint32;
+ description "Identifies the schedule element.";
+ }
+ uses schedule-config-attributes;
+ }
+ }
+ } // schedules
+
+ /*
+ * Configuration data and operational state nodes
+ */
+ container configuration-schedules {
+ description
+ "Serves as top-level container for a list of configuration
+ schedules.";
+ list target {
+ key "object";
+ description
+ "A list of targets that configuration schedules are
+ applied.";
+ leaf object {
+ type yang:xpath1.0;
+ description
+ "Xpath defining the data items of interest.";
+ }
+ leaf operation {
+ type operation;
+ default "configure";
+ description
+ "Operation type.";
+ }
+
+ anydata data-value {
+ description
+ "The data value applied to the leaf data node
+ specified by data-objects.
+ The format of the data value depends on the value of the
+ leaf operation defined above:
+ configure: data-value is the sub-tree added to the
+ target object;
+ deconfigure: data-value is the child to be deleted from
+ the target object;
+ set: the target object MULST be a leaf, and
+ data-value is the new value to be set to
+ the target object;
+ reset: data-value is ignored.";
+ }
+
+ uses schedules;
+ container state {
+ config false;
+ description
+ "Operational state data.";
+ uses schedule-state-attributes;
+ } // state
+
+ uses schedule-config-notification;
+ } // target
+ } // configuration-schedules
+ }
diff --git a/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-te-types@2017-03-10.yang b/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-te-types@2017-03-10.yang
new file mode 100755
index 0000000..161298f
--- /dev/null
+++ b/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-te-types@2017-03-10.yang
@@ -0,0 +1,1521 @@
+module actn-ietf-te-types {
+ namespace "urn:ietf:params:xml:ns:yang:actn-ietf-te-types";
+
+ /* Replace with IANA when assigned */
+ prefix "te-types";
+
+ import yrt-ietf-inet-types {
+ prefix inet;
+ }
+
+ import yrt-ietf-yang-types {
+ prefix "yang";
+ }
+
+ import actn-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: Xia Chen
+ <mailto:jescia.chenxia@huawei.com>
+
+ Editor: Raqib Jones
+ <mailto:raqib@Brocade.com>
+
+ Editor: Bin Wen
+ <mailto:Bin_Wen@cable.comcast.com>";
+
+ description
+ "This module contains a collection of generally
+ useful TE specific YANG data type defintions.";
+
+ revision "2017-03-10" {
+ description "Latest revision of TE types";
+ reference "RFC3209";
+ }
+
+ /*
+ * Identities
+ */
+
+ 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 (which are 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";
+ }
+
+ typedef te-ds-class {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "The Differentiatied Class-Type of traffic.";
+ reference "RFC4124: section-4.3.1";
+ }
+
+ 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";
+ }
+
+ 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.";
+ }
+
+ 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 state-type {
+ description
+ "Base identity for TE states";
+ }
+
+ identity state-up {
+ base state-type;
+ description
+ "State up";
+ }
+
+ identity state-down {
+ base state-type;
+ description
+ "State down";
+ }
+
+ identity prov-state-type {
+ description
+ "Base identity for TE tunnel provisioning states";
+ }
+
+ identity prov-state-down {
+ base prov-state-type;
+ description
+ "Provisioning state down";
+ }
+
+ identity prov-state-computing {
+ base prov-state-type;
+ description
+ "Provisioning state computing";
+ }
+
+ identity prov-state-computed-ok {
+ base prov-state-type;
+ description
+ "Provisioning state computation success";
+ }
+
+ identity prov-state-computed-fail {
+ base prov-state-type;
+ description
+ "Provisioning state computation failure";
+ }
+
+ identity prov-state-setting-up {
+ base prov-state-type;
+ description
+ "Provisioning state setting-up";
+ }
+
+ identity prov-state-setup-fail {
+ base prov-state-type;
+ description
+ "Provisioning state setup failure";
+ }
+
+ identity prov-state-active {
+ base prov-state-type;
+ description
+ "Provisioning state active (setup ok)";
+ }
+
+ identity prov-state-tearing-down {
+ base prov-state-type;
+ description
+ "Provisioning state tearing 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-prot-type {
+ description
+ "Base identity from which LSP protection types are
+ derived.";
+ }
+
+ identity lsp-prot-unprotected {
+ base lsp-prot-type;
+ description
+ "LSP protection 'Unprotected'";
+ reference "RFC4872";
+ }
+
+ identity lsp-prot-reroute-extra {
+ base lsp-prot-type;
+ description
+ "LSP protection '(Full) Rerouting'";
+ reference "RFC4872";
+ }
+
+ identity lsp-prot-reroute {
+ base lsp-prot-type;
+ description
+ "LSP protection 'Rerouting without Extra-Traffic'";
+ reference "RFC4872";
+ }
+
+ identity lsp-prot-1-for-n {
+ base lsp-prot-type;
+ description
+ "LSP protection '1:N Protection with Extra-Traffic'";
+ reference "RFC4872";
+ }
+
+ identity lsp-prot-unidir-1-to-1 {
+ base lsp-prot-type;
+ description
+ "LSP protection '1+1 Unidirectional Protection'";
+ reference "RFC4872";
+ }
+
+ identity lsp-prot-bidir-1-to-1 {
+ base lsp-prot-type;
+ description
+ "LSP protection '1+1 Bidirectional Protection'";
+ reference "RFC4872";
+ }
+
+ identity switching-capabilities {
+ description
+ "Base identity for interface switching capabilities";
+ }
+
+ identity switching-psc1 {
+ base switching-capabilities;
+ description
+ "Packet-Switch Capable-1 (PSC-1)";
+ }
+
+ identity switching-evpl {
+ base switching-capabilities;
+ description
+ "Ethernet Virtual Private Line (EVPL)";
+ }
+
+ identity switching-l2sc {
+ base switching-capabilities;
+ description
+ "Layer-2 Switch Capable (L2SC)";
+ }
+
+ identity switching-tdm {
+ base switching-capabilities;
+ description
+ "Time-Division-Multiplex Capable (TDM)";
+ }
+
+ identity switching-otn {
+ base switching-capabilities;
+ description
+ "OTN-TDM capable";
+ }
+
+ identity switching-dcsc {
+ base switching-capabilities;
+ description
+ "Data Channel Switching Capable (DCSC)";
+ }
+
+ identity switching-lsc {
+ base switching-capabilities;
+ description
+ "Lambda-Switch Capable (LSC)";
+ }
+
+ identity switching-fsc {
+ base switching-capabilities;
+ description
+ "Fiber-Switch Capable (FSC)";
+ }
+
+ identity lsp-encoding-types {
+ description
+ "Base identity for encoding types";
+ }
+
+ identity lsp-encoding-packet {
+ base lsp-encoding-types;
+ description
+ "Packet LSP encoding";
+ }
+
+ identity lsp-encoding-ethernet {
+ base lsp-encoding-types;
+ description
+ "Ethernet LSP encoding";
+ }
+
+ identity lsp-encoding-pdh {
+ base lsp-encoding-types;
+ description
+ "ANSI/ETSI LSP encoding";
+ }
+
+ identity lsp-encoding-sdh {
+ base lsp-encoding-types;
+ description
+ "SDH ITU-T G.707 / SONET ANSI T1.105 LSP encoding";
+ }
+
+ identity lsp-encoding-digital-wrapper {
+ base lsp-encoding-types;
+ description
+ "Digital Wrapper LSP encoding";
+ }
+
+ identity lsp-encoding-lambda {
+ base lsp-encoding-types;
+ description
+ "Lambda (photonic) LSP encoding";
+ }
+
+ identity lsp-encoding-fiber {
+ base lsp-encoding-types;
+ description
+ "Fiber LSP encoding";
+ }
+
+ identity lsp-encoding-fiber-channel {
+ base lsp-encoding-types;
+ description
+ "FiberChannel LSP encoding";
+ }
+
+ identity lsp-encoding-oduk {
+ base lsp-encoding-types;
+ description
+ "G.709 ODUk (Digital Path)LSP encoding";
+ }
+
+ identity lsp-encoding-optical-channel {
+ base lsp-encoding-types;
+ description
+ "Line (e.g., 8B/10B) LSP encoding";
+ }
+
+ identity lsp-encoding-line {
+ base lsp-encoding-types;
+ description
+ "Line (e.g., 8B/10B) LSP encoding";
+ }
+
+ identity path-signaling-type {
+ description
+ "Base identity from which specific path signaling
+ types are derived.";
+ }
+
+ identity path-signaling-rsvpte {
+ base tunnel-type;
+ description
+ "RSVP-TE path signaling type";
+ }
+
+ identity path-signaling-sr {
+ base tunnel-type;
+ description
+ "Segment-routing path signaling type";
+ }
+
+ identity te-path-setup-protocol {
+ description
+ "base identity for supported TE LSPs signaling
+ protocols";
+ }
+
+ identity te-path-setup-static {
+ base te-path-setup-protocol;
+ description
+ "Static LSP provisioning";
+ }
+
+ identity te-path-setup-rsvp {
+ base te-path-setup-protocol;
+ description
+ "RSVP-TE signaling protocol";
+ }
+
+ identity te-path-setup-sr {
+ base te-path-setup-protocol;
+ description
+ "Segment routing";
+ }
+
+ /* TE basic features */
+ feature p2mp-te {
+ description
+ "Indicates support for P2MP-TE";
+ }
+
+ feature frr-te {
+ description
+ "Indicates support for TE FastReroute (FRR)";
+ }
+
+ feature extended-admin-groups {
+ description
+ "Indicates support for TE link extended admin
+ groups.";
+ }
+
+ feature named-path-affinities {
+ description
+ "Indicates support for named path affinities";
+ }
+
+ feature named-extended-admin-groups {
+ description
+ "Indicates support for named extended admin groups";
+ }
+
+ feature named-srlg-groups {
+ description
+ "Indicates support for named SRLG groups";
+ }
+
+ feature named-path-constraints {
+ description
+ "Indicates support for named path constraints";
+ }
+
+ grouping explicit-route-hop_config {
+ description
+ "The explicit route subobject grouping";
+ leaf index {
+ type uint32;
+ description "ERO subobject index";
+ }
+ choice type {
+ description
+ "The explicit route subobject type";
+ case ip-address {
+ description
+ "IP address explicit route subobject";
+ container ip-address-hop {
+ description "IP address hop type";
+ leaf address {
+ type inet:ip-address;
+ description
+ "ERO IP address.";
+ }
+ leaf hop-type {
+ type te-hop-type;
+ description
+ "strict or loose hop";
+ }
+ }
+ }
+ 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 unnumbered-link {
+ container unnumbered-hop {
+ leaf router-id {
+ type inet:ip-address;
+ description
+ "A router-id address";
+ }
+ leaf interface-id {
+ type uint32;
+ description "The interface identifier";
+ }
+ leaf hop-type {
+ type te-hop-type;
+ description
+ "strict or loose hop";
+ }
+ description
+ "Unnumbered link explicit route subobject";
+ reference
+ "RFC3477: Signalling Unnumbered Links in
+ RSVP-TE";
+ }
+ }
+ case label {
+ container label-hop {
+ description "Label hop type";
+ leaf value {
+ type rt-types:generalized-label;
+ description "the label value";
+ }
+ }
+ description
+ "The Label ERO subobject";
+ }
+ case sid {
+ container sid-hop {
+ description "foo";
+ leaf sid {
+ type rt-types:generalized-label;
+ description "Segment-routing identifier";
+ }
+ }
+ description "Segment-routing identifier";
+ }
+ }
+ }
+
+ grouping explicit-route-hop {
+ description "Explicit route hop grouping";
+ container config {
+ description
+ "Configuration parameters for the explicit route hop";
+ uses explicit-route-hop_config;
+ }
+ container state {
+ config false;
+ description
+ "State parameters for the explicit route hop";
+ uses explicit-route-hop_config;
+ }
+ }
+
+ grouping record-route-subobject {
+ description
+ "The record route subobject grouping";
+ choice type {
+ description
+ "The record route subobject type";
+ case ip-address {
+ leaf ip-address {
+ type inet:ip-address;
+ description
+ "RRO IP address subobject.";
+ }
+ leaf ip-flags {
+ type binary {
+ length 8;
+ }
+ description
+ "RRO IP address sub-object flags";
+ reference "RFC3209";
+ }
+ }
+ case unnumbered-link {
+ leaf router-id {
+ type inet:ip-address;
+ description
+ "A router-id address";
+ }
+ leaf interface-id {
+ type uint32;
+ description "The interface identifier";
+ }
+ description
+ "Unnumbered link record route subobject";
+ reference
+ "RFC3477: Signalling Unnumbered Links in
+ RSVP-TE";
+ }
+ case label {
+ leaf value {
+ type rt-types:generalized-label;
+ description "the label value";
+ }
+ leaf label-flags {
+ type binary {
+ length 8;
+ }
+ description
+ "Label sub-object flags";
+ reference "RFC3209";
+ }
+ description
+ "The Label ERO subobject";
+ }
+ }
+ }
+
+ identity route-usage-type {
+ description
+ "Base identity for route usage";
+ }
+
+ identity route-include-ero {
+ base route-usage-type;
+ description
+ "Include ERO from route";
+ }
+
+ identity route-exclude-ero {
+ base route-usage-type;
+ description
+ "Exclude ERO from route";
+ }
+
+ identity route-exclude-srlg {
+ base route-usage-type;
+ description
+ "Exclude SRLG from route";
+ }
+
+ identity path-metric-type {
+ description
+ "Base identity for path metric type";
+ }
+
+ identity path-metric-te {
+ base path-metric-type;
+ description
+ "TE path metric";
+ }
+
+ identity path-metric-igp {
+ base path-metric-type;
+ description
+ "IGP path metric";
+ }
+
+ identity path-metric-hop {
+ base path-metric-type;
+ description
+ "Hop path metric";
+ }
+
+ identity path-metric-delay {
+ base path-metric-type;
+ description
+ "Delay path metric";
+ }
+
+ identity path-tiebreaker-type {
+ description
+ "Base identity for path tie-breaker type";
+ }
+
+ identity path-tiebreaker-minfill {
+ base path-tiebreaker-type;
+ description
+ "Min-Fill LSP path placement";
+ }
+
+ identity path-tiebreaker-maxfill {
+ base path-tiebreaker-type;
+ description
+ "Max-Fill LSP path placement";
+ }
+
+ identity path-tiebreaker-randoom {
+ base path-tiebreaker-type;
+ description
+ "Random LSP path placement";
+ }
+
+ identity bidir-provisioning-mode {
+ description
+ "Base identity for bidirectional provisioning
+ mode.";
+ }
+
+ identity bidir-provisioning-single-sided {
+ base bidir-provisioning-mode;
+ description
+ "Single-sided bidirectional provioning mode";
+ }
+
+ identity bidir-provisioning-double-sided {
+ base bidir-provisioning-mode;
+ description
+ "Double-sided bidirectional provioning mode";
+ }
+
+ identity bidir-association-type {
+ description
+ "Base identity for bidirectional association type";
+ }
+
+ identity bidir-assoc-corouted {
+ base bidir-association-type;
+ description
+ "Co-routed bidirectional association type";
+ }
+
+ identity bidir-assoc-non-corouted {
+ base bidir-association-type;
+ description
+ "Non co-routed bidirectional association type";
+ }
+
+ identity resource-affinities-type {
+ description
+ "Base identity for resource affinities";
+ }
+
+ identity resource-aff-include-all {
+ base resource-affinities-type;
+ description
+ "The set of attribute filters associated with a
+ tunnel all of which must be present for a link
+ to be acceptable";
+ }
+
+ identity resource-aff-include-any {
+ base resource-affinities-type;
+ description
+ "The set of attribute filters associated with a
+ tunnel any of which must be present for a link
+ to be acceptable";
+ }
+
+ identity resource-aff-exclude-any {
+ base resource-affinities-type;
+ description
+ "The set of attribute filters associated with a
+ tunnel any of which renders a link unacceptable";
+ }
+
+ identity te-optimization-criterion {
+ description
+ "Base identity for TE optimization criterion.";
+ reference
+ "RFC3272: Overview and Principles of Internet Traffic
+ Engineering.";
+ }
+
+ identity not-optimized {
+ base te-optimization-criterion;
+ description "Optimization is not applied.";
+ }
+
+ identity cost {
+ base te-optimization-criterion;
+ description "Optimized on cost.";
+ }
+
+ identity delay {
+ base te-optimization-criterion;
+ description "Optimized on delay.";
+ }
+
+ /*
+ * Typedefs
+ */
+
+ typedef 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-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.";
+ }
+
+ typedef extended-admin-group {
+ type binary;
+ description
+ "Extended administrative group/Resource class/Color.";
+ }
+
+ typedef admin-groups {
+ type union {
+ type admin-group;
+ type extended-admin-group;
+ }
+ description "TE administrative group derived type";
+ }
+
+ typedef srlg {
+ type uint32;
+ description "SRLG type";
+ }
+
+ identity path-computation-srlg-type {
+ description
+ "Base identity for SRLG path computation";
+ }
+
+ identity srlg-ignore {
+ base path-computation-srlg-type;
+ description
+ "Ignores SRLGs in path computation";
+ }
+
+ identity srlg-strict {
+ base path-computation-srlg-type;
+ description
+ "Include strict SRLG check in path computation";
+ }
+
+ identity srlg-preferred {
+ base path-computation-srlg-type;
+ description
+ "Include preferred SRLG check in path computation";
+ }
+
+ identity srlg-weighted {
+ base path-computation-srlg-type;
+ description
+ "Include weighted SRLG check in path computation";
+ }
+
+ typedef te-metric {
+ type uint32;
+ description
+ "TE link metric";
+ }
+
+ /**
+ * TE 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 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 */
+ /*** End of TE tunnel groupings ***/
+
+ /**
+ * TE interface generic groupings
+ **/
+
+
+/**************************************************************/
+//TODO: FIXME: HENRY added begins
+ identity te-path-numerical-property {
+ description "Base TE path property type";
+ }
+ identity te-path-cost {
+ base te-path-numerical-property;
+ description "TE path property";
+ }
+ identity te-path-delay {
+ base te-path-numerical-property;
+ description "TE path property";
+ }
+ identity te-path-hop {
+ base te-path-numerical-property;
+ description "TE path property";
+ }
+ identity te-path-igp-metric {
+ base te-path-numerical-property;
+ description "TE path property";
+ }
+ identity te-path-metric {
+ base te-path-numerical-property;
+ description "TE path property";
+ }
+
+ 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-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
+
+
+
+//TODO: FIXME: HENRY added finish
+/**************************************************************/
+
+ }
diff --git a/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-te@2017-03-10.yang b/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-te@2017-03-10.yang
new file mode 100755
index 0000000..d9127aa
--- /dev/null
+++ b/runtime/src/test/resources/schemaProviderTestYangFiles/actn-ietf-te@2017-03-10.yang
@@ -0,0 +1,2169 @@
+module actn-ietf-te {
+ yang-version 1.1;
+
+ namespace "urn:ietf:params:xml:ns:yang:actn-ietf-te";
+
+ /* Replace with IANA when assigned */
+ prefix "te";
+
+ /* Import TE generic types */
+ import actn-ietf-te-types {
+ prefix te-types;
+ }
+
+ import yrt-ietf-te-mpls-types {
+ prefix "te-mpls-types";
+ }
+
+ import yrt-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: Xia Chen
+ <mailto:jescia.chenxia@huawei.com>
+
+ Editor: Raqib Jones
+ <mailto:raqib@Brocade.com>
+
+ Editor: Bin Wen
+ <mailto:Bin_Wen@cable.comcast.com>";
+
+ description
+ "YANG data module for TE configuration,
+ state, RPC and notifications.";
+
+ revision "2017-03-10" {
+ description "Latest update to TE generic YANG module.";
+ reference "TBD";
+ }
+
+ 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.";
+ }
+
+ 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.";
+ }
+
+ /**
+ * TE tunnel 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 include or exclude route object list";
+ list explicit-route-object {
+ key index;
+ description
+ "List of explicit route objects to include or
+ exclude in path computation";
+ leaf index {
+ type leafref {
+ path "../config/index";
+ }
+ description
+ "Index of this explicit route object";
+ }
+ leaf explicit-route-usage {
+ type identityref {
+ base te-types:route-usage-type;
+ }
+ description "An explicit-route hop action.";
+ }
+ uses te-types:explicit-route-hop;
+ }
+ }
+ }
+
+ grouping path-affinities {
+ description
+ "Path affinities grouping";
+ container path-affinities {
+ description
+ "Path affinities container";
+ choice style {
+ description
+ "Path affinities representation style";
+ case values {
+ leaf value {
+ type uint32 {
+ range "0..4294967295";
+ }
+ description
+ "Affinity value";
+ }
+ leaf mask {
+ type uint32 {
+ range "0..4294967295";
+ }
+ description
+ "Affinity mask";
+ }
+ }
+ case named {
+ list constraints {
+ key "usage";
+ leaf usage {
+ type identityref {
+ base te-types:resource-affinities-type;
+ }
+ description "Affinities usage";
+ }
+ container constraint {
+ description
+ "Container for named affinities";
+ list affinity-names {
+ key "name";
+ leaf name {
+ type string;
+ description
+ "Affinity name";
+ }
+ description
+ "List of named affinities";
+ }
+ }
+ description
+ "List of named affinity constraints";
+ }
+ }
+ }
+ }
+ }
+
+ grouping path-srlgs {
+ description
+ "Path SRLG properties grouping";
+ container path-srlgs {
+ description
+ "Path SRLG properties container";
+ choice style {
+ description
+ "Type of SRLG representation";
+ case values {
+ leaf usage {
+ type identityref {
+ base te-types:route-exclude-srlg;
+ }
+ description "SRLG usage";
+ }
+ leaf-list values {
+ type te-types:srlg;
+ description "SRLG value";
+ }
+ }
+ case named {
+ list constraints {
+ key "usage";
+ leaf usage {
+ type identityref {
+ base 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 bidir-assoc-properties {
+ description
+ "TE tunnel associated bidirectional properties
+ grouping";
+ container bidirectional {
+ description
+ "TE tunnel associated bidirectional attributes.";
+ container association {
+ description
+ "Tunnel bidirectional association properties";
+ leaf id {
+ type uint16;
+ description
+ "The TE tunnel association identifier.";
+ }
+ leaf source {
+ type inet:ip-address;
+ description
+ "The TE tunnel association source.";
+ }
+ leaf global-source {
+ type inet:ip-address;
+ description
+ "The TE tunnel association global
+ source.";
+ }
+ leaf type {
+ type identityref {
+ base te-types:bidir-association-type;
+ }
+ default te-types:bidir-assoc-non-corouted;
+ description
+ "The TE tunnel association type.";
+ }
+ leaf provisioing {
+ 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 p2p-secondary-path-properties {
+ description
+ "tunnel path properties.";
+ container config {
+ description
+ "Configuration parameters relating to
+ tunnel properties";
+ uses p2p-path-properties_config;
+ }
+ container state {
+ config false;
+ description
+ "State information associated with tunnel
+ properties";
+ uses p2p-path-properties_config;
+ uses p2p-secondary-path-properties_state;
+ }
+ }
+
+ grouping p2p-primary-path-properties {
+ description
+ "TE tunnel primary path properties grouping";
+ container config {
+ description
+ "Configuration parameters relating to
+ tunnel properties";
+ uses p2p-path-properties_config;
+ }
+ container state {
+ config false;
+ description
+ "State information associated with tunnel
+ properties";
+ uses p2p-path-properties_config;
+ uses p2p-primary-path-properties_state;
+ }
+ }
+
+ grouping p2p-primary-path-properties_state {
+ description "TE path state parameters";
+ container lsps {
+ description "TE LSPs container";
+ list lsp {
+ key
+ "source destination tunnel-id lsp-id "+
+ "extended-tunnel-id type";
+ description "List of LSPs associated with the tunnel.";
+
+ leaf source {
+ type leafref {
+ path "../../../../../../../../lsps-state/lsp/source";
+ }
+ description
+ "Tunnel sender address extracted from
+ SENDER_TEMPLATE object";
+ reference "RFC3209";
+ }
+ leaf destination {
+ type leafref {
+ path "../../../../../../../../lsps-state/lsp/destination";
+ }
+ description
+ "Tunnel endpoint address extracted from
+ SESSION object";
+ reference "RFC3209";
+ }
+ leaf tunnel-id {
+ type leafref {
+ path "../../../../../../../../lsps-state/lsp/tunnel-id";
+ }
+ description
+ "Tunnel identifier used in the SESSION
+ that remains constant over the life
+ of the tunnel.";
+ reference "RFC3209";
+ }
+ leaf lsp-id {
+ type leafref {
+ path "../../../../../../../../lsps-state/lsp/lsp-id";
+ }
+ 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 leafref {
+ path "../../../../../../../../lsps-state/lsp/" +
+ "extended-tunnel-id";
+ }
+ description
+ "Extended Tunnel ID of the LSP.";
+ reference "RFC3209";
+ }
+ leaf type {
+ type leafref {
+ path "../../../../../../../../lsps-state/lsp/type";
+ }
+ description "LSP type P2P or P2MP";
+ }
+ leaf signaling-type {
+ type identityref {
+ base te-types:path-signaling-type;
+ }
+ description "TE tunnel path signaling type";
+ }
+ }
+ }
+ }
+
+ grouping p2p-secondary-path-properties_state {
+ description "TE secondary path state parameters";
+ list lsp {
+ key "source";
+ description "List of LSPs associated with the tunnel.";
+
+ leaf source {
+ type leafref {
+ path "../../../../../../../../lsps-state/lsp/source";
+ }
+ description
+ "Tunnel sender address extracted from
+ SENDER_TEMPLATE object";
+ reference "RFC3209";
+ }
+ leaf destination {
+ type leafref {
+ path "../../../../../../../../lsps-state/lsp/destination";
+ }
+ description
+ "Tunnel endpoint address extracted from
+ SESSION object";
+ reference "RFC3209";
+ }
+ leaf tunnel-id {
+ type leafref {
+ path "../../../../../../../../lsps-state/lsp/tunnel-id";
+ }
+ description
+ "Tunnel identifier used in the SESSION
+ that remains constant over the life
+ of the tunnel.";
+ reference "RFC3209";
+ }
+ leaf lsp-id {
+ type leafref {
+ path "../../../../../../../../lsps-state/lsp/lsp-id";
+ }
+ 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 leafref {
+ path "../../../../../../../../lsps-state/lsp" +
+ "/extended-tunnel-id";
+ }
+ description
+ "Extended Tunnel ID of the LSP.";
+ reference "RFC3209";
+ }
+ leaf type {
+ type leafref {
+ path "../../../../../../../../lsps-state/lsp/type";
+ }
+ description "LSP type P2P or P2MP";
+ }
+ leaf active {
+ type boolean;
+ description
+ "Indicates the current active path option that has
+ been selected of the candidate secondary paths";
+ }
+ }
+ }
+
+ grouping p2p-path-properties_config {
+ description
+ "TE tunnel path properties configuration grouping";
+ leaf name {
+ type string;
+ description "TE path name";
+ }
+ leaf preference {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "Specifies a preference for this path. The lower the
+ number higher the preference";
+ }
+ leaf path-setup-protocol {
+ type identityref {
+ base te-types:te-path-setup-protocol;
+ }
+ 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 = '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-cspf {
+ when "../path-computation-method = 'path-locally-computed'";
+ type boolean;
+ description "A CSPF dynamically computed path";
+ }
+ leaf verbatim {
+ type empty;
+ description
+ "Indicates no topology or CSPF is attempted on the
+ specified path.";
+ }
+ leaf lockdown {
+ type empty;
+ description
+ "Indicates no reoptimization to be attempted for
+ this path.";
+ }
+ //TODO: added te-default-metric, te-delay-metric, te-srlgs, te-nsrlgs
+ 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 te-srlgs {
+ description
+ "Containing a list of SLRGs.";
+ leaf-list value {
+ type te-types:srlg;
+ description "SRLG value.";
+ reference
+ "RFC4202: Routing Extensions in Support of
+ Generalized Multi-Protocol Label Switching (GMPLS).";
+ }
+ }
+ container te-nsrlgs {
+ if-feature nsrlg;
+ description
+ "Containing a list of NSRLGs (Not Sharing Risk Link
+ Groups).
+ When an abstract TE link is configured, this list specifies
+ the request that underlay TE paths need to be mutually
+ disjoint with other TE links in the same groups.";
+ leaf-list id {
+ type uint32;
+ description
+ "NSRLG ID, uniquely configured within a topology.";
+ reference
+ "RFC4872: RSVP-TE Extensions in Support of End-to-End
+ Generalized Multi-Protocol Label Switching (GMPLS)
+ Recovery";
+ }
+ }
+ leaf named-explicit-path {
+ when "../path-computation-method = 'path-explicitly-defined'";
+ type leafref {
+ path "../../../../../../globals/named-explicit-paths/"
+ + "named-explicit-path/config/name";
+ }
+ description "The explicit-path name";
+ }
+ leaf named-path-constraint {
+ if-feature te-types:named-path-constraints;
+ type leafref {
+ path "../../../../../../globals/"
+ + "named-path-constraints/named-path-constraint/"
+ + "config/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 type {
+ type identityref {
+ base te-types:tunnel-type;
+ }
+ description "TE tunnel type.";
+ }
+ leaf identifier {
+ type uint16;
+ description
+ "TE tunnel Identifier.";
+ }
+ leaf description {
+ type string;
+ description
+ "Textual description for this TE tunnel";
+ }
+ 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 lsp-protection-type {
+ type identityref {
+ base te-types:lsp-prot-type;
+ }
+ description "LSP protection type.";
+ }
+ leaf admin-status {
+ type identityref {
+ base te-types:state-type;
+ }
+ default te-types:state-up;
+ description "TE tunnel administrative state.";
+ }
+ leaf reoptimize-timer {
+ type uint16;
+ units seconds;
+ description
+ "frequency of reoptimization of
+ a traffic engineered LSP";
+ }
+ }
+
+ grouping te-tunnel-bandwidth_config {
+ description
+ "Configuration parameters related to bandwidth for a tunnel";
+
+ leaf specification-type {
+ type te-mpls-types:te-bandwidth-type;
+ default SPECIFIED;
+ description
+ "The method used for settign the bandwidth, either explicitly
+ specified or configured";
+ }
+
+ leaf set-bandwidth {
+ when "../specification-type = 'te-mpls-types:SPECIFIED'" {
+ description
+ "The bandwidth value when bandwidth is explicitly
+ specified";
+ }
+ type te-mpls-types:bandwidth-kbps;
+ description
+ "set bandwidth explicitly, e.g., using
+ offline calculation";
+ }
+ leaf class-type {
+ type te-types:te-ds-class;
+ description
+ "The Class-Type of traffic transported by the LSP.";
+ reference "RFC4124: section-4.3.1";
+ }
+ }
+
+ grouping te-tunnel-bandwidth_state {
+ description
+ "Operational state parameters relating to bandwidth for a tunnel";
+
+ leaf signaled-bandwidth {
+ type te-mpls-types:bandwidth-kbps;
+ description
+ "The currently signaled bandwidth of the LSP. In the case where
+ the bandwidth is specified explicitly, then this will match the
+ value of the set-bandwidth leaf; in cases where the bandwidth is
+ dynamically computed by the system, the current value of the
+ bandwidth should be reflected.";
+ }
+ }
+
+ grouping te-lsp-auto-bandwidth_config {
+ description
+ "Configuration parameters related to autobandwidth";
+
+ leaf enabled {
+ type boolean;
+ default false;
+ description
+ "enables mpls auto-bandwidth on the
+ lsp";
+ }
+
+ leaf min-bw {
+ type te-mpls-types:bandwidth-kbps;
+ description
+ "set the minimum bandwidth in Kbps for an
+ auto-bandwidth LSP";
+ }
+
+ leaf max-bw {
+ type te-mpls-types:bandwidth-kbps;
+ description
+ "set the maximum bandwidth in Kbps for an
+ auto-bandwidth LSP";
+ }
+
+ leaf adjust-interval {
+ type uint32;
+ description
+ "time in seconds between adjustments to
+ LSP bandwidth";
+ }
+
+ leaf adjust-threshold {
+ type te-types:percentage;
+ description
+ "percentage difference between the LSP's
+ specified bandwidth and its current bandwidth
+ allocation -- if the difference is greater than the
+ specified percentage, auto-bandwidth adjustment is
+ triggered";
+ }
+ }
+
+ grouping te-lsp-overflow_config {
+ description
+ "configuration for mpls lsp bandwidth
+ overflow adjustment";
+
+ leaf enabled {
+ type boolean;
+ default false;
+ description
+ "enables mpls lsp bandwidth overflow
+ adjustment on the lsp";
+ }
+
+ leaf overflow-threshold {
+ type te-types:percentage;
+ description
+ "bandwidth percentage change to trigger
+ an overflow event";
+
+ }
+
+ leaf trigger-event-count {
+ type uint16;
+ description
+ "number of consecutive overflow sample
+ events needed to trigger an overflow adjustment";
+ }
+ }
+
+ grouping te-lsp-underflow_config {
+ description
+ "configuration for mpls lsp bandwidth
+ underflow adjustment";
+
+ leaf enabled {
+ type boolean;
+ default false;
+ description
+ "enables bandwidth underflow
+ adjustment on the lsp";
+ }
+
+ leaf underflow-threshold {
+ type te-types:percentage;
+ description
+ "bandwidth percentage change to trigger
+ and underflow event";
+ }
+
+ leaf trigger-event-count {
+ type uint16;
+ description
+ "number of consecutive underflow sample
+ events needed to trigger an underflow adjustment";
+ }
+ }
+
+ grouping te-path-bandwidth_top {
+ description
+ "Top level grouping for specifying bandwidth for a TE path";
+
+ container bandwidth {
+ description
+ "Bandwidth configuration for TE LSPs";
+
+ container config {
+ description
+ "Configuration parameters related to bandwidth on TE
+ tunnels:";
+ uses te-tunnel-bandwidth_config;
+ }
+
+ container state {
+ config false;
+ description
+ "State parameters related to bandwidth
+ configuration of TE tunnels";
+ uses te-tunnel-bandwidth_config;
+ uses te-tunnel-bandwidth_state;
+ }
+ }
+ }
+
+ grouping te-tunnel-bandwidth_top {
+ description
+ "Top level grouping for specifying bandwidth for a tunnel";
+
+ container bandwidth {
+ description
+ "Bandwidth configuration for TE LSPs";
+
+ container config {
+ description
+ "Configuration parameters related to bandwidth on TE
+ tunnels:";
+ uses te-tunnel-bandwidth_config;
+ }
+
+ container state {
+ config false;
+ description
+ "State parameters related to bandwidth
+ configuration of TE tunnels";
+ uses te-tunnel-bandwidth_config;
+ uses te-tunnel-bandwidth_state;
+ }
+
+ container auto-bandwidth {
+ when "../config/specification-type = 'AUTO'" {
+ description
+ "Include this container for auto bandwidth
+ specific configuration";
+ }
+ description
+ "Parameters related to auto-bandwidth";
+
+ container config {
+ description
+ "Configuration parameters relating to MPLS
+ auto-bandwidth on the tunnel.";
+ uses te-lsp-auto-bandwidth_config;
+ }
+ container state {
+ config false;
+ description
+ "State parameters relating to MPLS
+ auto-bandwidth on the tunnel.";
+ uses te-lsp-auto-bandwidth_config;
+ }
+
+ container overflow {
+ description
+ "configuration of MPLS overflow bandwidth
+ adjustement for the LSP";
+
+ container config {
+ description
+ "Config information for MPLS overflow bandwidth
+ adjustment";
+ uses te-lsp-overflow_config;
+ }
+
+ container state {
+ config false;
+ description
+ "Config information for MPLS overflow bandwidth
+ adjustment";
+ uses te-lsp-overflow_config;
+ }
+ }
+
+ container underflow {
+ description
+ "configuration of MPLS underflow bandwidth
+ adjustement for the LSP";
+
+ container config {
+ description
+ "Config information for MPLS underflow bandwidth
+ adjustment";
+ uses te-lsp-underflow_config;
+ }
+
+ container state {
+ config false;
+ description
+ "State information for MPLS underflo
+ adjustment";
+ uses te-lsp-underflow_config;
+ }
+ }
+ }
+ }
+ }
+
+ grouping tunnel-p2p-params_config {
+ description
+ "Configuration parameters relating to TE tunnel";
+ leaf name {
+ type string;
+ description "TE tunnel name.";
+ }
+ leaf type {
+ type identityref {
+ base te-types:tunnel-type;
+ }
+ description "TE tunnel type.";
+ }
+ leaf identifier {
+ type uint16;
+ description
+ "TE tunnel Identifier.";
+ }
+ leaf description {
+ type string;
+ description
+ "Textual description for this TE tunnel";
+ }
+ leaf switching-layer {
+ type identityref {
+ base te-types:switching-capabilities;
+ }
+ description
+ "Switching layer of this TE tunnel";
+ }
+ leaf encoding {
+ type identityref {
+ base te-types:lsp-encoding-types;
+ }
+ description "LSP encoding type";
+ }
+ leaf protection-type {
+ type identityref {
+ base te-types:lsp-prot-type;
+ }
+ description "LSP protection type.";
+ }
+ leaf admin-status {
+ type identityref {
+ base te-types:state-type;
+ }
+ default te-types: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";
+ }
+ /*****************************************************/
+ //TODO: HENRY added begin
+ 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.";
+ }
+
+ //TODO: HENRY added end
+ /*****************************************************/
+
+ leaf source {
+ type inet:ip-address;
+ description
+ "TE tunnel source address.";
+ }
+ leaf destination {
+ /* Add when check */
+ 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 {
+ /* Add when check */
+ type binary;
+ description
+ "TE tunnel destination termination point identifier.";
+ }
+ 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 signaling-type {
+ type identityref {
+ //TODO: FIXME
+ //base te-types:path-signaling-type;
+ base te-types:tunnel-type;
+
+ }
+ description "TE tunnel path signaling type";
+ }
+ container hierarchical-link-id {
+ description
+ "Identifies a hierarchical link (in server layer)
+ that this tunnel is associated with.";
+ 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";
+ }
+ 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.";
+ }
+ }
+ uses bidir-assoc-properties;
+ }
+
+ grouping tunnel-p2p-params_state {
+ description
+ "State parameters relating to TE tunnel";
+ leaf oper-status {
+ type identityref {
+ base te-types:state-type;
+ }
+ description "TE tunnel operational state.";
+ }
+ leaf prov-state {
+ type identityref {
+ base te-types:prov-state-type;
+ }
+ description "TE tunnel provisioning state.";
+ }
+ }
+
+ /* TE tunnel configuration/state grouping */
+ grouping tunnel-p2mp-properties {
+ description
+ "Top level grouping for P2MP tunnel properties.";
+ container config {
+ description
+ "Configuration parameters relating to
+ tunnel P2MP properties";
+ uses tunnel-p2mp-params_config;
+ }
+
+ container state {
+ config false;
+ description
+ "State information associated with tunnel
+ properties";
+ uses tunnel-p2mp-params_config;
+ }
+ }
+
+ 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/config/name";
+ }
+ description
+ "A reference to the secondary path that should be utilised
+ when the containing primary path option is in use";
+ }
+
+ leaf priority {
+ type uint16;
+ description
+ "The priority of the specified secondary path option. Higher
+ priority options are less preferable - such that a secondary
+ path reference with a priority of 0 is the most preferred";
+ }
+ leaf path-setup-protocol {
+ type identityref {
+ base te-types:te-path-setup-protocol;
+ }
+ 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.";
+ container config {
+ description
+ "Configuration parameters relating to
+ tunnel properties";
+ uses tunnel-p2p-params_config;
+ }
+ container state {
+ config false;
+ description
+ "State information associated with tunnel
+ properties";
+ uses tunnel-p2p-params_config;
+ uses tunnel-p2p-params_state;
+ }
+ uses te-tunnel-bandwidth_top;
+
+ 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.";
+ leaf name {
+ type leafref {
+ path "../config/name";
+ }
+ description "TE path name";
+ }
+ uses p2p-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.";
+ leaf secondary-path {
+ type leafref {
+ path "../config/secondary-path";
+ }
+ description "TE path name";
+ }
+ container config {
+ description
+ "Configuration parameters relating to the candidate
+ secondary path";
+
+ uses p2p-path-candidate-secondary-path-config;
+ }
+
+ container state {
+ config false;
+ description
+ "Operational state parameters relating to the candidate
+ secondary path";
+
+ uses p2p-path-candidate-secondary-path-config;
+ 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.";
+ leaf name {
+ type leafref {
+ path "../config/name";
+ }
+ description "TE path name";
+ }
+ uses p2p-primary-path-properties;
+ }
+ }
+ }
+
+ grouping tunnel-actions {
+ description "Tunnel actions";
+/***TODO: FIXME: 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****/
+ }
+ /*** 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";
+ leaf index {
+ type uint32;
+ description "RRO subobject index";
+ }
+ uses te-types:record-route-subobject;
+ }
+ }
+ }
+
+ grouping lsp-properties_state {
+ description
+ "State parameters relating to LSP";
+ leaf oper-status {
+ type identityref {
+ base te-types:state-type;
+ }
+ description "LSP operational state.";
+ }
+ leaf path-setup-protocol {
+ type identityref {
+ base te-types:te-path-setup-protocol;
+ }
+ 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";
+ }
+
+ 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-carry-normal-traffic {
+ type empty;
+ description
+ "This bit is set when a protecting LSP is carrying the normal
+ traffic after protection switching";
+ }
+ }
+ /*** 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";
+ leaf name {
+ type leafref {
+ path "../config/name";
+ }
+ description "Admin-group name";
+ }
+ container config {
+ description
+ "Configuration parameters related to admin-groups";
+ uses named-admin-groups_config;
+ }
+ container state {
+ config false;
+ description
+ "State parameters related to 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";
+ leaf name {
+ type leafref {
+ path "../config/name";
+ }
+ description "SRLG name";
+ }
+ container config {
+ description
+ "Configuration parameters related to named SRLGs";
+ uses named-srlgs_config;
+ }
+ container state {
+ config false;
+ description
+ "State parameters related to named SRLGs";
+ uses named-srlgs_config;
+ }
+ }
+ }
+ }
+
+ /* Global named explicit-paths configuration data */
+ grouping named-explicit-paths_config {
+ description
+ "Global explicit path configuration
+ grouping";
+ leaf name {
+ type string;
+ description
+ "A string name that uniquely identifies an
+ explicit path";
+ }
+ container explicit-route-objects {
+ description "Explicit route objects container";
+ list explicit-route-object {
+ key "index";
+ description
+ "List of explicit route objects";
+ leaf index {
+ type leafref {
+ path "../config/index";
+ }
+ description
+ "Index of this explicit route object";
+ }
+ leaf explicit-route-usage {
+ type identityref {
+ base te-types:route-usage-type;
+ }
+ description "An explicit-route hop action.";
+ }
+ uses te-types:explicit-route-hop;
+ }
+ }
+ }
+
+ grouping named-explicit-paths {
+ description
+ "Global explicit path configuration
+ grouping";
+ container named-explicit-paths {
+ description "TE named explicit path container";
+ list named-explicit-path {
+ key "name";
+ description
+ "A list of explicit paths";
+ leaf name {
+ type leafref {
+ path "../config/name";
+ }
+ description "Explicit-path name";
+ }
+
+ container config {
+ description
+ "Configuration parameters related to named paths";
+ uses named-explicit-paths_config;
+ }
+ container state {
+ config false;
+ description
+ "State parameters related to named paths";
+ uses named-explicit-paths_config;
+ }
+ }
+ }
+ }
+
+ /* Global named paths constraints configuration data */
+ grouping named-path-constraints_config {
+ description
+ "Global named path constraints configuration
+ grouping";
+ leaf name {
+ type string;
+ description
+ "A string name that uniquely identifies a
+ path constraint set";
+ }
+ leaf topology-id {
+ type te-types:te-topology-id;
+ description
+ "The tunnel path is computed using the specific
+ topology identified by this identifier";
+ }
+ leaf cost-limit {
+ type uint32 {
+ range "1..4294967295";
+ }
+ description
+ "The tunnel path cost limit.";
+ }
+ leaf hop-limit {
+ type uint8 {
+ range "1..255";
+ }
+ description
+ "The tunnel path hop limit.";
+ }
+ leaf metric-type {
+ type identityref {
+ base te-types:path-metric-type;
+ }
+ default te-types:path-metric-te;
+ description
+ "The tunnel path metric type.";
+ }
+ leaf tiebreaker-type {
+ type identityref {
+ base te-types:path-tiebreaker-type;
+ }
+ default te-types:path-tiebreaker-maxfill;
+ description
+ "The tunnel path computation tie breakers.";
+ }
+ leaf ignore-overload {
+ type boolean;
+ description
+ "The tunnel path can traverse overloaded node.";
+ }
+ 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";
+ }
+ uses path-affinities;
+ uses path-srlgs;
+ uses path-route-objects;
+ uses te-path-bandwidth_top;
+ }
+
+ 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";
+ description
+ "A list of named path constraints";
+ leaf name {
+ type leafref {
+ path "../config/name";
+ }
+ description "Path constraint name";
+ }
+ container config {
+ description
+ "Configuration parameters related to admin-groups";
+ uses named-path-constraints_config;
+ }
+ container state {
+ config false;
+ description
+ "State parameters related to admin-groups";
+ uses named-path-constraints_config;
+ }
+ }
+ }
+ }
+
+ /* 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-explicit-paths;
+ 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";
+ unique "identifier";
+ description "P2P TE tunnels list.";
+ leaf name {
+ type leafref {
+ path "../config/name";
+ }
+ description "TE tunnel name.";
+ }
+ leaf identifier {
+ type leafref {
+ path "../config/identifier";
+ }
+ description
+ "TE tunnel Identifier.";
+ }
+
+
+ uses tunnel-p2p-properties;
+ uses tunnel-actions;
+ }
+ list tunnel-p2mp {
+ key "name";
+ unique "identifier";
+ description "P2MP TE tunnels list.";
+ leaf name {
+ type leafref {
+ path "../config/name";
+ }
+ description "TE tunnel name.";
+ }
+ leaf identifier {
+ type leafref {
+ path "../config/identifier";
+ }
+ description
+ "TE tunnel Identifier.";
+ }
+ uses tunnel-p2mp-properties;
+ }
+ }
+ }
+
+ /* TE LSPs ephemeral state container data */
+ grouping lsps-state-grouping {
+ description
+ "LSPs state operational data grouping";
+ container lsps-state {
+ config "false";
+ description "LSPs operational state data.";
+
+ list lsp {
+ key
+ "source destination tunnel-id lsp-id "+
+ "extended-tunnel-id type";
+ description
+ "List of LSPs associated with the tunnel.";
+ 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 type {
+ type identityref {
+ base te-types:tunnel-type;
+ }
+ description "The LSP type P2P or P2MP";
+ }
+
+ uses lsp-properties_state;
+ uses lsp-record-route-information_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";
+ }
+ }
+ }
+ }
+
+/**************************************************************/
+//TODO: FIXME: HENRY added begins
+
+ grouping te-optimization-criterion {
+ description
+ "";
+ container optimization-criterion {
+ description "Optimization criterion.";
+ list metric {
+ key "name";
+ description
+ "Name of the numerical property";
+
+ leaf name {
+ type identityref {
+ base te-types:te-path-numerical-property;
+ }
+ description "";
+ }
+ leaf goal {
+ type enumeration {
+ enum minimize {
+ description "Minimize";
+ }
+ enum maxmize {
+ description "Maxmize";
+ }
+ }
+ description "";
+ }
+ leaf weight {
+ type uint8;
+ description "";
+ }
+ }
+ list tiebreaker {
+ key "metric";
+ description
+ "A list of numerical properties used as tiebreakers.
+ The order of a property in the list is the precedence
+ of tiebreaking.";
+
+ leaf metric {
+ type identityref {
+ base te-types:te-path-numerical-property;
+ }
+ description "";
+ }
+ leaf tiebreaker-type {
+ type identityref {
+ base te-types:path-tiebreaker-type;
+ }
+ default te-types:path-tiebreaker-minfill;
+ description
+ "The tunnel path computation tie breakers.";
+ }
+ }
+ }
+ }
+
+ grouping te-path-constraints {
+ description
+ "TE path constraints configuration grouping";
+
+ container path-constraints {
+ description "Path constraints.";
+ list metric {
+ key "name";
+ description "";
+
+ leaf name {
+ type identityref {
+ base te-types:te-path-numerical-property;
+ }
+ description
+ "Name of the numerical property";
+ }
+ leaf low-limit {
+ type uint64;
+ description
+ "";
+ }
+ leaf high-limit {
+ type uint64;
+ description
+ "";
+ }
+ }
+ leaf bandwidth-generic {
+ type te-types:te-bandwidth;
+ description
+ "A technology agnostic requested bandwidth to use
+ for path computation";
+ }
+ leaf setup-priority {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "TE LSP requested setup priority";
+ }
+ leaf hold-priority {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "TE LSP requested hold priority";
+ }
+ leaf ignore-overload {
+ type boolean;
+ description
+ "The tunnel path can traverse overloaded node.";
+ }
+ uses path-affinities;
+ uses path-srlgs;
+ }
+ }
+
+ grouping te-path-properties {
+ description
+ "";
+
+ container path-properties {
+ description "";
+ list metric {
+ key "name";
+ description "";
+
+ leaf name {
+ type identityref {
+ base te-types:te-path-numerical-property;
+ }
+ description "";
+ }
+ leaf value {
+ type uint64;
+ description "";
+ }
+ }
+ leaf bandwidth-generic {
+ type te-types:te-bandwidth;
+ description
+ "A technology agnostic requested bandwidth to use
+ for path computation";
+ }
+ leaf setup-priority {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "TE LSP requested setup priority";
+ }
+ leaf hold-priority {
+ type uint8 {
+ range "0..7";
+ }
+ description
+ "TE LSP requested hold priority";
+ }
+ leaf ignore-overload {
+ type boolean;
+ description
+ "The tunnel path can traverse overloaded node.";
+ }
+ uses path-affinities;
+ uses path-srlgs;
+ }
+ }
+
+ rpc te-tunnel-path-compute {
+ description "TE tunnel path computation ";
+ input {
+ leaf inter-request-diversity {
+ type te-types:te-path-disjointness;
+ description
+ "Diversity requirement between requests.
+ If not specified, requests are computed independently.";
+ }
+ uses te-optimization-criterion;
+
+ list request {
+ key "id";
+ description "A list of request items.";
+
+ leaf id {
+ type uint8;
+ description
+ "Request ID.";
+ }
+
+ leaf source {
+ type te-types:te-node-id;
+ description
+ "TE tunnel source address.";
+ }
+ leaf destination {
+ type te-types:te-node-id;
+ 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.";
+ }
+ 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";
+ }
+
+ uses te-path-constraints;
+
+ container explicit-route-objects {
+ description "";
+ }
+ }
+ }
+ output {
+ leaf return-code {
+ type enumeration {
+ enum success {
+ description "success";
+ }
+ enum aborted {
+ description "";
+ }
+ enum destination-not-found {
+ description "";
+ }
+ enum invalid-argument {
+ description "";
+ }
+ enum no-memory {
+ description "";
+ }
+ enum no-path-found{
+ description "";
+ }
+ enum other-error {
+ description "";
+ }
+ enum some-path-not-found{
+ description "";
+ }
+ enum source-not-found {
+ description "";
+ }
+ enum topology-error {
+ description "";
+ }
+ }
+ description
+ "Return code.";
+ }
+ list result {
+ key "id";
+ description
+ "A list of results for all requests.";
+
+ leaf id {
+ type uint8;
+ description
+ "Request ID.";
+ }
+
+ uses te-path-properties;
+
+ container explicit-route-objects {
+ description "";
+ }
+ }
+ }
+ }
+
+//TODO: FIXME: HENRY added finish
+/**************************************************************/
+
+ /* 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/runtime/src/test/resources/schemaProviderTestYangFiles/yrt-ietf-te-mpls-types@2017-03-10.yang b/runtime/src/test/resources/schemaProviderTestYangFiles/yrt-ietf-te-mpls-types@2017-03-10.yang
new file mode 100644
index 0000000..ff03438
--- /dev/null
+++ b/runtime/src/test/resources/schemaProviderTestYangFiles/yrt-ietf-te-mpls-types@2017-03-10.yang
@@ -0,0 +1,132 @@
+module yrt-ietf-te-mpls-types {
+
+ namespace "urn:ietf:params:xml:ns:yang:yrt-ietf-te-mpls-types";
+
+ /* Replace with IANA when assigned */
+ prefix "te-mpls-types";
+
+ organization
+ "IETF TEAS Working Group";
+
+ contact "Fill me";
+
+ description
+ "This module contains a collection of generally
+ useful TE specific YANG data type defintions.";
+
+ revision "2017-03-10" {
+ description "Latest revision of TE MPLS types";
+ reference "RFC3209";
+ }
+
+ identity backup-protection-type {
+ description
+ "Base identity for backup protection type";
+ }
+
+ identity backup-protection-link {
+ base backup-protection-type;
+ description
+ "backup provides link protection only";
+ }
+
+ identity backup-protection-node-link {
+ base backup-protection-type;
+ description
+ "backup offers node (preferred) or link protection";
+ }
+
+ identity bc-model-type {
+ description
+ "Base identity for Diffserv-TE bandwidth constraint
+ model type";
+ }
+
+ identity bc-model-rdm {
+ base bc-model-type;
+ description
+ "Russian Doll bandwidth constraint model type.";
+ }
+
+ identity bc-model-mam {
+ base bc-model-type;
+ description
+ "Maximum Allocation bandwidth constraint
+ model type.";
+ }
+
+ identity bc-model-mar {
+ base bc-model-type;
+ description
+ "Maximum Allocation with Reservation
+ bandwidth constraint model type.";
+ }
+
+ typedef bandwidth-kbps {
+ type uint64;
+ units "Kbps";
+ description
+ "Bandwidth values expressed in kilobits per second";
+ }
+
+ typedef bandwidth-mbps {
+ type uint64;
+ units "Mbps";
+ description
+ "Bandwidth values expressed in megabits per second";
+ }
+
+ typedef bandwidth-gbps {
+ type uint64;
+ units "Gbps";
+ description
+ "Bandwidth values expressed in gigabits per second";
+ }
+
+ typedef te-bandwidth-type {
+ type enumeration {
+ enum SPECIFIED {
+ description
+ "Bandwidth is explicitly specified";
+ }
+ enum AUTO {
+ description
+ "Bandwidth is automatically computed";
+ }
+ }
+ description
+ "enumerated type for specifying whether bandwidth is
+ explicitly specified or automatically computed";
+ }
+
+ typedef bfd-type {
+ type enumeration {
+ enum classical {
+ description "BFD classical session type.";
+ }
+ enum seamless {
+ description "BFD seamless session type.";
+ }
+ }
+ default "classical";
+ description
+ "Type of BFD session";
+ }
+
+ typedef bfd-encap-mode-type {
+ type enumeration {
+ enum gal {
+ description
+ "BFD with GAL mode";
+ }
+ enum ip {
+ description
+ "BFD with IP mode";
+ }
+ }
+ default ip;
+ description
+ "Possible BFD transport modes when running over TE
+ LSPs.";
+ }
+ }
\ No newline at end of file