module Cisco-IOS-XR-infra-xtc-oper {
  namespace "http://cisco.com/ns/yang/Cisco-IOS-XR-infra-xtc-oper";
  prefix infra-xtc-oper;

  import ietf-inet-types {
    prefix inet;
  }
  import Cisco-IOS-XR-types {
    prefix xr;
  }
  import cisco-semver {
    prefix semver;
  }
  include Cisco-IOS-XR-infra-xtc-oper-sub1 {
    revision-date 2019-10-02;
  }

  organization
    "Cisco Systems, Inc.";
  contact
    "Cisco Systems, Inc.
     Customer Service
     
     Postal: 170 West Tasman Drive
     San Jose, CA 95134
     
     Tel: +1 800 553-NETS
     
     E-mail: cs-yang@cisco.com";
  description
    "This module contains a collection of YANG definitions
     for Cisco IOS-XR infra-xtc package operational data.
     
     This module contains definitions
     for the following management objects:
       pce-lsp-data: PCE LSP's data
       pce-peer: PCE peer data
       pce-topology: PCE topology data
       pce: PCE operational data
     
     Copyright (c) 2013-2019 by Cisco Systems, Inc.
     All rights reserved.";

  revision 2019-10-02 {
    description
      "Added REST peer statistic information.
       2019-09-27
         Implement new show pce lsp and show pce initiated tunnels commands for Optima";
    semver:module-version "1.1.0";
  }
  revision 2019-04-05 {
    description
      "Establish semantic version baseline.";
  }
  revision 2017-09-07 {
    description
      "Fixed type translation error.";
  }
  revision 2017-08-24 {
    description
      "Added C flag to pcep flags.";
  }
  revision 2017-06-26 {
    description
      "Change identifiers to be more readable.";
  }
  revision 2017-05-01 {
    description
      "Fixing backward compatibility error in module.";
  }
  revision 2016-05-31 {
    description
      "Revision description string.";
  }
  revision 2015-11-09 {
    description
      "IOS XR 6.0 revision.";
  }

  typedef Pceigp-protocol {
    type enumeration {
      enum "unknown" {
        value 0;
        description
          "Unknown protocol";
      }
      enum "isis" {
        value 1;
        description
          "ISIS protocol";
      }
      enum "ospf" {
        value 2;
        description
          "OSPF protocol";
      }
      enum "bgp" {
        value 4;
        description
          "BGP protocol";
      }
      enum "te" {
        value 8;
        description
          "TE protocol";
      }
    }
    description
      "Pceigp protocol";
  }

  typedef Pce-asso {
    type enumeration {
      enum "unknown" {
        value 0;
        description
          "Unknown type";
      }
      enum "link" {
        value 1;
        description
          "LINK";
      }
      enum "node" {
        value 2;
        description
          "NODE";
      }
      enum "srlg" {
        value 3;
        description
          "SRLG";
      }
    }
    description
      "Pce asso";
  }

  typedef Pce-address-family {
    type enumeration {
      enum "ipv4" {
        value 1;
        description
          "IPv4 address family";
      }
      enum "ipv6" {
        value 2;
        description
          "IPv6 address family";
      }
    }
    description
      "Pce address family";
  }

  grouping PEER-TABLE {
    description
      "Common node of pce, pce-peer";
    container peer-infos {
      description
        "Peers database in XTC";
      list peer-info {
        key "peer-address";
        description
          "PCE peer information";
        leaf peer-address {
          type inet:ip-address-no-zone;
          description
            "Peer Address";
        }
        uses PCE-PEER-BAG;
      }
    }
  }

  grouping PEER-DETAIL-TABLE {
    description
      "Common node of pce, pce-peer";
    container peer-detail-infos {
      description
        "Detailed peers database in XTC";
      list peer-detail-info {
        key "peer-address";
        description
          "Detailed PCE peer information";
        leaf peer-address {
          type inet:ip-address-no-zone;
          description
            "Peer Address";
        }
        uses PCE-PEER-DETAIL-BAG;
      }
    }
  }

  grouping PREFIX-TABLE {
    description
      "Common node of pce, pce-topology";
    container prefix-infos {
      description
        "Prefixes database in XTC";
      list prefix-info {
        key "node-identifier";
        description
          "PCE prefix information";
        leaf node-identifier {
          type uint32;
          description
            "Node ID";
        }
        uses PCE-PFX-BAG;
      }
    }
  }

  grouping TUNNEL-TABLE {
    description
      "Common node of pce, pce-lsp-data";
    container tunnel-infos {
      description
        "Tunnel database in XTC";
      list tunnel-info {
        key "peer-address plsp-id tunnel-name";
        description
          "Tunnel information";
        leaf peer-address {
          type inet:ip-address-no-zone;
          description
            "Peer Address";
        }
        leaf plsp-id {
          type uint32;
          description
            "PCEP LSP ID";
        }
        leaf tunnel-name {
          type string;
          description
            "Tunnel name";
        }
        uses PCE-TUN-BAG;
      }
    }
  }

  grouping LSP-SUMMARY {
    description
      "Common node of pce, pce-lsp-data";
    container lsp-summary {
      description
        "LSP summary database in XTC";
      uses PCE-LSP-SUMMARY-BAG;
    }
  }

  grouping TOPOLOGY-SUMMARY-TABLE {
    description
      "Common node of pce, pce-topology";
    container topology-summaries {
      description
        "Node summary database in XTC";
      list topology-summary {
        description
          "Node summary database in XTC";
        leaf af {
          type Pce-address-family;
          description
            "Only show data related to the specified
             address family";
        }
        leaf protocol {
          type Pceigp-protocol;
          description
            "Match nodes from the specified IGP protocol";
        }
        uses PCE-NODE-SUMMARY-BAG;
      }
    }
  }

  grouping TOPOLOGY-NODE-TABLE {
    description
      "Common node of pce, pce-topology";
    container topology-nodes {
      description
        "Node database in XTC";
      list topology-node {
        key "node-identifier";
        description
          "Node information";
        leaf node-identifier {
          type uint32;
          description
            "Node Identifier";
        }
        uses PCE-XTC-NODE-BAG;
      }
    }
  }

  grouping TUNNEL-DETAIL-TABLE {
    description
      "Common node of pce, pce-lsp-data";
    container tunnel-detail-infos {
      description
        "Detailed tunnel database in XTC";
      list tunnel-detail-info {
        key "peer-address plsp-id tunnel-name";
        description
          "Detailed tunnel information";
        leaf peer-address {
          type inet:ip-address-no-zone;
          description
            "Peer Address";
        }
        leaf plsp-id {
          type uint32;
          description
            "PCEP LSP ID";
        }
        leaf tunnel-name {
          type string;
          description
            "Tunnel name";
        }
        uses PCE-TUN-DETAIL-BAG;
      }
    }
  }

  container pce-lsp-data {
    config false;
    description
      "PCE LSP's data";
    uses TUNNEL-TABLE;
    uses LSP-SUMMARY;
    uses TUNNEL-DETAIL-TABLE;
  }
  container pce-peer {
    config false;
    description
      "PCE peer data";
    uses PEER-DETAIL-TABLE;
    uses PEER-TABLE;
  }
  container pce-topology {
    config false;
    description
      "PCE topology data";
    uses TOPOLOGY-NODE-TABLE;
    uses TOPOLOGY-SUMMARY-TABLE;
    uses PREFIX-TABLE;
  }
  container pce {
    config false;
    description
      "PCE operational data";
    container cspf-sr-mpls {
      description
        "CSPF for SR MPLS path info";
      container cspf-sr-mpls-paths {
        description
          "This table models the path calculation
           capabilities in XTC.A GET operation for the
           complete table will return no entries.";
        list cspf-sr-mpls-path {
          description
            "A GET operation on this class returns the path
             .";
          leaf af {
            type uint32;
            description
              "Address Family";
          }
          leaf source1 {
            type inet:ip-address-no-zone;
            description
              "Source of path 1";
          }
          leaf destination1 {
            type inet:ip-address-no-zone;
            description
              "Destination of path 1";
          }
          leaf metric-type {
            type uint32;
            description
              "Metric type";
          }
          leaf source2 {
            type inet:ip-address-no-zone;
            description
              "Source of path 2";
          }
          leaf destination2 {
            type inet:ip-address-no-zone;
            description
              "Destination of path 2";
          }
          leaf disjoint-level {
            type uint32;
            description
              "Disjointness level";
          }
          leaf disjoint-strict {
            type uint32;
            description
              "Strict disjointness required";
          }
          leaf shortest-path {
            type uint32;
            description
              "Whether path 1 or 2 should be shortest";
          }
          leaf msd1 {
            type uint32;
            description
              "MSD for path 1";
          }
          leaf msd2 {
            type uint32;
            description
              "MSD for path 2";
          }
          leaf relative-margin {
            type uint32;
            description
              "Relative Margin";
          }
          leaf absolute-margin {
            type uint32;
            description
              "Absolute Margin";
          }
          leaf affinity-include-all {
            type uint32;
            description
              "Affinity include-all constraint";
          }
          leaf affinity-include-any {
            type uint32;
            description
              "Affinity include-any constraint";
          }
          leaf affinity-exclude-any {
            type uint32;
            description
              "Affinity exclude-any constraint";
          }
          uses PCE-SR-MPLS-PATH-LIST-BAG;
        }
      }
    }
    container verification-events {
      description
        "PCE Verification events in XTC";
      list verification-event {
        key "event-idx";
        description
          "PCE single verification event";
        leaf event-idx {
          type uint32;
          description
            "Index of an event";
        }
        uses PCE-EVENT-INFO;
      }
    }
    container p2mp-policies {
      description
        "P2MP policy database in XTC";
      list p2mp-policy {
        key "name";
        description
          "Policy information";
        leaf name {
          type xr:Cisco-ios-xr-string;
          description
            "Policy name";
        }
        uses PCE-TREESID-BAG;
      }
    }
    container peer-summaries {
      description
        "Detailed PCE peer information";
      list peer-summary {
        key "af";
        description
          "Summary PCE peer information";
        leaf af {
          type Pce-address-family;
          description
            "Only show data related to the specified
             address family";
        }
        uses PCE-PEER-SUMMARY-BAG;
      }
    }
    container work-nodes {
      description
        "Work node database";
      list work-node {
        key "index";
        description
          "Path work node information";
        leaf index {
          type uint32;
          description
            "Position in work list";
        }
        uses PATH-WORK-NODE;
      }
    }
    container trace-buffer-summaries {
      description
        "Summary of all trace buffers";
      list trace-buffer-summary {
        key "name";
        description
          "Summary of specific trace buffer";
        leaf name {
          type xr:Cisco-ios-xr-string;
          description
            "Trace buffer name";
        }
        uses CMN-TRACE-BUFFER-SUMMARY-BAG;
      }
    }
    container association-infos {
      description
        "Associaition database in XTC";
      list association-info {
        key "group-id";
        description
          "PCE Association information";
        leaf group-id {
          type uint32;
          description
            "Group ID";
        }
        leaf type {
          type Pce-asso;
          description
            "Type";
        }
        leaf sub-id {
          type inet:ip-address-no-zone;
          description
            "Sub ID";
        }
        uses PCE-ASSO-BAG;
      }
    }
    container work-groups {
      description
        "Work group database";
      list work-group {
        key "algo";
        description
          "Path work group information";
        leaf algo {
          type uint32;
          description
            "Algorithm";
        }
        leaf metric-type {
          type uint32;
          description
            "Metric Type";
        }
        leaf msd {
          type uint32;
          description
            "Max SID Depth";
        }
        leaf inc-all {
          type uint32;
          description
            "Include-All affinity";
        }
        leaf exc-any {
          type uint32;
          description
            "Exclude-Any affinity";
        }
        leaf inc-any {
          type uint32;
          description
            "Include-Any affinity";
        }
        uses PATH-WORK-GROUP;
      }
    }
    container paths {
      description
        "This table models the path calculation
         capabilities in XTC.A GET operation for the
         complete table will return no entries.";
      list path {
        key "af source destination";
        description
          "A GET operation on this class returns the path.";
        leaf af {
          type uint32;
          description
            "Address Family";
        }
        leaf source {
          type inet:ip-address-no-zone;
          description
            "Source of path";
        }
        leaf destination {
          type inet:ip-address-no-zone;
          description
            "Destination of path";
        }
        uses PCE-PATH-BAG;
      }
    }
    container cspf {
      description
        "CSPF path info";
      container cspf-paths {
        description
          "This table models the path calculation
           capabilities in XTC.A GET operation for the
           complete table will return no entries.";
        list cspf-path {
          description
            "A GET operation on this class returns the path
             .";
          leaf af {
            type uint32;
            description
              "Address Family";
          }
          leaf source1 {
            type inet:ip-address-no-zone;
            description
              "Source of path 1";
          }
          leaf destination1 {
            type inet:ip-address-no-zone;
            description
              "Destination of path 1";
          }
          leaf metric-type {
            type uint32;
            description
              "Metric type";
          }
          leaf source2 {
            type inet:ip-address-no-zone;
            description
              "Source of path 2";
          }
          leaf destination2 {
            type inet:ip-address-no-zone;
            description
              "Destination of path 2";
          }
          leaf disjoint-level {
            type uint32;
            description
              "Disjointness level";
          }
          leaf disjoint-strict {
            type uint32;
            description
              "Strict disjointness required";
          }
          leaf shortest-path {
            type uint32;
            description
              "Whether path 1 or 2 should be shortest";
          }
          uses PCE-PATH-LIST-BAG;
        }
      }
    }
    container statistics-nodes {
      description
        "PCE REST peer statistics";
      list statistics-node {
        key "af";
        description
          "PCE REST peer statistics information";
        leaf af {
          type Pce-address-family;
          description
            "Specify Address family";
        }
        leaf ip {
          type inet:ip-address-no-zone;
          description
            "Specify IPv4 or v6 Address";
        }
        uses REST-PEER-STATS-BAG;
      }
    }
    uses TUNNEL-TABLE;
    uses PEER-DETAIL-TABLE;
    uses TOPOLOGY-NODE-TABLE;
    uses TOPOLOGY-SUMMARY-TABLE;
    uses PREFIX-TABLE;
    uses LSP-SUMMARY;
    uses PEER-TABLE;
    uses TUNNEL-DETAIL-TABLE;
  }
}
