CCAMP Working Group                                             H. Zheng
Internet-Draft                                                    A. Guo
Intended status: Standards Track                                 I. Busi
Expires: August 29, 2019 January 9, 2020                             Huawei Technologies
                                                               A. Sharma
                                                                  Google
                                                                  R. Rao
                                                                Infinera
                                                              S. Belotti
                                                                   Nokia
                                                                V. Lopez
                                                              Telefonica
                                                                   Y. Li
                                                            China Mobile
                                                                   Y. Xu
                                                                   CAICT
                                                       February 25,
                                                           July 08, 2019

                         OTN Tunnel YANG Model
                  draft-ietf-ccamp-otn-tunnel-model-06
                  draft-ietf-ccamp-otn-tunnel-model-07

Abstract

   This document describes the YANG data model for OTN Tunnels.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on August 29, 2019. January 9, 2020.

Copyright Notice

   Copyright (c) 2019 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   2
   2.  Terminology and Notations . . . . . . . . . . . . . . . . . .   2
   3.  OTN Tunnel Model Description  . . . . . . . . . . . . . . . .   3
     3.1.  Overview of OTN Tunnel Model  . . . . . . . . . . . . . .   3
     3.2.  OTN-specific Parameters in Tunnel Model . . . . . . . . .   3
     3.3.  OTN Path Compute RPC  . . . . . . . . . . . . . . . . . .   4
   4.  OTN Tunnel YANG Tree  . . . . . . . . . . . . . . . . . . . .   4
   5.  OTN Tunnel YANG Code  . . . . . . . . . . . . . . . . . . . .  21  14
   6.  OTN Types YANG Code . . . . . . . . . . . . . . . . . . . . .  48
   7.  Security Considerations . . . . . . . . . . . . . . . . . . .  58
   8.  35
   7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  59
   9.  36
   8.  Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .  60
   10.  37
   9.  Contributors  . . . . . . . . . . . . . . . . . . . . . . . .  60
   11.  37
   10. References  . . . . . . . . . . . . . . . . . . . . . . . . .  60
     11.1.  37
     10.1.  Normative References . . . . . . . . . . . . . . . . . .  60
     11.2.  37
     10.2.  Informative References . . . . . . . . . . . . . . . . .  62  38
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  62  39

1.  Introduction

   OTN transport networks, specified in [ITU-T], can carry various types
   of client services.  In many cases, the client signal is carried over
   an OTN tunnel across connected domains in a multi-domain network.
   These OTN services can either be transported or switched in the OTN
   network.  If an OTN tunnel is switched, then additional parameters
   need to be provided to create a Mux OTN service.

   This document provides YANG model for creating OTN tunnel.  The model
   augments the TE Tunnel model.

2.  Terminology and Notations

   A simplified graphical representation of the data model is used in
   this document.  The meaning of the symbols in the YANG data tree
   presented later in this draft is defined in [RFC8340].  They are
   provided below for reference.

   o  Brackets "[" and "]" enclose list keys.

   o  Abbreviations before data node names: "rw" means configuration
      (read-write) and "ro" state data (read-only).

   o  Symbols after data node names: "?" means an optional node, "!"
      means a presence container, and "*" denotes a list and leaf-list.

   o  Parentheses enclose choice and case nodes, and case nodes are also
      marked with a colon (":").

   o  Ellipsis ("...") stands for contents of subtrees that are not
      shown.

   o  More OTN specific terms can be found in
      [I-D.ietf-ccamp-otn-topo-yang].

3.  OTN Tunnel Model Description

3.1.  Overview of OTN Tunnel Model

   The OTN tunnel model is using TE tunnel [I-D.ietf-teas-yang-te] as a
   basic model and augment to the TE tunnel with OTN-specific
   parameters, including the bandwidth information and label
   information.  It is also worth noting that the OTN tunnel
   provisioning is usually based on the OTN topology.  Therefore the OTN
   tunnel model is usually used together with OTN topology model
   specified in [I-D.ietf-ccamp-otn-topo-yang].  The OTN tunnel model
   also imports a few type modules, including ietf-otn-types, ietf-te-
   types and ietf-inet-types.

   More scenarios and model applications can be found in
   [I-D.ietf-ccamp-transport-nbi-app-statement] and
   [I-D.ietf-teas-actn-yang].  The current model is following the YANG
   language specification as [RFC7950], and the corresponding protocol
   is recommended to be Netconf protocol in [RFC6241] or RESTconf
   protocol in [RFC8040].

   The YANG module ietf-otn-tunnel defined in this document conforms to
   the Network Management Datastore Architecture (NMDA) defined in
   [RFC8342].

3.2.  OTN-specific Parameters in Tunnel Model

   OTN specific parameters have been augmenting to the TE tunnel models.
   The attributes on both of the source and destination need to be
   configured when setting up the tunnel.  Typical parameters, including
   client signal, TPN, TSG and corresponding tributary slot information,
   are required in the OTN tunnel model.  These parameters are
   consistent with the framework in [RFC7062], and the specification in
   [RFC7138] and [RFC7139].

   The OTN bandwidth information has been augmenting to various sections
   of TE tunnel models, including tunnel bandwidth, primary path
   bandwidth and so on.  The OTN label information has been augmenting
   to label hop of a group of routing objects and also LSPs.

3.3.  OTN Path Compute RPC

   Similarly with TE tunnel, a 'compute-only' mode of OTN tunnel model
   is also supported for stateful path computation.  Given the OTN
   tunnel computed, the client may query and/or subscribe on the tunnel
   to be notified whenever it changes.  In addition, also a stateless
   Remote Procedural Call (RPC) is specified.  On receiving this RPC,
   the provider is expected to compute the available path subject to the
   constraints specified in RPC and feedback to the client without any
   changing of the OTN network or the OTN tunnels.

4.  OTN Tunnel YANG Tree

module: ietf-otn-tunnel
  augment /te:te/te:tunnels/te:tunnel:
    +--rw src-client-signal?   identityref
    +--rw dst-client-signal?   identityref
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:te-bandwidth/te:technology:
    +--:(otn)
       +--rw odu-type?   identityref
  augment /te:te/te:tunnels/te:tunnel/te:te-bandwidth/te:technology:
    +--:(otn)
       +--rw odu-type?   identityref
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:te-bandwidth/te:technology:
    +--:(otn)
       +--rw odu-type?   identityref
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:te-bandwidth/te:technology:
    +--:(otn)
       +--rw odu-type?   identityref
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:te-bandwidth/te:technology:
    +--:(otn)
       +--rw odu-type?   identityref
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:explicit-route-objects
          /te:named-path-constraint/te:explicit-route-objects-always
                  /te:route-object-exclude-always/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:explicit-route-objects
          /te:named-path-constraint/te:explicit-route-objects-always
                  /te:route-object-include-exclude/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-in-segment
          /te:forward/te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-in-segment/te:forward
          /te:label-restrictions/te:label-restriction/te:label-start
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-in-segment/te:forward
          /te:label-restrictions/te:label-restriction/te:label-end
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-in-segment/te:reverse
          /te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8

  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-in-segment/te:reverse
          /te:label-restrictions/te:label-restriction/te:label-start
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-in-segment/te:reverse
          /te:label-restrictions/te:label-restriction/te:label-end
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-out-segment/te:forward
                  /te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-out-segment/te:forward
          /te:label-restrictions/te:label-restriction/te:label-start
          /te:te-label/te:technology:
          /te:named-path-constraint/te:path-in-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-start/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-out-segment/te:forward
          /te:label-restrictions/te:label-restriction/te:label-end
          /te:te-label/te:technology:
          /te:named-path-constraint/te:path-in-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-end/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-out-segment/te:reverse
          /te:named-path-constraint/te:path-out-segment
                  /te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-out-segment/te:reverse
          /te:label-restrictions/te:label-restriction/te:label-start
          /te:te-label/te:technology:
          /te:named-path-constraint/te:path-out-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-start/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:globals/te:named-path-constraints
          /te:named-path-constraint/te:path-out-segment/te:reverse
          /te:label-restrictions/te:label-restriction/te:label-end
          /te:te-label/te:technology:
          /te:named-path-constraint/te:path-out-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-end/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:optimizations/te:algorithm/te:metric
          /te:optimization-metric/te:explicit-route-exclude-objects
          /te:p2p-primary-path/te:optimizations/te:algorithm
                  /te:metric/te:optimization-metric
                  /te:explicit-route-exclude-objects
                  /te:route-object-exclude-object/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:optimizations/te:algorithm/te:metric
          /te:optimization-metric/te:explicit-route-include-objects
          /te:route-object-include-object/te:type/te:label/te:label-hop
          /te:te-label/te:technology:
          /te:p2p-primary-path/te:optimizations/te:algorithm
                  /te:metric/te:optimization-metric
                  /te:explicit-route-include-objects
                  /te:route-object-include-object/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:explicit-route-objects
          /te:p2p-primary-path/te:explicit-route-objects-always
                  /te:route-object-exclude-always/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:explicit-route-objects
          /te:p2p-primary-path/te:explicit-route-objects-always
                  /te:route-object-include-exclude/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-in-segment/te:forward
          /te:p2p-primary-path/te:path-in-segment
                  /te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-in-segment/te:forward
          /te:p2p-primary-path/te:path-in-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-start/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-in-segment/te:forward
          /te:p2p-primary-path/te:path-in-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-end/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-in-segment/te:reverse
          /te:p2p-primary-path/te:path-out-segment
                  /te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-in-segment/te:reverse
          /te:p2p-primary-path/te:path-out-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-start/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-in-segment/te:reverse
          /te:label-restrictions/te:label-restriction/te:label-end
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-out-segment/te:forward
          /te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-out-segment/te:forward
          /te:label-restrictions/te:label-restriction/te:label-start
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-out-segment/te:forward
          /te:label-restrictions/te:label-restriction/te:label-end
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-out-segment/te:reverse
          /te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-out-segment/te:reverse
          /te:label-restrictions/te:label-restriction/te:label-start
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:path-out-segment/te:reverse
          /te:label-restrictions/te:label-restriction/te:label-end
          /te:te-label/te:technology:
          /te:p2p-primary-path/te:path-out-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-end/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:state/te:path-properties
          /te:p2p-primary-path/te:computed-paths-properties
                  /te:computed-path-properties/te:path-properties
                  /te:path-route-objects/te:path-computed-route-object
          /te:state/te:type/te:label/te:label-hop/te:te-label
                  /te:type/te:label/te:label-hop/te:te-label
                  /te:technology:
    +--:(otn)
       +--ro tpn?       uint16
       +--ro tsg?       identityref
       +--ro ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:state/te:lsps/te:lsp
          /te:lsp-record-route-subobjects/te:record-route-subobject
          /te:type/te:label/te:label-hop/te:te-label/te:technology:
          /te:p2p-primary-path/te:lsps/te:lsp
                  /te:lsp-record-route-information
                  /te:lsp-record-route-information/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--ro tpn?       uint16
       +--ro tsg?       identityref
       +--ro ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:state/te:lsps/te:lsp
          /te:path-properties/te:path-route-objects
          /te:path-computed-route-object/te:state/te:type/te:label
          /te:label-hop/te:te-label/te:technology:
          /te:p2p-primary-path/te:lsps/te:lsp/te:path-properties
                  /te:path-route-objects/te:path-computed-route-object
                  /te:type/te:label/te:label-hop/te:te-label
                  /te:technology:
    +--:(otn)
       +--ro tpn?       uint16
       +--ro tsg?       identityref
       +--ro ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:optimizations/te:algorithm/te:metric
          /te:optimization-metric/te:explicit-route-exclude-objects
                  /te:optimization-metric
                  /te:explicit-route-exclude-objects
                  /te:route-object-exclude-object/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:optimizations/te:algorithm/te:metric
          /te:optimization-metric/te:explicit-route-include-objects
                  /te:optimization-metric
                  /te:explicit-route-include-objects
                  /te:route-object-include-object/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:explicit-route-objects/te:route-object-exclude-always
          /te:type/te:label/te:label-hop/te:te-label/te:technology:
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:explicit-route-objects-always
                  /te:route-object-exclude-always/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:explicit-route-objects/te:route-object-include-exclude
          /te:type/te:label/te:label-hop/te:te-label/te:technology:
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:explicit-route-objects-always
                  /te:route-object-include-exclude/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-in-segment/te:forward/te:label-restrictions
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:path-in-segment/te:label-restrictions
                  /te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-in-segment/te:forward/te:label-restrictions
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:path-in-segment/te:label-restrictions
                  /te:label-restriction/te:label-start/te:te-label
                  /te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-in-segment/te:forward/te:label-restrictions
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:path-in-segment/te:label-restrictions
                  /te:label-restriction/te:label-end/te:te-label
                  /te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-in-segment/te:reverse/te:label-restrictions
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:path-out-segment/te:label-restrictions
                  /te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-in-segment/te:reverse/te:label-restrictions
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:path-out-segment/te:label-restrictions
                  /te:label-restriction/te:label-start/te:te-label
                  /te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-in-segment/te:reverse/te:label-restrictions
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:path-out-segment/te:label-restrictions
                  /te:label-restriction/te:label-end/te:te-label
                  /te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-out-segment/te:forward/te:label-restrictions
          /te:label-restriction:
    +--rw range-type?   identityref
    +--rw
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:computed-paths-properties
                  /te:computed-path-properties
                  /te:path-properties/te:path-route-objects
                  /te:path-computed-route-object/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:

    +--:(otn)
       +--ro tpn?       uint16
       +--ro tsg?       identityref
    +--rw priority?     uint8
       +--ro ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-out-segment/te:forward/te:label-restrictions
          /te:label-restriction/te:label-start/te:te-label
          /te:technology:
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:lsps/te:lsp/te:lsp-record-route-information
                  /te:lsp-record-route-information/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-out-segment/te:forward/te:label-restrictions
          /te:label-restriction/te:label-end/te:te-label
          /te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-out-segment/te:reverse/te:label-restrictions
          /te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-out-segment/te:reverse/te:label-restrictions
          /te:label-restriction/te:label-start/te:te-label
          /te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:path-out-segment/te:reverse/te:label-restrictions
          /te:label-restriction/te:label-end/te:te-label
          /te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:state/te:path-properties/te:path-route-objects
          /te:path-computed-route-object/te:state/te:type
          /te:label/te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--ro tpn?       uint16
       +--ro tsg?       identityref
       +--ro ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:state/te:lsps/te:lsp/te:lsp-record-route-subobjects
          /te:record-route-subobject/te:type/te:label/te:label-hop
          /te:te-label/te:technology:
    +--:(otn)
       +--ro
       +--ro tpn?       uint16
       +--ro tsg?       identityref
       +--ro ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-primary-paths
          /te:p2p-primary-path/te:p2p-reverse-primary-path
          /te:state/te:lsps/te:lsp/te:path-properties
          /te:path-route-objects/te:path-computed-route-object
          /te:state/te:type/te:label/te:label-hop/te:te-label
          /te:technology:
          /te:p2p-primary-path/te:p2p-primary-reverse-path
                  /te:lsps/te:lsp/te:path-properties/te:path-route-objects
                  /te:path-computed-route-object/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--ro tpn?       uint16
       +--ro tsg?       identityref
       +--ro ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:optimizations/te:algorithm
                  /te:metric/te:optimization-metric
                  /te:explicit-route-exclude-objects
                  /te:route-object-exclude-object/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:optimizations/te:algorithm
                  /te:metric/te:optimization-metric
                  /te:explicit-route-include-objects
                  /te:route-object-include-object/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:explicit-route-objects
          /te:p2p-secondary-path/te:explicit-route-objects-always
                  /te:route-object-exclude-always/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:explicit-route-objects
          /te:p2p-secondary-path/te:explicit-route-objects-always
                  /te:route-object-include-exclude/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--rw tpn?       uint16
       +--rw tsg?       identityref
       +--rw ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-in-segment/te:forward
          /te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-in-segment/te:forward
          /te:label-restrictions/te:label-restriction/te:label-start
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-in-segment/te:forward
          /te:label-restrictions/te:label-restriction/te:label-end
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-in-segment/te:reverse
          /te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-in-segment/te:reverse
          /te:label-restrictions/te:label-restriction/te:label-start
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-in-segment/te:reverse
          /te:label-restrictions/te:label-restriction/te:label-end
          /te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-out-segment/te:forward
          /te:p2p-secondary-path/te:path-in-segment
                  /te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-out-segment/te:forward
          /te:label-restrictions/te:label-restriction/te:label-start
          /te:te-label/te:technology:
          /te:p2p-secondary-path/te:path-in-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-start/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-out-segment/te:forward
          /te:label-restrictions/te:label-restriction/te:label-end
          /te:te-label/te:technology:
          /te:p2p-secondary-path/te:path-in-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-end/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-out-segment/te:reverse
          /te:p2p-secondary-path/te:path-out-segment
                  /te:label-restrictions/te:label-restriction:
    +--rw range-type?   identityref
    +--rw tsg?          identityref
    +--rw priority?     uint8
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-out-segment/te:reverse
          /te:label-restrictions/te:label-restriction/te:label-start
          /te:te-label/te:technology:
          /te:p2p-secondary-path/te:path-out-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-start/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:path-out-segment/te:reverse
          /te:label-restrictions/te:label-restriction/te:label-end
          /te:te-label/te:technology:
          /te:p2p-secondary-path/te:path-out-segment
                  /te:label-restrictions/te:label-restriction
                  /te:label-end/te:te-label/te:technology:
    +--:(otn)
       +--rw (otn-label-type)?
          +--:(tributary-port)
          |  +--rw tpn?   uint16
          +--:(tributary-slot)
             +--rw ts?    uint16
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:state/te:path-properties
          /te:p2p-secondary-path/te:computed-paths-properties
                  /te:computed-path-properties/te:path-properties
                  /te:path-route-objects/te:path-computed-route-object
          /te:state/te:type/te:label/te:label-hop/te:te-label
          /te:technology:
                  /te:type/te:label/te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--ro tpn?       uint16
       +--ro tsg?       identityref
       +--ro ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:state/te:lsps/te:lsp
          /te:lsp-record-route-subobjects/te:record-route-subobject
          /te:type/te:label/te:label-hop/te:te-label/te:technology:
          /te:p2p-secondary-path/te:lsps/te:lsp
                  /te:lsp-record-route-information
                  /te:lsp-record-route-information/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--ro tpn?       uint16
       +--ro tsg?       identityref
       +--ro ts-list?   string
  augment /te:te/te:tunnels/te:tunnel/te:p2p-secondary-paths
          /te:p2p-secondary-path/te:state/te:lsps/te:lsp
          /te:path-properties/te:path-route-objects
          /te:path-computed-route-object/te:state/te:type/te:label
          /te:label-hop/te:te-label/te:technology:
          /te:p2p-secondary-path/te:lsps/te:lsp/te:path-properties
                  /te:path-route-objects/te:path-computed-route-object
                  /te:type/te:label/te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--ro tpn?       uint16
       +--ro tsg?       identityref
       +--ro ts-list?   string
  augment /te:te/te:lsps-state/te:lsp
          /te:lsp-record-route-subobjects/te:record-route-subobject
          /te:type/te:label/te:label-hop/te:te-label/te:technology:
          /te:lsp-record-route-information
                  /te:lsp-record-route-information/te:type/te:label
                  /te:label-hop/te:te-label/te:technology:
    +--:(otn)
       +--ro tpn?       uint16
       +--ro tsg?       identityref
       +--ro ts-list?   string

  rpcs:
    +---x otn-te-tunnel-path-compute
       +---w input
       |  +---w request* [id]
       |     +---w id                     uint8
       |     +---w type?                  identityref
       |     +---w source?                inet:ip-address
       |     +---w destination?           inet:ip-address
       |     +---w src-tp-id?             binary
       |     +---w dst-tp-id?             binary
       |     +---w switching-layer?       identityref
       |     +---w encoding?              identityref
       |     +---w protection-type?       identityref
       |     +---w restoration-type?      identityref
       |     +---w provider-id?           te-types:te-global-id
       |     +---w client-id?             te-types:te-global-id
       |     +---w te-topology-id?        te-types:te-topology-id
       |     +---w setup-priority?        uint8
       |     +---w hold-priority?         uint8
       |     +---w te-path-metric-type?   identityref
       |     +---w odu-type?              identityref
       |     +---w p2p-primary-paths
       |     |  +---w p2p-primary-path* [name]
       |     |     +---w name                      string
       |     |     +---w te-default-metric?        uint32
       |     |     +---w te-delay-metric?          uint32
       |     |     +---w te-hop-metric?            uint32
       |     |     +---w explicit-route-objects
       |     |        +---w explicit-route-object* [index]
       |     |           +---w explicit-route-usage?   identityref
       |     |           +---w index                   uint32
       |     |           +---w (type)?
       |     |              +--:(num-unnum-hop)
       |     |              |  +---w num-unnum-hop
       |     |              |     +---w node-id?      te-types:te-node-id
       |     |              |     +---w link-tp-id?   te-types:te-tp-id
       |     |              |     +---w hop-type?     te-hop-type
       |     |              |     +---w direction?    te-link-direction
       |     |              +--:(as-number)
       |     |              |  +---w as-number-hop
       |     |              |     +---w as-number?   binary
       |     |              |     +---w hop-type?    te-hop-type
       |     |              +--:(label)
       |     |                 +---w label-hop
       |     |                    +---w te-label
       |     |                       +---w (technology)?
       |     |                       |  +--:(generic)
       |     |                       |  |  +---w generic?   rt-types:generalized-label
       |     |                       |  +--:(otn)
       |     |                       |     +---w tpn?       uint16
       |     |                       |     +---w tsg?       identityref
       |     |                       |     +---w ts-list?   string
       |     |                       +---w direction?       te-label-direction
       |     +---w p2p-secondary-paths
       |     |  +---w p2p-secondary-path* [name]
       |     |     +---w name                      string
       |     |     +---w te-default-metric?        uint32
       |     |     +---w te-delay-metric?          uint32
       |     |     +---w te-hop-metric?            uint32
       |     |     +---w explicit-route-objects
       |     |        +---w explicit-route-object* [index]
       |     |           +---w explicit-route-usage?   identityref
       |     |           +---w index                   uint32
       |     |           +---w (type)?
       |     |              +--:(num-unnum-hop)
       |     |              |  +---w num-unnum-hop
       |     |              |     +---w node-id?      te-types:te-node-id
       |     |              |     +---w link-tp-id?   te-types:te-tp-id
       |     |              |     +---w hop-type?     te-hop-type
       |     |              |     +---w direction?    te-link-direction
       |     |              +--:(as-number)
       |     |              |  +---w as-number-hop
       |     |              |     +---w as-number?   binary
       |     |              |     +---w hop-type?    te-hop-type
       |     |              +--:(label)
       |     |                 +---w label-hop
       |     |                    +---w te-label
       |     |                       +---w (technology)?
       |     |                       |  +--:(generic)
       |     |                       |  |  +---w generic?   rt-types:generalized-label
       |     |                       |  +--:(otn)
       |     |                       |     +---w tpn?       uint16
       |     |                       |     +---w tsg?       identityref
       |     |                       |     +---w ts-list?   string
       |     |                       +---w direction?       te-label-direction
       |     +---w src-client-signal?     identityref
       |     +---w src-tributary-slots
       |     |  +---w values*   uint8
       |     +---w dst-client-signal?     identityref
       |     +---w dst-tributary-slots
       |        +---w values*   uint8
       +--ro output
          +--ro return-code?   enumeration
          +--ro result* [id]
             +--ro id                     uint8
             +--ro p2p-primary-paths
             |  +--ro p2p-primary-path* [name]
             |     +--ro name                      string
             |     +--ro te-default-metric?        uint32
             |     +--ro te-delay-metric?          uint32
             |     +--ro te-hop-metric?            uint32
             |     +--ro explicit-route-objects
             |        +--ro explicit-route-object* [index]
             |           +--ro explicit-route-usage?   identityref
             |           +--ro index                   uint32
             |           +--ro (type)?
             |              +--:(num-unnum-hop)
             |              |  +--ro num-unnum-hop
             |              |     +--ro node-id?      te-types:te-node-id
             |              |     +--ro link-tp-id?   te-types:te-tp-id
             |              |     +--ro hop-type?     te-hop-type
             |              |     +--ro direction?    te-link-direction
             |              +--:(as-number)
             |              |  +--ro as-number-hop
             |              |     +--ro as-number?   binary
             |              |     +--ro hop-type?    te-hop-type
             |              +--:(label)
             |                 +--ro label-hop
             |                    +--ro te-label
             |                       +--ro (technology)?
             |                       |  +--:(generic)
             |                       |  |  +--ro generic?   rt-types:generalized-label
             |                       |  +--:(otn)
             |                       |     +--ro tpn?       uint16
             |                       |     +--ro tsg?       identityref
             |                       |     +--ro ts-list?   string
             |                       +--ro direction?       te-label-direction
             +--ro p2p-secondary-paths
                +--ro p2p-secondary-path* [name]
                   +--ro name                      string
                   +--ro te-default-metric?        uint32
                   +--ro te-delay-metric?          uint32
                   +--ro te-hop-metric?            uint32
                   +--ro explicit-route-objects
                      +--ro explicit-route-object* [index]
                         +--ro explicit-route-usage?   identityref
                         +--ro index                   uint32
                         +--ro (type)?
                            +--:(num-unnum-hop)
                            |  +--ro num-unnum-hop
                            |     +--ro node-id?      te-types:te-node-id
                            |     +--ro link-tp-id?   te-types:te-tp-id
                            |     +--ro hop-type?     te-hop-type
                            |     +--ro direction?    te-link-direction
                            +--:(as-number)
                            |  +--ro as-number-hop
                            |     +--ro as-number?   binary
                            |     +--ro hop-type?    te-hop-type
                            +--:(label)
                               +--ro label-hop
                                  +--ro te-label
                                     +--ro (technology)?
                                     |  +--:(generic)
                                     |  |  +--ro generic?   rt-types:generalized-label
                                     |  +--:(otn)
                                     |     +--ro tpn?       uint16
                                     |     +--ro tsg?       identityref
                                     |     +--ro ts-list?   string
                                     +--ro direction?       te-label-direction

5.  OTN Tunnel YANG Code

<CODE BEGINS>file "ietf-otn-tunnel@2018-08-23.yang"

module ietf-otn-tunnel {
  yang-version 1.1;

  namespace "urn:ietf:params:xml:ns:yang:ietf-otn-tunnel";
  prefix "otn-tunnel";

  import ietf-te {
    prefix "te";
    reference
    "I-D.ietf-teas-yang-te: A YANG Data Model for Traffic Engineering
    Tunnels and Interfaces";

  }

  import ietf-otn-types {
    prefix "otn-types";
    reference
    "module ietf-otn-types in this Document";
  }

  import ietf-te-types {
    prefix "te-types";
    reference
    "I-D.ietf-teas-yang-te: A YANG Data Model for Traffic Engineering
    Tunnels and Interfaces";
  }

  import ietf-inet-types {
    prefix "inet";
    reference "RFC 6991: Common YANG Data Types";
  }

  organization
    "IETF CCAMP Working Group";
  contact
    "WG Web: <http://tools.ietf.org/wg/ccamp/>
     WG List: <mailto:ccamp@ietf.org>

     Editor: Haomian Zheng
             <mailto:zhenghaomian@huawei.com>

     Editor: Aihua Guo
             <mailto:aihuaguo@huawei.com>

     Editor: Italo Busi
             <mailto:italo.busi@huawei.com>

     Editor: Anurag Sharma
             <mailto:ansha@google.com>

     Editor: Rajan Rao
             <mailto:rrao@infinera.com>

     Editor: Sergio Belotti
             <mailto:sergio.belotti@nokia.com>

     Editor: Victor Lopez
             <mailto:victor.lopezalvarez@telefonica.com>

     Editor: Yunbo Li
             <mailto:liyunbo@chinamobile.com>

     Editor: Yunbin Xu
             <mailto:xuyunbin@ritt.cn>";

  description
    "This module defines a model for OTN Tunnel Services.

    Copyright (c) 2018 IETF Trust and the persons
          identified as authors of the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject
        to the license terms contained in, the Simplified BSD License
        set forth in Section 4.c of the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (https://trustee.ietf.org/license-info).";

  revision "2018-08-23" {
    description
      "Initial Revision";
    reference
      "RFC XXXX: OTN Tunnel YANG Model";
    // RFC Ed.: replace XXXX with actual RFC number, update date
    // information and remove this note
  }

 /*
  * Groupings
  */

  grouping otn-tunnel-attributes {
    description "Parameters for OTN tunnel";

    leaf src-client-signal {
      type identityref {
        base otn-types:client-signal;
      }
      description
        "Client signal at the source endpoint of the tunnel";
    }

    leaf dst-client-signal {
      type identityref {
        base otn-types:client-signal;
      }
      description
        "Client signal at the destination endpoint of the tunnel";

    }

 }

 /*
  * Data nodes
  */

  augment "/te:te/te:tunnels/te:tunnel" {
    description
      "Augment with additional parameters required for OTN service";
    uses otn-tunnel-attributes;
  }

  /*
   * Augment TE bandwidth
   */

         /* Augment bandwidth of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/"
        + "te:te-bandwidth/te:technology" {
    description "OTN bandwidth.";
    case otn {
      uses otn-types:otn-path-bandwidth;
    }
  }

  /* Augment bandwdith of tunnel */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:te-bandwidth/te:technology" {
    description "OTN bandwidth.";
    case otn {
      uses otn-types:otn-path-bandwidth;
    }
  }

  /* Augment bandwidth of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:te-bandwidth/te:technology" {
    description "OTN bandwidth.";
    case otn {
      uses otn-types:otn-path-bandwidth;
    }
  }

  /* Augment bandwidth of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:te-bandwidth/te:technology" {
    description "OTN bandwidth.";
    case otn {
      uses otn-types:otn-path-bandwidth;
    }
  }

  /* Augment bandwidht of secondary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:te-bandwidth/te:technology" {
    description "OTN bandwidth.";
    case otn {
      uses otn-types:otn-path-bandwidth;
    }

  }

  /*
   * Augment TE label.
   */

  /* Augment label hop of route-object-exclude-always of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:explicit-route-objects/"
        + "te:route-object-exclude-always/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  /* Augment label hop of route-object-include-exclude of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:explicit-route-objects/"
        + "te:route-object-include-exclude/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  /* Augment label restrictions for the forwarding direction of path-in-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-in-segment/"
        + "te:forward/te:label-restrictions/"
        + "te:label-restriction" {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the forwarding direction of path-in-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-in-segment/"
        + "te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions end for the forwarding direction of path-in-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-in-segment/"
        + "te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions for the reverse direction of path-in-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-in-segment/"
        + "te:reverse/te:label-restrictions/"
        + "te:label-restriction" {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the reverse direction of path-in-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-in-segment/"
        + "te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions end for the reverse direction of path-in-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-in-segment/"
        + "te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions for the forwarding direction of path-out-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-out-segment/"

        + "te:forward/te:label-restrictions/"
        + "te:label-restriction" {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
  }
  /* Augment label restrictions start for the forwarding direction of path-out-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-out-segment/"
        + "te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions end for the forwarding direction of path-out-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-out-segment/"
        + "te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }

  }

  /* Augment label restrictions for the reverse direction of path-out-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-out-segment/"
        + "te:reverse/te:label-restrictions/"
        + "te:label-restriction" {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the reverse direction of path-out-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-out-segment/"
        + "te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }

  }

  /* Augment label restrictions end for the reverse direction of path-out-segment of named-path-constraints */
  augment "/te:te/te:globals/te:named-path-constraints/"
        + "te:named-path-constraint/te:path-out-segment/"
        + "te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label hop of route-exclude of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:optimizations/te:algorithm/te:metric/"
        + "te:optimization-metric/te:explicit-route-exclude-objects/"
        + "te:route-object-exclude-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }
  /* Augment label hop of route-include of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:optimizations/te:algorithm/te:metric/"
        + "te:optimization-metric/te:explicit-route-include-objects/"
        + "te:route-object-include-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  /* Augment label hop of route-object-exclude-always of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:explicit-route-objects/"
        + "te:route-object-exclude-always/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {

      uses otn-types:otn-path-label;
    }
  }

  /* Augment label hop of route-object-include-exclude of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:explicit-route-objects/"
        + "te:route-object-include-exclude/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  /* Augment label restrictions for the forwarding direction of path-in-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-in-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction" {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the forwarding direction of path-in-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-in-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions end for the forwarding direction of path-in-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-in-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions for the reverse direction of path-in-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-in-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction" {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the reverse direction of path-in-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-in-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions end for the reverse direction of path-in-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-in-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions for the forwarding direction of path-out-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-out-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction" {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the forwarding direction of path-out-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-out-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {

    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions end for the forwarding direction of path-out-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-out-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions for the reverse direction of path-out-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-out-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction" {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the reverse direction of path-out-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-out-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions end for the reverse direction of path-out-segment of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-out-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;

    }
  }

  /* Augment label hop of path-route of primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:state/te:path-properties/"
        + "te:path-route-objects/te:path-computed-route-object/"
        + "te:state/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  /* Augment label hop of record-route of primary LSP */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:state/te:lsps/te:lsp/te:lsp-record-route-subobjects/"
        + "te:record-route-subobject/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  /* Augment label hop of path-route of primary LSP */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:state/te:lsps/te:lsp/te:path-properties/"
        + "te:path-route-objects/te:path-computed-route-object/"
        + "te:state/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  /* Augment label hop of route-exclude of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:optimizations/te:algorithm/te:metric/"
        + "te:optimization-metric/te:explicit-route-exclude-objects/"
        + "te:route-object-exclude-object/te:type/te:label/"

        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  /* Augment label hop of route-include of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:optimizations/te:algorithm/te:metric/"
        + "te:optimization-metric/te:explicit-route-include-objects/"
        + "te:route-object-include-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  /* Augment label hop of route-object-exclude-always of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:explicit-route-objects/"
        + "te:route-object-exclude-always/"
        + "te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  /* Augment label hop of route-object-include-exclude of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:explicit-route-objects/"
        + "te:route-object-include-exclude/"
        + "te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  /* Augment label restrictions for the forwarding direction of path-in-segment of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-in-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction" {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the forwarding direction of path-in-segment of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-in-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }

  }

  /* Augment label restrictions end for the forwarding direction of path-in-segment of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-in-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions for the reverse direction of path-in-segment of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-in-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction" {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the reverse direction of path-in-segment of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"

        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-in-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions end for the reverse direction of path-in-segment of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-in-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology"

5.  OTN Tunnel YANG Code

<CODE BEGINS>file "ietf-otn-tunnel@2019-07-08.yang"
module ietf-otn-tunnel {
    description "OTN label.";
    case otn
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-otn-tunnel";
  prefix "otn-tunnel";

  import ietf-te {
      uses otn-types:otn-link-label;
    }
  }

  /* Augment label restrictions
    prefix "te";
    reference
    "I-D.ietf-teas-yang-te: A YANG Data Model for the forwarding direction of path-out-segment of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-out-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction" Traffic Engineering
    Tunnels and Interfaces. ";
  }

  import ietf-layer1-types {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
    prefix "layer1-types";
    reference
    "I-D.ietf-ccamp-layer1-types: A YANG Data Model for Layer 1 Types.";
  }

  /* Augment label restrictions start

  organization
    "IETF CCAMP Working Group";
  contact
    "WG Web: <http://tools.ietf.org/wg/ccamp/>
     WG List: <mailto:ccamp@ietf.org>

     Editor: Haomian Zheng
             <mailto:zhenghaomian@huawei.com>

     Editor: Aihua Guo
             <mailto:aihuaguo@huawei.com>

     Editor: Italo Busi
             <mailto:italo.busi@huawei.com>

     Editor: Anurag Sharma
             <mailto:ansha@google.com>

     Editor: Rajan Rao
             <mailto:rrao@infinera.com>

     Editor: Sergio Belotti
             <mailto:sergio.belotti@nokia.com>

     Editor: Victor Lopez
             <mailto:victor.lopezalvarez@telefonica.com>

     Editor: Yunbo Li
             <mailto:liyunbo@chinamobile.com>

     Editor: Yunbin Xu
             <mailto:xuyunbin@ritt.cn>";

  description
    "This module defines a model for OTN Tunnel Services.

    Copyright (c) 2018 IETF Trust and the forwarding direction persons
          identified as authors of path-out-segment the code.  All rights reserved.

        Redistribution and use in source and binary forms, with or
        without modification, is permitted pursuant to, and subject
        to the license terms contained in, the Simplified BSD License
        set forth in Section 4.c of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-out-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" the IETF Trust's Legal Provisions
        Relating to IETF Documents
        (https://trustee.ietf.org/license-info).";

  revision "2018-08-23" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label;
    }
      "Initial Revision";
    reference
      "RFC XXXX: OTN Tunnel YANG Model";
    // RFC Ed.: replace XXXX with actual RFC number, update date
    // information and remove this note
  }

 /* Augment label restrictions end for the forwarding direction of path-out-segment of reverse primary path
  * Groupings
  */

  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-out-segment/te:forward/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology"

  grouping otn-tunnel-attributes {
    description "OTN label.";
    case otn "Parameters for OTN tunnel";

    leaf src-client-signal {
      uses otn-types:otn-link-label;
    }
      type identityref {
        base layer1-types:client-signal;
      }

  /* Augment label restrictions for
      description
        "Client signal at the reverse direction of path-out-segment source endpoint of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-out-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction" the tunnel. ";
    }

    leaf dst-client-signal {
    description "OTN label.";
    uses otn-types:otn-label-restriction;
      type identityref {
        base layer1-types:client-signal;
      }

  /* Augment label restrictions start for
      description
        "Client signal at the reverse direction of path-out-segment destination endpoint of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-out-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label; the tunnel";
    }

 }

 /* Augment label restrictions end for the reverse direction of path-out-segment of reverse primary path
  * Data nodes
  */

  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:path-out-segment/te:reverse/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" "/te:te/te:tunnels/te:tunnel" {
    description "OTN label.";
    case otn {
      "Augment with additional parameters required for OTN service";
    uses otn-types:otn-link-label;
    } otn-tunnel-attributes;
  }

  /*
   * Augment label hop of path-route TE bandwidth
   */

         /* Augment bandwidth of reverse primary path named-path-constraints */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:state/te:path-properties/"
        + "te:path-route-objects/te:path-computed-route-object/" "/te:te/te:globals/te:named-path-constraints/"
        + "te:state/te:type/te:label/" "te:named-path-constraint/"
        + "te:label-hop/te:te-label/te:technology" "te:te-bandwidth/te:technology" {
    description "OTN label."; bandwidth.";
    case otn {
      uses otn-types:otn-path-label; layer1-types:otn-path-bandwidth;
    }
  }

  /* Augment label hop of record-route bandwdith of reverse primary LSP tunnel */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:state/te:lsps/te:lsp/te:lsp-record-route-subobjects/"
        + "te:record-route-subobject/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" "te:te-bandwidth/te:technology" {
    description "OTN label."; bandwidth.";
    case otn {
      uses otn-types:otn-path-label; layer1-types:otn-path-bandwidth;
    }
  }

  /* Augment label hop of path-route bandwidth of reverse primary LSP path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-reverse-primary-path/"
        + "te:state/te:lsps/te:lsp/te:path-properties/"
        + "te:path-route-objects/te:path-computed-route-object/"
        + "te:state/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" "te:te-bandwidth/te:technology" {
    description "OTN label."; bandwidth.";
    case otn {
      uses otn-types:otn-path-label; layer1-types:otn-path-bandwidth;
    }
  }
  /* Augment label hop of route-exclude bandwidth of secondary reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:optimizations/te:algorithm/te:metric/"
        + "te:optimization-metric/te:explicit-route-exclude-objects/" "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:route-object-exclude-object/te:type/te:label/" "te:p2p-primary-reverse-path/"
        + "te:label-hop/te:te-label/te:technology" "te:te-bandwidth/te:technology" {
    description "OTN label."; bandwidth.";
    case otn {
      uses otn-types:otn-path-label; layer1-types:otn-path-bandwidth;
    }
  }

  /* Augment label hop of route-include bandwidth of secondary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:optimizations/te:algorithm/te:metric/"
        + "te:optimization-metric/te:explicit-route-include-objects/"
        + "te:route-object-include-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" "te:te-bandwidth/te:technology" {
    description "OTN label."; bandwidth.";
    case otn {
      uses otn-types:otn-path-label; layer1-types:otn-path-bandwidth;
    }
  }

  /*
   * Augment TE label.
   */

  /* Augment label hop of route-object-exclude-always of secondary path named-path-constraints */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "/te:te/te:globals/te:named-path-constraints/"
        + "te:explicit-route-objects/" "te:named-path-constraint/te:explicit-route-objects-always/"
        + "te:route-object-exclude-always/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label; layer1-types:otn-path-label;
    }
  }

  /* Augment label hop of route-object-include-exclude of secondary path named-path-constraints */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "/te:te/te:globals/te:named-path-constraints/"
        + "te:explicit-route-objects/" "te:named-path-constraint/te:explicit-route-objects-always/"
        + "te:route-object-include-exclude/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label; layer1-types:otn-path-label;
    }
  }

  /* Augment label restrictions for the forwarding direction of path-in-segment of secondary path named-path-constraints */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "/te:te/te:globals/te:named-path-constraints/"
        + "te:path-in-segment/te:forward/te:label-restrictions/" "te:named-path-constraint/te:path-in-segment/"
        + "te:label-restriction" "te:label-restrictions/te:label-restriction"  {
    description "OTN label.";
    uses otn-types:otn-label-restriction; layer1-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the forwarding direction of path-in-segment of secondary path named-path-constraints */
  augment "/te:te/te:tunnels/te:tunnel/" "/te:te/te:globals/te:named-path-constraints/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "te:named-path-constraint/te:path-in-segment/"
        + "te:path-in-segment/te:forward/te:label-restrictions/" "te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label; layer1-types:otn-link-label;
    }
  }

  /* Augment label restrictions end for the forwarding direction of path-in-segment of secondary path named-path-constraints */
  augment "/te:te/te:tunnels/te:tunnel/" "/te:te/te:globals/te:named-path-constraints/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "te:named-path-constraint/te:path-in-segment/"
        + "te:path-in-segment/te:forward/te:label-restrictions/" "te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label; layer1-types:otn-link-label;
    }
  }

  /* Augment label restrictions for the reverse forwarding direction of path-in-segment path-out-segment of secondary path named-path-constraints */
  augment "/te:te/te:tunnels/te:tunnel/" "/te:te/te:globals/te:named-path-constraints/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "te:named-path-constraint/te:path-out-segment/"
        + "te:path-in-segment/te:reverse/te:label-restrictions/" "te:label-restrictions/"
        + "te:label-restriction" {
    description "OTN label.";
    uses otn-types:otn-label-restriction; layer1-types:otn-label-restriction;
  }
  /* Augment label restrictions start for the reverse forwarding direction of path-in-segment path-out-segment of secondary path named-path-constraints */
  augment "/te:te/te:tunnels/te:tunnel/" "/te:te/te:globals/te:named-path-constraints/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "te:named-path-constraint/te:path-out-segment/"
        + "te:path-in-segment/te:reverse/te:label-restrictions/" "te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label; layer1-types:otn-link-label;

    }
  }

  /* Augment label restrictions end for the reverse forwarding direction of path-in-segment path-out-segment of secondary path named-path-constraints */
  augment "/te:te/te:tunnels/te:tunnel/" "/te:te/te:globals/te:named-path-constraints/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "te:named-path-constraint/te:path-out-segment/"
        + "te:path-in-segment/te:reverse/te:label-restrictions/" "te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label; layer1-types:otn-link-label;
    }
  }

  /* Augment label restrictions for the forwarding direction hop of path-out-segment route-exclude of secondary primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:optimizations/te:algorithm/te:metric/"
        + "te:path-out-segment/te:forward/te:label-restrictions/" "te:optimization-metric/te:explicit-route-exclude-objects/"
        + "te:label-restriction" "te:route-object-exclude-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-label-restriction; layer1-types:otn-path-label;
    }
  }

  /* Augment label restrictions start for the forwarding direction hop of path-out-segment route-include of secondary primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-out-segment/te:forward/te:label-restrictions/" "te:optimizations/te:algorithm/te:metric/"
        + "te:label-restriction/te:label-start/" "te:optimization-metric/te:explicit-route-include-objects/"
        + "te:te-label/te:technology" "te:route-object-include-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label; layer1-types:otn-path-label;
    }
  }

  /* Augment label restrictions end for the forwarding direction hop of path-out-segment route-object-exclude-always of secondary primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-out-segment/te:forward/te:label-restrictions/" "te:explicit-route-objects-always/"
        + "te:label-restriction/te:label-end/" "te:route-object-exclude-always/te:type/te:label/"
        + "te:te-label/te:technology" "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {

      uses otn-types:otn-link-label; layer1-types:otn-path-label;
    }
  }

  /* Augment label restrictions for the reverse direction hop of path-out-segment route-object-include-exclude of secondary primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-out-segment/te:reverse/te:label-restrictions/" "te:explicit-route-objects-always/"
        + "te:label-restriction" "te:route-object-include-exclude/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-label-restriction; layer1-types:otn-path-label;
    }
  }

  /* Augment label restrictions start for the reverse forwarding direction of path-out-segment path-in-segment of secondary primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:path-out-segment/te:reverse/te:label-restrictions/" "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:label-restriction/te:label-start/" "te:path-in-segment/te:label-restrictions/"
        + "te:te-label/te:technology" "te:label-restriction" {
    description "OTN label.";
    case otn {
    uses otn-types:otn-link-label;
    } layer1-types:otn-label-restriction;
  }

  /* Augment label restrictions end start for the reverse forwarding direction of path-out-segment path-in-segment of secondary primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-out-segment/te:reverse/te:label-restrictions/" "te:path-in-segment/te:label-restrictions/"
        + "te:label-restriction/te:label-end/" "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-link-label; layer1-types:otn-link-label;
    }
  }

  /* Augment label hop restrictions end for the forwarding direction of path-route path-in-segment of secondary primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/" "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:state/te:path-properties/te:path-route-objects/" "te:path-in-segment/te:label-restrictions/"
        + "te:path-computed-route-object/te:state/te:type/te:label/" "te:label-restriction/te:label-end/"
        + "te:label-hop/te:te-label/te:technology" "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label; layer1-types:otn-link-label;

    }
  }

  /* Augment label hop restrictions for the forwarding direction of record-route path-out-segment of secondary LSP primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:state/te:lsps/te:lsp/te:lsp-record-route-subobjects/" "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:record-route-subobject/te:type/te:label/" "te:path-out-segment/te:label-restrictions/"
        + "te:label-hop/te:te-label/te:technology" "te:label-restriction" {
    description "OTN label.";
    case otn {
    uses otn-types:otn-path-label;
    } layer1-types:otn-label-restriction;
  }

  /* Augment label hop restrictions start for the forwarding direction of path-route path-out-segment of secondary LSP primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:state/te:lsps/te:lsp/te:path-properties/" "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:path-route-objects/" "te:path-out-segment/te:label-restrictions/"
        + "te:path-computed-route-object/te:state/te:type/te:label/" "te:label-restriction/te:label-start/"
        + "te:label-hop/te:te-label/te:technology" "te:te-label/te:technology" {

    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label; layer1-types:otn-link-label;
    }
  }

  /* Augment label hop restrictions end for the forwarding direction of record-route path-out-segment of LSP primary path */
  augment "/te:te/te:lsps-state/" "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:lsp/te:lsp-record-route-subobjects/" "te:path-out-segment/te:label-restrictions/"
        + "te:record-route-subobject/te:type/te:label/" "te:label-restriction/te:label-end/"
        + "te:label-hop/te:te-label/te:technology" "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-types:otn-path-label;
    }
  }

  grouping p2p-path-ero {
    description
      "TE tunnel ERO configuration grouping";

    leaf te-default-metric {
      type uint32;
      description
        "Traffic engineering metric."; layer1-types:otn-link-label;
    }
    leaf te-delay-metric {
      type uint32;
      description
        "Traffic engineering delay metric.";
  }
    leaf te-hop-metric {
      type uint32;
      description
        "Traffic engineering

  /* Augment label hop metric.";

    }
    container explicit-route-objects {
      description "Explicit route objects container";
      list explicit-route-object {
        key "index";
        description
          "List of explicit route objects";
        leaf explicit-route-usage {
          type identityref {
            base te-types:route-usage-type;
          }
          description "An explicit-route hop action.";
        }
        uses te-types:explicit-route-hop {
                  augment "type/label/label-hop/te-label/technology" {
                    description "OTN label.";
            case otn {
                  uses otn-types:otn-path-label;
                }
                  }
                }
      }
    }
  }

  rpc otn-te-tunnel-path-compute {
    description "OTN TE tunnel path computation";
    input {
      list request {
        key "id";
        description "A list path-route of primary path computation requests.";

        leaf id {
          type uint8;
          description
            "Request ID.";
        }
        leaf type {
          type identityref {
            base te-types:tunnel-type;
          }
          description "TE tunnel type.";
        }
        leaf source {
          type inet:ip-address;
          description
            "TE tunnel source address.";
        }

        leaf destination {
          type inet:ip-address;
          description
            "TE tunnel destination address";
        }
        leaf src-tp-id {
          type binary;
          description
            "TE tunnel source termination point identifier.";
        }
        leaf dst-tp-id {
          type binary;
          description
            "TE tunnel destination termination point identifier.";
        }
        leaf switching-layer {
          type identityref {
            base te-types:switching-capabilities;
          }
          description
            "Switching layer where the requests are computed.";
        }
        leaf encoding {
          type identityref {
            base te-types:lsp-encoding-types;
          }
          description "LSP encoding type";
        }
        leaf protection-type */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:computed-paths-properties/"
        + "te:computed-path-properties/te:path-properties/"
        + "te:path-route-objects/te:path-computed-route-object/"
        + "te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
          type identityref
    description "OTN label.";
    case otn {
            base te-types:lsp-protection-type;
      uses layer1-types:otn-path-label;

    }
          description "LSP protection type";
  }
        leaf restoration-type

  /* Augment label hop of record-route of primary LSP */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:lsps/te:lsp/te:lsp-record-route-information/"
        + "te:lsp-record-route-information/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
          type identityref
    description "OTN label.";
    case otn {
            base te-types:lsp-restoration-type;
      uses layer1-types:otn-path-label;
    }
          description "LSP restoration type";
  }
        leaf provider-id

  /* Augment label hop of path-route of primary LSP */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:lsps/te:lsp/te:path-properties/"
        + "te:path-route-objects/te:path-computed-route-object/"
        + "te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
          type te-types:te-global-id;
    description
            "An identifier to uniquely identify a provider.";
        }
        leaf client-id "OTN label.";
    case otn {
          type te-types:te-global-id;
          description

            "An identifier to uniquely identify a client.";
      uses layer1-types:otn-path-label;
    }
        leaf te-topology-id
  }

  /* Augment label hop of route-exclude of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:optimizations/te:algorithm/te:metric/"
        + "te:optimization-metric/te:explicit-route-exclude-objects/"
        + "te:route-object-exclude-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
          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."; "OTN label.";
    case otn {
      uses layer1-types:otn-path-label;
    }
        leaf setup-priority
  }

  /* Augment label hop of route-include of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:optimizations/te:algorithm/te:metric/"
        + "te:optimization-metric/te:explicit-route-include-objects/"
        + "te:route-object-include-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
          type uint8
    description "OTN label.";
    case otn {
            range "0..7";
      uses layer1-types:otn-path-label;
    }
          description
            "TE LSP setup priority";
  }
        leaf hold-priority

  /* Augment label hop of route-object-exclude-always of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:explicit-route-objects-always/"
        + "te:route-object-exclude-always/"
        + "te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
          type uint8
    description "OTN label.";
    case otn {
            range "0..7";
      uses layer1-types:otn-path-label;
    }
          description
            "TE LSP hold priority";
  }
        leaf te-path-metric-type {
          type identityref

  /* Augment label hop of route-object-include-exclude of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:explicit-route-objects-always/"
        + "te:route-object-include-exclude/"
        + "te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
            base te-types:path-metric-type;
          }
          default te-types:path-metric-te;
    description
            "The tunnel path metric type.";
        }

        leaf odu-type "OTN label.";
    case otn {
          type identityref{
            base otn-types:odu-type;
      uses layer1-types:otn-path-label;
    }
          description "Type of ODU";
  }
        container p2p-primary-paths {
          description "Set

  /* Augment label restrictions for the forwarding direction of P2P path-in-segment of reverse primary paths container";
          list p2p-primary-path path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:path-in-segment/te:label-restrictions/"
        + "te:label-restriction" {
            key "name";
    description
              "List "OTN label.";
    uses layer1-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the forwarding direction of path-in-segment of reverse primary paths for this tunnel.";
            leaf name path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:path-in-segment/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
              type string;
    description "TE path name";
            } "OTN label.";
    case otn {
      uses p2p-path-ero; layer1-types:otn-link-label;
    }
  }
        container p2p-secondary-paths

  /* Augment label restrictions end for the forwarding direction of path-in-segment of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:path-in-segment/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "Set "OTN label.";
    case otn {
      uses layer1-types:otn-link-label;
    }
  }

  /* Augment label restrictions for the forwarding direction of P2P secondary paths container";
          list p2p-secondary-path path-out-segment of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:path-out-segment/te:label-restrictions/"
        + "te:label-restriction" {
            key "name";
    description
              "List of secondary paths "OTN label.";
    uses layer1-types:otn-label-restriction;
  }

  /* Augment label restrictions start for this tunnel.";
            leaf name the forwarding direction of path-out-segment of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:path-out-segment/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
              type string;
    description "TE path name";
            } "OTN label.";
    case otn {
      uses p2p-path-ero; layer1-types:otn-link-label;
    }
  }

  /* Augment label restrictions end for the forwarding direction of path-out-segment of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:path-out-segment/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description "OTN label.";
    case otn {
      uses otn-tunnel-attributes; layer1-types:otn-link-label;
    }
  }
    output {
      leaf return-code {
        type enumeration {
          enum success

  /* Augment label hop of path-route of reverse primary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:computed-paths-properties"
                + "/te:computed-path-properties/te:path-properties/"
        + "te:path-route-objects/te:path-computed-route-object/"
        + "te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "success";
          }
          enum aborted "OTN label.";
    case otn {
            description "aborted";
      uses layer1-types:otn-path-label;
    }
          enum destination-not-found {
            description "destination-not-found";
  }
          enum invalid-argument

  /* Augment label hop of record-route of reverse primary LSP */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:lsps/te:lsp/te:lsp-record-route-information/"
        + "te:lsp-record-route-information/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    description "invalid-argument";
          }
          enum no-memory "OTN label.";
    case otn {
            description "no-memory";
      uses layer1-types:otn-path-label;
    }
          enum no-path-found {
            description "no-path-found";
  }
          enum other-error

  /* Augment label hop of path-route of reverse primary LSP */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-primary-paths/te:p2p-primary-path/"
        + "te:p2p-primary-reverse-path/"
        + "te:lsps/te:lsp/te:path-properties/"
        + "te:path-route-objects/te:path-computed-route-object/"
        + "te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {

    description "other-error";
          }
          enum some-path-not-found "OTN label.";
    case otn {
            description "some-path-not-found";
      uses layer1-types:otn-path-label;
    }
          enum source-not-found {
            description "source-not-found";
  }
          enum topology-error

  /* Augment label hop of route-exclude of secondary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:optimizations/te:algorithm/te:metric/"
        + "te:optimization-metric/te:explicit-route-exclude-objects/"
        + "te:route-object-exclude-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {

    description "topology-error";
          } "OTN label.";
    case otn {
      uses layer1-types:otn-path-label;
    }
        description
          "Return code";
  }
      list result {
        key "id";
        description
          "A list

  /* Augment label hop of results for all requests.";

        leaf id route-include of secondary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:optimizations/te:algorithm/te:metric/"
        + "te:optimization-metric/te:explicit-route-include-objects/"
        + "te:route-object-include-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
          type uint8;
    description
            "Request ID";
        }
        container p2p-primary-paths "OTN label.";
    case otn {
          description "Set
      uses layer1-types:otn-path-label;
    }
  }

  /* Augment label hop of P2P primary paths container";
          list p2p-primary-path {
            key "name";
            description
              "List route-object-exclude-always of resultant primary paths for this tunnel.";
            leaf name secondary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:explicit-route-objects-always/"
        + "te:route-object-exclude-always/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
              type string;
    description "TE path name";
            } "OTN label.";
    case otn {
      uses p2p-path-ero; layer1-types:otn-path-label;
    }
  }
        container p2p-secondary-paths {
          description "Set

  /* Augment label hop of P2P secondary paths container";
          list p2p-secondary-path {
            key "name";
            description
              "List route-object-include-exclude of resultant secondary paths for this tunnel.";
            leaf name path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:explicit-route-objects-always/"
        + "te:route-object-include-exclude/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
              type string;
    description "TE path name";
            } "OTN label.";
    case otn {
      uses p2p-path-ero;
          } layer1-types:otn-path-label;
    }
  }
    }
  }
}

<CODE ENDS>

6.  OTN Types YANG Code

<CODE BEGINS> file "ietf-otn-types.yang"
module ietf-otn-types {
  namespace "urn:ietf:params:xml:ns:yang:ietf-otn-types";
  prefix "otn-types";

  organization
    "IETF CCAMP Working Group";
  contact
    "WG Web: <http://tools.ietf.org/wg/ccamp/>
     WG List: <mailto:ccamp@ietf.org>

     Editor: Haomian Zheng
             <mailto:zhenghaomian@huawei.com>

     Editor: Aihua Guo
             <mailto:aihuaguo@huawei.com>

     Editor: Italo Busi
             <mailto:italo.busi@huawei.com>

     Editor: Anurag Sharma
             <mailto:ansha@google.com>

     Editor: Rajan Rao
             <mailto:rrao@infinera.com>

     Editor: Sergio Belotti
             <mailto:sergio.belotti@nokia.com>

     Editor: Victor Lopez
             <mailto:victor.lopezalvarez@telefonica.com>

     Editor: Yunbo Li
             <mailto:liyunbo@chinamobile.com>

     Editor: Yunbin Xu
             <mailto:xuyunbin@ritt.cn>";

  description
    "This module defines OTN types.";

  revision "2019-01-15"

  /* Augment label restrictions for the forwarding direction of path-in-segment of secondary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:path-in-segment/te:label-restrictions/"
        + "te:label-restriction" {

    description
      "Initial Revision";
    reference
      "RFC XXXX: OTN Tunnel YANG Model";
    // RFC Ed.: replace XXXX with actual RFC number, update date
    // information and remove this note "OTN label.";
    uses layer1-types:otn-label-restriction;
  }
  identity tributary-slot-granularity {
    description
      "Tributary slot granularity";
    reference
      "G.709/Y.1331, February 2016: Interfaces

  /* Augment label restrictions start for the Optical
       Transport Network (OTN)";
  }

  identity tsg-1.25G forwarding direction of path-in-segment of secondary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:path-in-segment/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    base tributary-slot-granularity;
    description
      "1.25G tributary slot granularity";
  }

  identity tsg-2.5G "OTN label.";
    case otn {
    base tributary-slot-granularity;
    description
      "2.5G tributary slot granularity";
      uses layer1-types:otn-link-label;
    }

  identity odu-type
  }

  /* Augment label restrictions end for the forwarding direction of path-in-segment of secondary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:path-in-segment/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    description
      "Base identity for protocol framing used by tributary signals";
  }

  identity ODU0 "OTN label.";
    case otn {
    base odu-type;
    description
      "ODU0 protocol (1.24G)";
      uses layer1-types:otn-link-label;
    }

  identity ODU1 {
    base odu-type;
    description
      "ODU1 protocol (2.49G)";
  }

  /*
  identity ODU1e {
    base odu-type;
    description
      "ODU1e protocol (10.35G).";
  }

  identity ODU1f Augment label restrictions for the forwarding direction of path-out-segment of secondary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:path-out-segment/te:label-restrictions/"
        + "te:label-restriction" {
    base odu-type;

    description
      "ODU1f protocol (10.56G)."; "OTN label.";
    uses layer1-types:otn-label-restriction;
  }

  /* Augment label restrictions start for the forwarding direction of path-out-segment of secondary path */
  identity ODU2
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:path-out-segment/te:label-restrictions/"
        + "te:label-restriction/te:label-start/"
        + "te:te-label/te:technology" {
    base odu-type;
    description
      "ODU2 protocol (10.03G)";
  }

  identity ODU2e "OTN label.";
    case otn {
    base odu-type;
    description
      "ODU2e protocol (10.39G)";
      uses layer1-types:otn-link-label;
    }
/*
  identity ODU2f {
    base odu-type;
    description
      "ODU2f protocol (10.60G).";
  }

  /* Augment label restrictions end for the forwarding direction of path-out-segment of secondary path */
  identity ODU3
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:path-out-segment/te:label-restrictions/"
        + "te:label-restriction/te:label-end/"
        + "te:te-label/te:technology" {
    base odu-type;
    description
      "ODU3 protocol (40.31G)"; "OTN label.";
    case otn {
      uses layer1-types:otn-link-label;
    }
  }

  /*
  identity ODU3e1 Augment label hop of path-route of secondary path */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
                + "te:computed-paths-properties"
                + "/te:computed-path-properties/"
        + "te:path-properties/te:path-route-objects/"
        + "te:path-computed-route-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    base odu-type;
    description
      "ODU3e1 protocol (41.77G).";
  }

  identity ODU3e2 "OTN label.";
    case otn {
    base odu-type;
    description
      "ODU3e2 protocol (41.78G).";
      uses layer1-types:otn-path-label;
    }
  }

  /* Augment label hop of record-route of secondary LSP */
  identity ODU4
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:lsps/te:lsp/te:lsp-record-route-information/"
        + "te:lsp-record-route-information/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    base odu-type;

    description
      "ODU4 protocol (104.79G)";
  }

  identity ODUFlex-cbr "OTN label.";
    case otn {
    base odu-type;
    description
      "ODU Flex CBR protocol for transporting constant bit rate
       signal";
      uses layer1-types:otn-path-label;
    }

  identity ODUFlex-gfp {
    base odu-type;
    description
      "ODU Flex GFP protocol for transporting stream of packets
       using Generic Framing Procedure";
  }

  identity ODUCn

  /* Augment label hop of path-route of secondary LSP */
  augment "/te:te/te:tunnels/te:tunnel/"
        + "te:p2p-secondary-paths/te:p2p-secondary-path/"
        + "te:lsps/te:lsp/te:path-properties/"
        + "te:path-route-objects/"
        + "te:path-computed-route-object/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    base odu-type;
    description
      "ODUCn protocol (beyond 100G)";
  }

  identity client-signal "OTN label.";
    case otn {
    description
      "Base identity from which specific client signals for the
       tunnel are derived";
      uses layer1-types:otn-path-label;
    }

  identity ETH-1Gb {
    base client-signal;
    description
      "Client signal type of 1GbE";
  }

  identity ETH-10Gb-LAN

  /* Augment label hop of record-route of LSP */
  augment "/te:te/te:lsps-state/"
        + "te:lsp/te:lsp-record-route-information/"
        + "te:lsp-record-route-information/te:type/te:label/"
        + "te:label-hop/te:te-label/te:technology" {
    base client-signal;
    description
      "Client signal type of 10GbE LAN";
  }

  identity ETH-10Gb-WAN "OTN label.";
    case otn {
    base client-signal;
    description
      "Client signal type of 10GbE WAN";
      uses layer1-types:otn-path-label;
    }
  }

  identity ETH-40Gb
/*
  grouping p2p-path-ero {
    base client-signal;
    description
      "Client signal
      "TE tunnel ERO configuration grouping";

    leaf te-default-metric {
      type of 40GbE"; uint32;
      description
        "Traffic engineering metric.";
    }

  identity ETH-100Gb
    leaf te-delay-metric {
    base client-signal;
    description
      "Client signal
      type of 100GbE"; uint32;
      description
        "Traffic engineering delay metric.";
    }

  identity STM-1
    leaf te-hop-metric {
    base client-signal;
    description
      "Client signal
      type of OC3 & STM-1"; uint32;
      description
        "Traffic engineering hop metric.";

    }

  identity STM-4
    container explicit-route-objects-always {
    base client-signal;
      description
      "Client signal type of OC12 & STM-4";
  }

  identity STM-16 "Explicit route objects container";
      list route-object-include-exclude {
    base client-signal;
        key "index";
        description
      "Client signal type
          "List of OC48 & STM-16";
  }

  identity STM-64 explicit route objects";
        leaf explicit-route-usage {
    base client-signal;
    description
      "Client signal
          type of OC192 & STM-64";
  }

  identity STM-256 identityref {
            base client-signal; te-types:route-usage-type;
          }
          description
      "Client signal type of OC768 & STM-256"; "An explicit-route hop action.";
        }

  identity FC-100
        uses te-types:explicit-route-hop {
                  augment "type/label/label-hop/te-label/technology" {
    base client-signal;
                    description
      "Client signal type of Fibre Channel FC-100"; "OTN label.";
            case otn {
                  uses layer1-types:otn-path-label;
                }
                  }
                }
      }

  identity FC-200
    }
  }
*/
/*
  rpc otn-te-tunnel-path-compute {
    base client-signal;
    description
      "Client signal type of Fibre Channel FC-200";
  }

  identity FC-400 "OTN TE tunnel path computation";
    input {
    base client-signal;
      list request {
        key "id";
        description
      "Client signal type "A list of Fibre Channel FC-400";
  }

  identity FC-800 path computation requests.";

        leaf id {
    base client-signal;
    description
      "Client signal
          type of Fibre Channel FC-800"; uint8;
          description
            "Request ID.";
        }

  identity FC-1200
        leaf type {
    base client-signal;
    description
      "Client signal
          type of Fibre Channel FC-1200";
  }

  identity FC-1600 identityref {
            base client-signal; te-types:te-tunnel-type;
          }
          description
      "Client signal type of Fibre Channel FC-1600"; "TE tunnel type.";
        }

  identity FC-3200
        leaf source {
    base client-signal;
    description
      "Client signal
          type of Fibre Channel FC-3200"; inet:ip-address;
          description
            "TE tunnel source address.";

        }

  identity FICON-4G

        leaf destination {
    base client-signal;
    description
      "Client signal
          type of Fibre Connection 4G"; inet:ip-address;
          description
            "TE tunnel destination address";
        }

  identity FICON-8G
        leaf src-tp-id {
    base client-signal;
    description
      "Client signal
          type of Fibre Connection 8G"; binary;
          description
            "TE tunnel source termination point identifier.";
        }

  identity otn-label-range-type
        leaf dst-tp-id {
          type binary;
          description
      "Base identity from which specific OTN label
           range types derived";
            "TE tunnel destination termination point identifier.";
        }

  identity label-range-trib-slot
        leaf switching-layer {
          type identityref {
            base otn-label-range-type; te-types:switching-capabilities;
          }
          description
      "Defines a range of OTN tributary slots";
            "Switching layer where the requests are computed.";
        }

  identity label-range-trib-port
        leaf encoding {
          type identityref {
            base otn-label-range-type; te-types:lsp-encoding-types;
          }
          description
      "Defines a range of OTN tributary ports"; "LSP encoding type";
        }

  grouping otn-link-bandwidth
        leaf protection-type {
    description "link bandwidth attributes for OTN";
    list odulist
          type identityref {
      key "odu-type";
            base te-types:lsp-protection-type;
          }
          description
        "OTN bandwidth definition"; "LSP protection type";
        }
        leaf odu-type restoration-type {
          type identityref {
            base otn-types:odu-type; te-types:lsp-restoration-type;
          }
          description "ODU "LSP restoration type";
        }
        leaf number provider-id {
          type uint16; te-types:te-global-id;
          description "Number of ODUs";
      }
            "An identifier to uniquely identify a provider.";
        }
        leaf client-id {
          type te-types:te-global-id;
          description

            "An identifier to uniquely identify a client.";
        }

  grouping otn-path-bandwidth
        leaf te-topology-id {
          type te-types:te-topology-id;
          description "path bandwidth attributes for OTN";
            "It is presumed that a datastore will contain many
             topologies. To distinguish between topologies it is
             vital to have UNIQUE topology identifiers.";
        }
        leaf odu-type setup-priority {
          type identityref uint8 {
        base otn-types:odu-type;
            range "0..7";
          }
          description "ODU type";
    }
            "TE LSP setup priority";
        }

  grouping otn-label-restriction {
        description "label restriction information for OTN";
        leaf range-type hold-priority {
          type identityref uint8 {
        base otn-types:otn-label-range-type;
            range "0..7";
          }
          description "type for range";
            "TE LSP hold priority";
        }
        leaf tsg te-path-metric-type {
          type identityref {
            base otn-types:tributary-slot-granularity; te-types:path-metric-type;
          }
          default te-types:path-metric-te;
          description "Tributary slot granularity.";
      reference
        "G.709/Y.1331, February 2016: Interfaces for the
         Optical Transport Network (OTN)";
            "The tunnel path metric type.";
        }

        leaf priority odu-type {
          type uint8;
      description "priority."; identityref{
            base layer1-types:odu-type;
          }
          description "Type of ODU";
        }

/* Note: Suggest to be changed as otn-label-range;
otn-topology/tunnel also need change */
  grouping otn-link-label
        container p2p-primary-paths {
          description "link label information for OTN, for label-start/end";
    choice otn-label-type "Set of P2P primary paths container";
          list p2p-primary-path {
            key "name";
            description
        "OTN label range type, either TPN range or TS range";
      case tributary-port {
              "List of primary paths for this tunnel.";
            leaf tpn name {
              type uint16 {
            range "1..4095";
          } string;
              description
            "Tributary Port Number. Applicable in case of mux services.";
          reference
            "RFC7139: GMPLS Signaling Extensions for Control of Evolving
             G.709 Optical Transport Networks."; "TE path name";
            }

            uses p2p-path-ero;
          }
      case tributary-slot {
        leaf ts
        }
        container p2p-secondary-paths {
          type uint16
          description "Set of P2P secondary paths container";
          list p2p-secondary-path {
            range "1..4095";
          }
            key "name";
            description
            "Tributary Slot Number. Applicable in case
              "List of mux services.";
          reference
            "RFC7139: GMPLS Signaling Extensions secondary paths for Control of Evolving
             G.709 Optical Transport Networks."; this tunnel.";
            leaf name {
              type string;
              description "TE path name";
            }
            uses p2p-path-ero;
          }
        }
        uses otn-tunnel-attributes;
      }

/* Note: Suggest to be changed as otn-label;
otn-topology/tunnel also need change */
  grouping otn-path-label
    }
    output {
    description "label information for OTN, for label-hop";
      leaf tpn return-code {
        type uint16 enumeration {
        range "1..4095";
          enum success {
            description "success";
          }
          enum aborted {
            description
        "Tributary Port Number. Applicable in case of mux services.";
      reference
        "RFC7139: GMPLS Signaling Extensions for Control of Evolving
         G.709 Optical Transport Networks."; "aborted";
          }
    leaf tsg
          enum destination-not-found {
      type identityref
            description "destination-not-found";
          }
          enum invalid-argument {
        base otn-types:tributary-slot-granularity;
            description "invalid-argument";
          }
          enum no-memory {
            description "Tributary slot granularity.";
      reference
        "G.709/Y.1331, February 2016: Interfaces for the
         Optical Transport Network (OTN)"; "no-memory";
          }
    leaf ts-list
          enum no-path-found {
      type string
            description "no-path-found";
          }
          enum other-error {
          pattern "([1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?"
                + "(,[1-9][0-9]{0,3}(-[1-9][0-9]{0,3})?)*)";
            description "other-error";
          }
          enum some-path-not-found {
            description "some-path-not-found";
          }
          enum source-not-found {
            description "source-not-found";

          }
          enum topology-error {
            description "topology-error";
          }
        }
        description
          "Return code";
      }
      list result {
        key "id";
        description
          "A list of available tributary slots ranging
           between 1 and 9999.
           For example 1-20,25,50-1000";
        reference "RFC 7139: GMPLS Signaling Extensions results for Control
                   of Evolving G.709 Optical Transport Networks";
    }
  }
  grouping otn-label-step all requests.";

        leaf id {
          type uint8;
          description "Label step for OTN";
    choice otn-label-type
            "Request ID";
        }
        container p2p-primary-paths {
          description
        "OTN label range type, either TPN range or TS range";
      case tributary-port "Set of P2P primary paths container";
          list p2p-primary-path {
            key "name";
            description
              "List of resultant primary paths for this tunnel.";
            leaf tpn-step name {
              type uint16 {
            range "1..4095";
          }
          default 1; string;
              description
            "Label step which represents possible increments for
             Tributary Port Number.";
          reference
            "RFC7139: GMPLS Signaling Extensions for Control of Evolving
             G.709 Optical Transport Networks."; "TE path name";
            }
            uses p2p-path-ero;
          }
      case tributary-slot
        }
        container p2p-secondary-paths {
          description "Set of P2P secondary paths container";
          list p2p-secondary-path {
            key "name";
            description
              "List of resultant secondary paths for this tunnel.";
            leaf ts name {
              type uint16 {
            range "1..4095";
          }
          default 1; string;
              description
            "Label step which represents possible increments for
             Tributary Slot Number.";
          reference
            "RFC7139: GMPLS Signaling Extensions for Control of Evolving
             G.709 Optical Transport Networks."; "TE path name";
            }
            uses p2p-path-ero;
          }

        }
      }
    }
  }*/
}

<CODE ENDS>

7.

6.  Security Considerations

   The YANG module specified in this document defines a schema for data
   that is designed to be accessed via network management protocols such
   as NETCONF [RFC6241] or RESTCONF [RFC8040].  The lowest NETCONF layer
   is the secure transport layer, and the mandatory-to-implement secure
   transport is Secure Shell (SSH) [RFC6242].  The lowest RESTCONF layer
   is HTTPS, and the mandatory-to-implement secure transport is TLS
   [RFC8446].

   The NETCONF access control model [RFC8341] provides the means to
   restrict access for particular NETCONF or RESTCONF users to a
   preconfigured subset of all available NETCONF or RESTCONF protocol
   operations and content.

   There are a number of data nodes defined in this YANG module that are
   writable/creatable/deletable (i.e., config true, which is the
   default).  These data nodes may be considered sensitive or vulnerable
   in some network environments.  Write operations (e.g., edit-config)
   to these data nodes without proper protection can have a negative
   effect on network operations.  These are the subtrees and data nodes
   and their sensitivity/vulnerability:

   /te:te/te:tunnels/te:tunnel /te:te/../te:te-bandwidth/te:technology
   /te:te/../te:type/te:label/te:label-hop/te:te-label/te:technology
   /te:te/../te:label-restrictions/te:label-restriction/te:label-start/
   te:te-label/te:technology /te:te/../te:label-restrictions/te:label-
   restriction/te:label-end/te:te-label/te:technology
   /te:te/../te:label-restrictions/te:label-restriction/ Editors note:
   we are using simplified description by folding similar branches to
   avoid repetation.

   Some of the readable data nodes in this YANG module may be considered
   sensitive or vulnerable in some network environments.  It is thus
   important to control read access (e.g., via get, get-config, or
   notification) to these data nodes.  These are the subtrees and data
   nodes and their sensitivity/vulnerability:

   /te:te/../te:type/te:label/te:label-hop/te:te-label/te:technology
   Editors note: we are using simplified description by folding similar
   branches to avoid repetation.

   Some of the RPC operations in this YANG module may be considered
   sensitive or vulnerable in some network environments.  It is thus
   important to control access to these operations.  These are the
   operations and their sensitivity/vulnerability:

   +---x otn-te-tunnel-path-compute This path compute RPC provides a
   mechanism to enable the client to query and/or subscribe on the
   tunnel to be notified whenever it changes.  Thus path computation is
   only for the client reference, with no real deploy or resource
   reservation.

8.

7.  IANA Considerations

   It is proposed that IANA should assign new URIs from the "IETF XML
   Registry" [RFC3688] as follows:

         URI: urn:ietf:params:xml:ns:yang:ietf-otn-tunnel
         Registrant Contact: The IESG
         XML: N/A; the requested URI is an XML namespace.

         URI: urn:ietf:params:xml:ns:yang:ietf-otn-types
         Registrant Contact: The IESG
         XML: N/A; the requested URI is an XML namespace.

   This document registers following YANG modules in the YANG Module
   Names registry [RFC7950].

      name:         ietf-otn-tunnel
      namespace:    urn:ietf:params:xml:ns:yang:ietf-otn-tunnel
      prefix:       otn-tunnel
      reference:    RFC XXXX

      name:         ietf-otn-types
      namespace:    urn:ietf:params:xml:ns:yang:ietf-otn-types
      prefix:       otn-types
      reference:    RFC XXXX

9.

8.  Acknowledgements

   TBD.

10.

9.  Contributors

   Dieter Beller
   Nokia
   Email: dieter.beller@nokia.com

   Yanlei Zheng
   China Unicom
   Email: zhengyl@dimpt.com

   Xian Zhang
   Huawei Technologies
   Email: zhang.xian@huawei.com

   Lei Wang
   China Mobile
   Email: wangleiyj@chinamobile.com

   Oscar Gonzalez de Dios
   Telefonica
   Email: oscar.gonzalezdedios@telefonica.com

11.

10.  References

11.1.

10.1.  Normative References

   [I-D.ietf-ccamp-otn-topo-yang]
              Zheng, H., Guo, A., Busi, I., Sharma, A., Liu, X.,
              Belotti, S., Xu, Y., Wang, L., and O. Dios, "A YANG Data
              Model for Optical Transport Network Topology", draft-ietf-
              ccamp-otn-topo-yang-05
              ccamp-otn-topo-yang-07 (work in progress), August 2018. July 2019.

   [I-D.ietf-teas-yang-te]
              Saad, T., Gandhi, R., Liu, X., Beeram, V., and I. Bryskin,
              "A YANG Data Model for Traffic Engineering Tunnels and
              Interfaces", draft-ietf-teas-yang-te-19 draft-ietf-teas-yang-te-21 (work in
              progress), February April 2019.

   [ITU-T]    ITU-, T., "SERIES G: TRANSMISSION SYSTEMS AND MEDIA,
              DIGITAL SYSTEMS AND NETWORKS; Digital networks; Interfaces
              for the optical transport network", ITU-T Rec. G.709v5 ,
              June 2016.

   [RFC3688]  Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
              DOI 10.17487/RFC3688, January 2004,
              <https://www.rfc-editor.org/info/rfc3688>.

   [RFC6241]  Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
              and A. Bierman, Ed., "Network Configuration Protocol
              (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011,
              <https://www.rfc-editor.org/info/rfc6241>.

   [RFC6242]  Wasserman, M., "Using the NETCONF Protocol over Secure
              Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
              <https://www.rfc-editor.org/info/rfc6242>.

   [RFC7139]  Zhang, F., Ed., Zhang, G., Belotti, S., Ceccarelli, D.,
              and K. Pithewan, "GMPLS Signaling Extensions for Control
              of Evolving G.709 Optical Transport Networks", RFC 7139,
              DOI 10.17487/RFC7139, March 2014,
              <https://www.rfc-editor.org/info/rfc7139>.

   [RFC7950]  Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
              RFC 7950, DOI 10.17487/RFC7950, August 2016,
              <https://www.rfc-editor.org/info/rfc7950>.

   [RFC8040]  Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
              Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
              <https://www.rfc-editor.org/info/rfc8040>.

   [RFC8341]  Bierman, A. and M. Bjorklund, "Network Configuration
              Access Control Model", STD 91, RFC 8341,
              DOI 10.17487/RFC8341, March 2018,
              <https://www.rfc-editor.org/info/rfc8341>.

   [RFC8342]  Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K.,
              and R. Wilton, "Network Management Datastore Architecture
              (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018,
              <https://www.rfc-editor.org/info/rfc8342>.

   [RFC8446]  Rescorla, E., "The Transport Layer Security (TLS) Protocol
              Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
              <https://www.rfc-editor.org/info/rfc8446>.

11.2.

10.2.  Informative References

   [I-D.ietf-ccamp-transport-nbi-app-statement]
              Busi, I., King, D., Zheng, H., and Y. Xu, "Transport
              Northbound Interface Applicability Statement", draft-ietf-
              ccamp-transport-nbi-app-statement-04
              ccamp-transport-nbi-app-statement-05 (work in progress),
              November 2018.
              March 2019.

   [I-D.ietf-teas-actn-yang]
              Lee, Y., Zheng, H., Ceccarelli, D., Yoon, B., Dios, O.,
              Shin, J., and S. Belotti, "Applicability of YANG models
              for Abstraction and Control of Traffic Engineered
              Networks", draft-ietf-teas-actn-yang-03 (work in
              progress), February 2019.

   [RFC7062]  Zhang, F., Ed., Li, D., Li, H., Belotti, S., and D.
              Ceccarelli, "Framework for GMPLS and PCE Control of G.709
              Optical Transport Networks", RFC 7062,
              DOI 10.17487/RFC7062, November 2013,
              <https://www.rfc-editor.org/info/rfc7062>.

   [RFC7138]  Ceccarelli, D., Ed., Zhang, F., Belotti, S., Rao, R., and
              J. Drake, "Traffic Engineering Extensions to OSPF for
              GMPLS Control of Evolving G.709 Optical Transport
              Networks", RFC 7138, DOI 10.17487/RFC7138, March 2014,
              <https://www.rfc-editor.org/info/rfc7138>.

   [RFC8340]  Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams",
              BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018,
              <https://www.rfc-editor.org/info/rfc8340>.

Authors' Addresses

   Haomian Zheng
   Huawei Technologies
   H1-1-A043S Huawei Industrial Base, Songshanhu
   Dongguan, Guangdong  523808
   China

   Email: zhenghaomian@huawei.com

   Aihua Guo
   Huawei Technologies
   12007 Sunrise Valley Drive, Suite 325
   Reston, VA  20171
   U.S.A

   Email: aihuaguo@huawei.com
   Italo Busi
   Huawei Technologies
   HUAWEI TECHNOLOGIES ITALIA Srl Centro Direzionale Milano 2
   Milan, Milan  20090
   Italy

   Email: Italo.Busi@huawei.com

   Anurag Sharma
   Google
   1600 Amphitheatre Parkway
   Mountain View, CA  94043
   USA

   Email: ansha@google.com

   Rajan Rao
   Infinera
   169 Java Drive
   Sunnyvale, CA  94089
   USA

   Email: rrao@infinera.com

   Sergio Belotti
   Nokia

   Email: sergio.belotti@nokia.com

   Victor Lopez
   Telefonica

   Email: victor.lopezalvarez@telefonica.com

   Yunbo Li
   China Mobile

   Email: liyunbo@chinamobile.com
   Yunbin Xu
   CAICT

   Email: xuyunbin@ritt.cn