huawei-srpolicy

Segment Routing Policy.

  • Version: 2020-09-14

    huawei-srpolicy@2020-09-14


    
      module huawei-srpolicy {
    
        yang-version 1;
    
        namespace
          "urn:huawei:yang:huawei-srpolicy";
    
        prefix srpolicy;
    
        import huawei-extension {
          prefix ext;
        }
        import huawei-segment-routing {
          prefix sr;
        }
        import huawei-network-instance {
          prefix ni;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import huawei-srv6 {
          prefix srv6;
        }
        import ietf-yang-types {
          prefix yang;
        }
        import huawei-pub-type {
          prefix pub-type;
        }
    
        include huawei-srpolicy-type;
    
        organization
          "Huawei Technologies Co., Ltd.";
    
        contact
          "Huawei Industrial Base
    Bantian, Longgang
    Shenzhen 518129
    People's Republic of China
    Website: http://www.huawei.com
    Email: support@huawei.com";
    
        description "Segment Routing Policy.";
    
        revision "2020-09-14" {
          description
            "Increate the weight and BFD bypass and attribute template.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-08-14" {
          description "Increate sid compress.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-06-28" {
          description
            "Modify description information.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-06-20" {
          description
            "Modify the type of template info.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-06-01" {
          description
            "Increate the path verification.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-05-28" {
          description
            "Increate the policy-template.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-05-25" {
          description
            "Increate the policy-maps.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-05-20" {
          description
            "Modify the srpolicy, admin-state.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-03-26" {
          description
            "Modify description information by new rules.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-03-24" {
          description
            "Modify the policy-attributes.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-03-16" {
          description
            "Modify description information by new rules.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-02-28" {
          description
            "Modify description information.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-02-17" {
          description "Increate the path-mtu.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-01-03" {
          description
            "Modify description information.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-11-18" {
          description
            "Increate the SR-MPLS TE Policy group.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-04-04" {
          description "Init revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "srpolicy";
    
        grouping bfd {
          description
            "SR Policy BFD configuration.";
          container bfd {
            description
              "Configure SR Policy BFD.";
            leaf enable {
              type bfd-enable-type;
              default "disable";
              description
                "Enable seamless-bfd for all SR Policies.";
            }
    
            leaf bypass {
              type bfd-bypass-type;
              default "bypass";
              description
                "Enable BFD bypass for all SR policies.";
            }
    
            leaf min-tx {
              type uint32 {
                range "1..4294967295";
              }
              units "ms";
              default "10";
              description
                "Minimum interval for sending seamless-bfd packets to the peer end.";
            }
    
            leaf min-rx {
              type uint32 {
                range "1..4294967295";
              }
              units "ms";
              default "10";
              description
                "Minimum interval for receiving seamless-bfd packets from the peer end.";
            }
    
            leaf multi-num {
              type uint32 {
                range "3..50";
              }
              default "3";
              description
                "Local detection multiplier.";
            }
    
            leaf backup-min-tx {
              type uint32 {
                range "1..4294967295";
              }
              units "ms";
              description
                "Minimum interval for sending seamless-bfd packets to the peer end over the backup candidate path.";
            }
    
            leaf backup-multi-num {
              type uint32 {
                range "3..50";
              }
              description
                "Local detection multiplier over the backup candidate path.";
            }
          }  // container bfd
        }  // grouping bfd
    
        grouping global-attributes {
          description
            "SR Policy global configuration.";
          leaf switch-delay {
            type uint32 {
              range "0..600000";
            }
            units "ms";
            default "5000";
            description "MBB switch delay time.";
          }
    
          leaf delete-delay {
            type uint32 {
              range "0..600000";
            }
            units "ms";
            default "20000";
            description "MBB delete delay time.";
          }
    
          leaf hsb-enable {
            type boolean;
            default "false";
            description
              "Enable/disable hot standby.";
          }
    
          leaf traffic-statistics-enable {
            type boolean;
            default "false";
            description
              "Enable/disable traffic statistics collection.";
          }
    
          leaf bgp-ls-enable {
            type boolean;
            default "false";
            description "Enable/disable BGP-LS.";
          }
    
          leaf path-verification {
            type boolean;
            default "false";
            description
              "Enable/disable path verification.";
          }
    
          leaf path-verification-specified-sid {
            when "(../path-verification='true')";
            type boolean;
            default "false";
            description
              "Enable/disable path verification for specified-sid.";
          }
    
          leaf suppress-flapping {
            type boolean;
            default "true";
            description
              "Enable/disable suppress flapping.";
          }
    
          leaf policy-threshold-upper {
            type uint32 {
              range "2..100";
            }
            must
              "(../policy-threshold-upper>../policy-threshold-lower)";
            default "80";
            description
              "SR Policy threshold upper limit.";
          }
    
          leaf policy-threshold-lower {
            type uint32 {
              range "1..99";
            }
            default "75";
            description
              "SR Policy threshold lower limit.";
          }
    
          leaf list-threshold-upper {
            type uint32 {
              range "2..100";
            }
            must
              "(../list-threshold-upper>../list-threshold-lower)";
            default "80";
            description
              "Segment List threshold upper limit.";
          }
    
          leaf list-threshold-lower {
            type uint32 {
              range "1..99";
            }
            default "75";
            description
              "Segment List threshold lower limit.";
          }
    
          uses bfd;
        }  // grouping global-attributes
    
        grouping srv4-segment-lists {
          description "Global segment lists.";
          container segment-lists {
            description
              "List of global segment lists.";
            list segment-list {
              key "name";
              description
                "Configure a global segment list.";
              leaf name {
                type string {
                  length "1..31";
                  pattern '[^ \?]*';
                }
                description
                  "Global segment list name.";
              }
    
              container segments {
                description
                  "List of segments in a global segment list.";
                list segment {
                  key "index";
                  max-elements 10;
                  description
                    "Configure a segment in a global segment list.";
                  leaf index {
                    type uint32 {
                      range "0..4294967295";
                    }
                    description
                      "The segment index.";
                  }
    
                  choice type {
                    mandatory true;
                    description
                      "The segment type.";
                    case segment-type-1 {
                      description
                        "The segment is declared by MPLS label.";
                      leaf sid-value-1 {
                        type uint32 {
                          range "16..1048575";
                        }
                        description
                          "MPLS label value.";
                      }
                    }  // case segment-type-1
                  }  // choice type
                }  // list segment
              }  // container segments
            }  // list segment-list
          }  // container segment-lists
        }  // grouping srv4-segment-lists
    
        grouping srv6-segment-lists {
          description "Global segment lists.";
          container segment-lists {
            description
              "List of global segment lists.";
            list segment-list {
              key "name";
              description
                "Configure a global segment list.";
              leaf name {
                type string {
                  length "1..31";
                  pattern '[^ \?]*';
                }
                description
                  "Global segment list name.";
              }
    
              container segments {
                description
                  "List of segments in a global segment list.";
                list segment {
                  key "index";
                  max-elements 10;
                  description
                    "Configure a segment in a global segment list.";
                  leaf index {
                    type uint32 {
                      range "0..4294967295";
                    }
                    description
                      "The segment index.";
                  }
    
                  choice type {
                    mandatory true;
                    description
                      "The segment type.";
                    case segment-type-2 {
                      description
                        "The segment is declared by SRv6 SID value.";
                      leaf sid-value-2 {
                        type inet:ipv6-address-no-zone;
                        mandatory true;
                        description
                          "SRv6 sid value.";
                      }
    
                      leaf block-length {
                        type uint32 {
                          range "4..88";
                        }
                        must
                          "((../block-length) mod 4 = 0)";
                        description
                          "SRv6 SID block length.";
                      }
    
                      leaf verification {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable verification of SID.";
                      }
                    }  // case segment-type-2
                  }  // choice type
                }  // list segment
              }  // container segments
            }  // list segment-list
          }  // container segment-lists
        }  // grouping srv6-segment-lists
    
        grouping srv6-policy-attributes {
          description
            "Grouping containing attributes applicable to all SR policies.";
          container policy-attributes {
            description
              "Configure attributes for all SR policies.";
            uses global-attributes;
    
            leaf locator {
              ext:operation-exclude "update";
              type leafref {
                path "/ni:network-instance/ni:instances/ni:instance/srv6:srv6/srv6:locators/srv6:locator/srv6:name";
              }
              description "Locator Name.";
            }
    
            uses srv6-segment-lists;
          }  // container policy-attributes
        }  // grouping srv6-policy-attributes
    
        grouping srv4-policy-attributes {
          description
            "Grouping containing attributes applicable to all SR policies.";
          container policy-attributes {
            description
              "Configure attributes for all SR policies.";
            uses global-attributes;
    
            uses srv4-segment-lists;
          }  // container policy-attributes
        }  // grouping srv4-policy-attributes
    
        grouping candidate-paths {
          description
            "Grouping containing candidate paths to all SR policies.";
          container candidate-paths {
            description
              "List of candidate paths in an SR Policy.";
            list candidate-path {
              must "(discriminator=preference)";
              key "protocol-origin originator discriminator";
              max-elements 64;
              description
                "Configure a candidate path.";
              leaf protocol-origin {
                type protocol-origin-type;
                must
                  "(../protocol-origin='configuration')";
                description
                  "Candidate path protocol origin.";
              }
    
              leaf originator {
                type string {
                  length "1..60";
                }
                must
                  "(../originator='0,0.0.0.0')";
                description
                  "Candidate path originator.";
              }
    
              leaf discriminator {
                type uint32 {
                  range "1..65535";
                }
                description
                  "Candidate path discriminator.";
              }
    
              leaf preference {
                type uint32 {
                  range "1..65535";
                }
                mandatory true;
                description
                  "Candidate path preference.";
              }
    
              choice type {
                description
                  "Type of candidate paths.";
                case explicit {
                  description
                    "Candidate path with explicitly defined set/s of segment-lists.";
                  container segment-lists {
                    description
                      "List of segment lists in a candidate path.";
                    list segment-list {
                      key "name";
                      max-elements 64;
                      description
                        "Configure a segment list for a candidate path.";
                      leaf name {
                        type leafref {
                          path
                            "../../../../../../../policy-attributes/segment-lists/segment-list/name";
                        }
                        description
                          "Segment list name.";
                      }
    
                      leaf weight {
                        type uint32 {
                          ext:value-meaning {
                            ext:item "0" {
                              ext:meaning "Invalid";
                              description "The segment list is invalid when weight is 0.";
                            }
                          }
                          range "0..4294967295";
                        }
                        default "1";
                        description
                          "Segment-list weighted loadshare.";
                      }
    
                      leaf path-mtu {
                        type uint32 {
                          range "1280..9600";
                        }
                        description
                          "Segment-list path-mtu.";
                      }
                    }  // list segment-list
                  }  // container segment-lists
                }  // case explicit
              }  // choice type
    
              leaf template-id {
                type leafref {
                  path "/srpolicy:srpolicy/srpolicy:attribute-templates/srpolicy:attribute-template/srpolicy:id";
                }
                description
                  "Attribute template ID.";
              }
    
              leaf network-slice-id {
                type uint32 {
                  range "1..4294967295";
                }
                description
                  "Network slice ID of a candidate path.";
              }
            }  // list candidate-path
          }  // container candidate-paths
        }  // grouping candidate-paths
    
        grouping srv4-policys {
          description "SR policy grouping.";
          container policys {
            description "List of SR Policies.";
            list policy {
              key "endpoint color";
              unique "name";
              unique "binding-sid/value";
              description
                "Configure an SR Policy.";
              leaf endpoint {
                type inet:ip-address;
                description
                  "SR Policy endpoint address.";
              }
    
              leaf color {
                type uint32 {
                  range "0..4294967295";
                }
                description "SR Policy color.";
              }
    
              leaf name {
                type string {
                  length "1..31";
                  pattern '[^ \?]*';
                }
                mandatory true;
                description "SR Policy name.";
              }
    
              container binding-sid {
                description
                  "Configure a binding SID.";
                leaf dataplane {
                  type dataplane-type;
                  must "(../dataplane='mpls')";
                  description
                    "Binding sid dataplane type.";
                }
    
                leaf value {
                  when "(../dataplane='mpls')";
                  type sid-value-type;
                  mandatory true;
                  description
                    "Binding sid value.";
                }
              }  // container binding-sid
    
              leaf admin-state {
                type admin-state-type;
                default "up";
                description
                  "Close the function of SR Policy.";
              }
    
              leaf mtu {
                type uint32 {
                  range "512..9600";
                }
                description
                  "SR Policy mtu value.";
              }
    
              leaf hsb-enable {
                type enable-3types;
                default "not-configured";
                description
                  "SR Policy hot standby.";
              }
    
              leaf bfd-enable {
                type policy-bfd-enable-type;
                default "not-configured";
                description "SR Policy BFD.";
              }
    
              leaf traffic-statistics-enable {
                type enable-3types;
                default "not-configured";
                description
                  "SR Policy traffic statistics.";
              }
    
              container diffserv-mode {
                description
                  "Configure the DiffServ mode in an SR Policy.";
                leaf pipe-mode {
                  type pipe-mode-type;
                  description
                    "Specifies the pipe mode of SR Policy.";
                }
    
                leaf service-class {
                  when "../pipe-mode='pipe'";
                  type serv-class-types;
                  mandatory true;
                  description
                    "Service class of SR Policy.";
                }
    
                leaf service-color {
                  when "../pipe-mode='pipe'";
                  type serv-color-types;
                  mandatory true;
                  description
                    "Service color of SR Policy.";
                }
              }  // container diffserv-mode
    
              uses candidate-paths;
            }  // list policy
          }  // container policys
        }  // grouping srv4-policys
    
        grouping srv6-policys {
          description "SR policy grouping.";
          container policys {
            description "List of SR Policies.";
            list policy {
              key "endpoint color";
              unique "name";
              unique "binding-sid/value";
              description
                "Configure an SR Policy.";
              leaf endpoint {
                type inet:ip-address;
                description
                  "SR Policy endpoint address.";
              }
    
              leaf color {
                type uint32 {
                  range "0..4294967295";
                }
                description "SR Policy color.";
              }
    
              leaf name {
                type string {
                  length "1..31";
                  pattern '[^ \?]*';
                }
                mandatory true;
                description "SR Policy name.";
              }
    
              container binding-sid {
                must
                  "(not(../binding-sid/value) or (../binding-sid/value and ../../../policy-attributes/locator and /ni:network-instance/ni:instances/ni:instance[ni:name='_public_']/srv6:srv6/srv6:locators/srv6:locator[srv6:name=/ni:network-instance/ni:instances/ni:instance[ni:name='_public_']/srv6:srv6/srpolicy:srpolicy/srpolicy:policy-attributes/srpolicy:locator]/srv6:static-length>0))";
                description
                  "Configure a binding SID.";
                leaf dataplane {
                  type dataplane-type;
                  must "(../dataplane='srv6')";
                  description
                    "Binding sid dataplane type.";
                }
    
                leaf value {
                  when "(../dataplane='srv6')";
                  type sid-value-type;
                  mandatory true;
                  description
                    "Binding sid value.";
                }
              }  // container binding-sid
    
              leaf admin-state {
                type admin-state-type;
                default "up";
                description
                  "Close the function of SR Policy.";
              }
    
              leaf mtu {
                type uint32 {
                  range "512..9600";
                }
                description
                  "SR Policy mtu value.";
              }
    
              leaf hsb-enable {
                type enable-3types;
                default "not-configured";
                description
                  "SR Policy hot standby.";
              }
    
              leaf bfd-enable {
                type policy-bfd-enable-type;
                default "not-configured";
                description "SR Policy BFD.";
              }
    
              leaf bfd-bypass {
                type policy-bfd-bypass-type;
                default "not-configured";
                description
                  "SR policy BFD bypass.";
              }
    
              leaf bfd-min-tx {
                type uint32 {
                  range "1..4294967295";
                }
                units "ms";
                description
                  "Minimum interval for sending BFD packets to the peer end.";
              }
    
              leaf bfd-multi-num {
                type uint32 {
                  range "3..50";
                }
                description
                  "Local detection multiplier.";
              }
    
              leaf bfd-backup-min-tx {
                type uint32 {
                  range "1..4294967295";
                }
                units "ms";
                description
                  "Minimum interval for sending BFD packets to the peer end over the backup candidate path.";
              }
    
              leaf bfd-backup-multi-num {
                type uint32 {
                  range "3..50";
                }
                description
                  "Local detection multiplier over the backup candidate path.";
              }
    
              leaf traffic-statistics-enable {
                type enable-3types;
                default "not-configured";
                description
                  "SR Policy traffic statistics.";
              }
    
              leaf path-verification {
                type path-verification-type;
                default "not-configured";
                description
                  "SR Policy path verification.";
              }
    
              leaf encapsulation-mode {
                type encapsulation-cfg-type;
                description
                  "SR Policy encapsulation mode.";
              }
    
              container diffserv-mode {
                description
                  "Configure the DiffServ mode in an SR Policy.";
                leaf pipe-mode {
                  type pipe-mode-type;
                  description
                    "Specifies the pipe mode of SR Policy.";
                }
    
                leaf service-class {
                  when "../pipe-mode='pipe'";
                  type serv-class-types;
                  mandatory true;
                  description
                    "Service class of SR Policy.";
                }
    
                leaf service-color {
                  when "../pipe-mode='pipe'";
                  type serv-color-types;
                  mandatory true;
                  description
                    "Service color of SR Policy.";
                }
              }  // container diffserv-mode
    
              uses candidate-paths;
            }  // list policy
          }  // container policys
        }  // grouping srv6-policys
    
        grouping policy-groups {
          description
            "SR-MPLS TE Policy group grouping.";
          container policy-groups {
            description
              "List of SR-MPLS TE Policy groups.";
            list policy-group {
              key "index";
              description
                "Configure an SR-MPLS TE Policy group.";
              leaf index {
                type uint32 {
                  range "1..4294967295";
                }
                description
                  "SR-MPLS TE Policy group id.";
              }
    
              leaf endpoint {
                type inet:ip-address;
                description
                  "SR-MPLS TE Policy IPv4 endPoint address.";
              }
    
              leaf state {
                type state-type;
                config false;
                description
                  "SR-MPLS TE Policy group state.";
              }
    
              leaf tunnel-id {
                type uint32;
                config false;
                description
                  "SR-MPLS TE Policy group tunnel id.";
              }
    
              leaf tunnel-type {
                type tunnel-type;
                config false;
                description
                  "SR-MPLS TE Policy group tunnel type.";
              }
    
              leaf match-count {
                type uint32;
                config false;
                description
                  "SR-MPLS TE Policy group match count.";
              }
    
              leaf up-match-count {
                type uint32;
                config false;
                description
                  "SR-MPLS TE Policy group up match count.";
              }
    
              container color-dscp-matchs {
                description
                  "List of color-address family-DSCP mappings for an SR-MPLS TE Policy.";
                list color-dscp-match {
                  key "color af-type";
                  max-elements 128;
                  description
                    "Configure a color-address family-DSCP mapping for an SR-MPLS TE Policy.";
                  leaf color {
                    type uint32 {
                      range "0..4294967295";
                    }
                    description
                      "SR-MPLS TE Policy color.";
                  }
    
                  leaf af-type {
                    type address-family-type;
                    description
                      "Address family.";
                  }
    
                  leaf default {
                    type boolean;
                    default "false";
                    description
                      "Enable/disable the default SR-MPLS TE Policy.";
                  }
    
                  leaf dscp-value {
                    when
                      "not(../default='true')";
                    type pub-type:id-range {
                    }
                    mandatory true;
                    description "DSCP Value.";
                  }
    
                  leaf policy-tunnel-id {
                    type uint32;
                    config false;
                    description
                      "SR-MPLS TE Policy tunnel ID.";
                  }
                }  // list color-dscp-match
              }  // container color-dscp-matchs
            }  // list policy-group
          }  // container policy-groups
        }  // grouping policy-groups
    
        grouping traffic-statistics {
          description
            "SR Policy traffic statistics grouping.";
          container policy-traffic-statistics {
            config false;
            description
              "List of traffic statistics for SR Policies.";
            list policy-traffic-statistic {
              key "endpoint color";
              description
                "Traffic statistics for an SR Policy.";
              leaf endpoint {
                type inet:ip-address-no-zone;
                description
                  "Destination address of an SR Policy.";
              }
    
              leaf color {
                type uint32 {
                  range "0..4294967295";
                }
                description
                  "Color of an SR Policy.";
              }
    
              leaf name {
                ext:support-filter "true";
                type string {
                  length "1..31";
                }
                description "Policy name.";
              }
    
              leaf binding-sid {
                ext:support-filter "true";
                type sid-value-type;
                description
                  "Binding SID of an SR Policy.";
              }
    
              leaf tunnel-id {
                type uint32;
                description
                  "Tunnel ID of an SR Policy.";
              }
    
              leaf flow-period {
                type uint32 {
                  range "0..4294967295";
                }
                units "s";
                description
                  "Traffic statistics collection period.";
              }
    
              leaf last-period-byte-rate {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "Byte/s";
                description
                  "Byte rate in the latest period.";
              }
    
              leaf last-period-pkt-rate {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "pps";
                description
                  "Packet rate in the latest period.";
              }
    
              leaf display-interval {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "s";
                description
                  "Interval between two queries.";
              }
    
              leaf interval-byte-rate {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "Byte/s";
                description
                  "Byte rate between two queries.";
              }
    
              leaf interval-pkt-rate {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "pps";
                description
                  "Packet rate between two queries.";
              }
    
              leaf total-byte {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "Byte";
                description
                  "Total number of transmitted bytes.";
              }
    
              leaf total-packet {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "packet";
                description
                  "Total number of transmitted packets.";
              }
            }  // list policy-traffic-statistic
          }  // container policy-traffic-statistics
    
          container list-traffic-statistics {
            config false;
            description
              "List of traffic statistics for segment lists.";
            list list-traffic-statistic {
              key "segment-list-id";
              description
                "Traffic statistics for a segment list.";
              leaf segment-list-id {
                type uint32 {
                  range "1..4294967295";
                }
                description "Segment list ID.";
              }
    
              leaf xc-index {
                type uint32;
                description "XC index.";
              }
    
              leaf policy-name {
                ext:support-filter "true";
                type string {
                  length "1..31";
                }
                description "Policy name.";
              }
    
              leaf endpoint {
                ext:support-filter "true";
                type inet:ip-address-no-zone;
                description
                  "Destination address of an SR Policy.";
              }
    
              leaf color {
                ext:support-filter "true";
                type uint32 {
                  range "0..4294967295";
                }
                description
                  "Color of an SR Policy.";
              }
    
              leaf binding-sid {
                ext:support-filter "true";
                type sid-value-type;
                description
                  "Binding SID of an SR Policy.";
              }
    
              leaf tunnel-id {
                type uint32;
                description
                  "Tunnel ID of an SR Policy.";
              }
    
              leaf preference {
                type uint32 {
                  range "0..4294967295";
                }
                description
                  "Preference of a candidate path.";
              }
    
              leaf protocol-origin {
                type protocol-origin-type;
                description
                  "Protocol origin of a candidate path.";
              }
    
              leaf asn {
                type uint32;
                description "AS number.";
              }
    
              leaf node-address {
                type inet:ipv4-address-no-zone;
                description "Node address.";
              }
    
              leaf discriminator {
                type uint32 {
                  range "0..4294967295";
                }
                description
                  "Discriminator of a candidate path.";
              }
    
              leaf path-type {
                type path-type;
                description
                  "Type of a candidate path.";
              }
    
              container sids {
                description "List of SIDs.";
                list sid {
                  key "index";
                  max-elements 10;
                  description
                    "Operational data of SID.";
                  leaf index {
                    type uint32 {
                      range "0..4294967295";
                    }
                    description "SID index.";
                  }
    
                  leaf value {
                    type sid-value-type;
                    description "SID value.";
                  }
                }  // list sid
              }  // container sids
    
              leaf flow-period {
                type uint32 {
                  range "0..4294967295";
                }
                units "s";
                description
                  "Traffic statistics collection period.";
              }
    
              leaf last-period-byte-rate {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "Byte/s";
                description
                  "Byte rate in the latest period.";
              }
    
              leaf last-period-pkt-rate {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "pps";
                description
                  "Packet rate in the latest period.";
              }
    
              leaf display-interval {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "s";
                description
                  "Interval between two queries.";
              }
    
              leaf interval-byte-rate {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "Byte/s";
                description
                  "Byte rate between two queries.";
              }
    
              leaf interval-pkt-rate {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "pps";
                description
                  "Packet rate between two queries.";
              }
    
              leaf total-byte {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "Byte";
                description
                  "Total number of transmitted bytes.";
              }
    
              leaf total-packet {
                type uint64 {
                  range
                    "0..18446744073709551615";
                }
                units "packet";
                description
                  "Total number of transmitted packets.";
              }
    
              leaf no-resource-flag {
                type boolean;
                default "false";
                description
                  "Flag indicating that no statistical resource exists.";
              }
            }  // list list-traffic-statistic
          }  // container list-traffic-statistics
        }  // grouping traffic-statistics
    
        grouping srv6-policy-infos {
          description
            "SRv6 Policy infos grouping.";
          container policy-infos {
            config false;
            description
              "List of SRv6 TE Policies.";
            list policy-info {
              key "endpoint color";
              description
                "Operational state of an SRv6 TE Policy.";
              leaf endpoint {
                type inet:ipv6-address-no-zone;
                description
                  "SR Policy endpoint address.";
              }
    
              leaf color {
                type uint32 {
                  range "0..4294967295";
                }
                description "SR Policy color.";
              }
    
              leaf name {
                ext:support-filter "true";
                type string {
                  length "1..31";
                }
                description "SR Policy name.";
              }
    
              leaf state {
                type string {
                  length "1..31";
                }
                description "SR Policy states.";
              }
    
              leaf state-change-time {
                type yang:date-and-time;
                description
                  "SR Policy state change time.";
              }
    
              leaf admin-state {
                type admin-state-type;
                description
                  "SR Policy admin states.";
              }
    
              leaf binding-sid {
                ext:support-filter "true";
                type inet:ipv6-address-no-zone;
                description
                  "SR Policy binding SID.";
              }
    
              leaf tunnel-id {
                type uint32;
                description
                  "SR Policy tunnel ID.";
              }
    
              leaf tunnel-type {
                type tunnel-type;
                description
                  "SR Policy tunnel type.";
              }
    
              leaf bfd-enable {
                type bfd-enable-type;
                description
                  "SR Policy BFD enable flag.";
              }
    
              leaf bfd-bypass {
                type bfd-bypass-type;
                description
                  "SR policy BFD bypass enable flag.";
              }
    
              leaf hsb-enable {
                type enable-type;
                description
                  "SR Policy HSB enable flag.";
              }
    
              leaf encapsulation-mode {
                type encapsulation-disp-type;
                description
                  "SR Policy encapsulation mode.";
              }
    
              leaf traffic-statistics-enable {
                type enable-type;
                description
                  "SR Policy traffic statistics enable flag.";
              }
    
              leaf candidate-path-count {
                type uint32;
                description
                  "SR Policy candidate path count.";
              }
    
              container candidate-paths {
                description
                  "List of candidate paths in an SRv6 TE Policy.";
                list candidate-path {
                  key "protocol-origin asn node-address discriminator preference";
                  max-elements 64;
                  description
                    "Operational state of a candidate path in an SRv6 TE Policy.";
                  leaf protocol-origin {
                    type protocol-origin-type;
                    description
                      "Candidate path protocol origin.";
                  }
    
                  leaf asn {
                    type uint32 {
                      range "0..4294967295";
                    }
                    description
                      "Candidate path AS No.";
                  }
    
                  leaf node-address {
                    type inet:ip-address-no-zone;
                    description
                      "Candidate path nodeAddress.";
                  }
    
                  leaf discriminator {
                    type uint32 {
                      range "1..65535";
                    }
                    description
                      "Candidate path discriminator.";
                  }
    
                  leaf preference {
                    type uint32 {
                      range "1..65535";
                    }
                    description
                      "Candidate path preference.";
                  }
    
                  leaf network-slice-id {
                    type uint32 {
                      range "1..4294967295";
                    }
                    description
                      "Network slice ID of a candidate path.";
                  }
    
                  leaf path-state {
                    type string {
                      length "1..31";
                    }
                    description
                      "Candidate path state.";
                  }
    
                  leaf path-type {
                    type path-type;
                    description
                      "Candidate path type.";
                  }
    
                  leaf binding-sid {
                    type inet:ipv6-address-no-zone;
                    description
                      "Candidate path binding SID.";
                  }
    
                  leaf group-id {
                    type uint32;
                    description
                      "Candidate path groupId.";
                  }
    
                  leaf policy-name {
                    type string {
                      length "1..31";
                    }
                    description
                      "Candidate path policy name.";
                  }
    
                  leaf path-verification {
                    type global-path-verification-type;
                    description
                      "SR Policy path verification enable flag.";
                  }
    
                  leaf delay-timer-remain {
                    type uint32;
                    units "ms";
                    description
                      "Delay Timer Remain.";
                  }
    
                  leaf template-id {
                    type uint32;
                    description
                      "Candidate path template ID.";
                  }
    
                  leaf segment-list-count {
                    type uint32;
                    description
                      "Candidate path segment list count.";
                  }
    
                  container segment-lists {
                    description
                      "List of segment list information in a candidate path.";
                    list segment-list {
                      key "id";
                      max-elements 64;
                      description
                        "Operational state of a segment list in a candidate path.";
                      leaf id {
                        type uint32;
                        description
                          "Segment list ID.";
                      }
    
                      leaf name {
                        type string {
                          length "1..31";
                        }
                        description
                          "Segment list name.";
                      }
    
                      leaf xc-index {
                        type uint32;
                        description "XC index.";
                      }
    
                      leaf network-slice-id {
                        type uint32 {
                          range "1..4294967295";
                        }
                        description
                          "Network slice ID of a segment list.";
                      }
    
                      leaf delay-timer-remain {
                        type uint32;
                        units "ms";
                        description
                          "Delay timer remain.";
                      }
    
                      leaf state {
                        type string {
                          length "1..31";
                        }
                        description
                          "Segment list state.";
                      }
    
                      leaf weight {
                        type uint32 {
                          ext:value-meaning {
                            ext:item "0" {
                              ext:meaning "Invalid";
                              description "The segment list is invalid when weight is 0.";
                            }
                          }
                          range "0..4294967295";
                        }
                        description
                          "Segment-list weighted loadshare.";
                      }
    
                      leaf verification-state {
                        type string {
                          length "1..31";
                        }
                        description
                          "Segment list state afer enable path verification.";
                      }
    
                      leaf suppress-time-remain {
                        type uint32;
                        description
                          "The delay up time of segment list afer enable path verification.";
                      }
    
                      leaf path-mtu {
                        type uint32 {
                          range "1280..9600";
                        }
                        description
                          "Segment-list path mtu.";
                      }
    
                      leaf active-path-mtu {
                        type uint32 {
                          range "1280..9600";
                        }
                        description
                          "Segment-list active path mtu.";
                      }
    
                      leaf bfd-state {
                        type string {
                          length "1..31";
                        }
                        description
                          "Segment list BFD state.";
                      }
    
                      container sids {
                        description
                          "List of SIDs.";
                        list sid {
                          key "index";
                          max-elements 10;
                          description
                            "Operational data of SID.";
                          leaf index {
                            type uint32 {
                              range
                                "0..4294967295";
                            }
                            description "Id.";
                          }
    
                          leaf value {
                            type inet:ipv6-address-no-zone;
                            description "Val.";
                          }
    
                          leaf block-length {
                            type uint32;
                            description
                              "Block length.";
                          }
    
                          leaf compress-length {
                            type uint32;
                            description
                              "Compress SID length.";
                          }
    
                          leaf verification {
                            type boolean;
                            description
                              "Verification flag.";
                          }
                        }  // list sid
                      }  // container sids
                    }  // list segment-list
                  }  // container segment-lists
                }  // list candidate-path
              }  // container candidate-paths
            }  // list policy-info
          }  // container policy-infos
        }  // grouping srv6-policy-infos
    
        grouping srv4-policy-infos {
          description
            "SR-MPLS TE Policy infos grouping.";
          container policy-infos {
            config false;
            description
              "List of SR-MPLS TE Policies.";
            list policy-info {
              key "endpoint color";
              description
                "Operational state of an SR-MPLS TE Policy.";
              leaf endpoint {
                type inet:ipv4-address-no-zone;
                description
                  "SR Policy endpoint address.";
              }
    
              leaf color {
                type uint32 {
                  range "1..4294967295";
                }
                description "SR Policy color.";
              }
    
              leaf name {
                ext:support-filter "true";
                type string {
                  length "1..31";
                }
                description "SR Policy name.";
              }
    
              leaf state {
                type string {
                  length "1..31";
                }
                description "SR Policy state.";
              }
    
              leaf admin-state {
                type admin-state-type;
                description
                  "SR Policy admin state.";
              }
    
              leaf binding-sid {
                ext:support-filter "true";
                type uint32;
                description
                  "SR Policy binding SID.";
              }
    
              leaf mtu {
                type uint32 {
                  range "512..9600";
                }
                description
                  "SR Policy mtu value.";
              }
    
              leaf tunnel-id {
                type uint32;
                description
                  "SR Policy tunnel ID.";
              }
    
              leaf tunnel-type {
                type tunnel-type;
                description
                  "SR Policy tunnel type.";
              }
    
              leaf pipe-mode {
                type pipe-mode-type;
                description
                  "Pipe mode of SR Policy.";
              }
    
              leaf service-class {
                type serv-class-disp-types;
                description
                  "Service class of SR Policy.";
              }
    
              leaf service-color {
                type serv-color-disp-types;
                description
                  "Service color of SR Policy.";
              }
    
              leaf bfd-enable {
                type bfd-enable-type;
                description
                  "SR Policy BFD enable flag.";
              }
    
              leaf hsb-enable {
                type enable-type;
                description
                  "SR Policy HSB enable flag.";
              }
    
              leaf traffic-statistics-enable {
                type enable-type;
                description
                  "SR Policy traffic statistics enable flag.";
              }
    
              leaf state-change-time {
                type yang:date-and-time;
                description
                  "SR Policy state change time.";
              }
    
              leaf candidate-path-count {
                type uint32;
                description
                  "SR Policy candidate path count.";
              }
    
              container candidate-paths {
                description
                  "List of candidate paths in an SR-MPLS TE Policy.";
                list candidate-path {
                  key "protocol-origin asn node-address discriminator preference";
                  max-elements 64;
                  description
                    "Operational state of a candidate path in an SR-MPLS TE Policy.";
                  leaf protocol-origin {
                    type protocol-origin-type;
                    description
                      "Candidate path protocol origin.";
                  }
    
                  leaf asn {
                    type uint32 {
                      range "0..4294967295";
                    }
                    description
                      "Candidate path AS No.";
                  }
    
                  leaf node-address {
                    type inet:ipv4-address-no-zone;
                    description
                      "Candidate path nodeAddress.";
                  }
    
                  leaf discriminator {
                    type uint32 {
                      range "1..65535";
                    }
                    description
                      "Candidate path discriminator.";
                  }
    
                  leaf preference {
                    type uint32 {
                      range "1..65535";
                    }
                    description
                      "Candidate path preference.";
                  }
    
                  leaf path-state {
                    type string {
                      length "1..31";
                    }
                    description
                      "Candidate path state.";
                  }
    
                  leaf path-type {
                    type path-type;
                    description
                      "Candidate path type.";
                  }
    
                  leaf binding-sid {
                    type uint32;
                    description
                      "Candidate path binding SID.";
                  }
    
                  leaf group-id {
                    type uint32;
                    description
                      "Candidate path groupId.";
                  }
    
                  leaf policy-name {
                    type string {
                      length "1..31";
                    }
                    description
                      "Candidate path policy name.";
                  }
    
                  leaf template-id {
                    type uint32;
                    description
                      "Candidate path template Id.";
                  }
    
                  leaf segment-list-count {
                    type uint32;
                    description
                      "Candidate path segment list count.";
                  }
    
                  container segment-lists {
                    description
                      "List of segment list information in a candidate path.";
                    list segment-list {
                      key "id";
                      max-elements 64;
                      description
                        "Operational state of a segment list in a candidate path.";
                      leaf id {
                        type uint32;
                        description
                          "Segment list ID.";
                      }
    
                      leaf name {
                        type string {
                          length "1..31";
                        }
                        description
                          "Segment list name.";
                      }
    
                      leaf xc-index {
                        type uint32;
                        description "XC index.";
                      }
    
                      leaf delay-time-remain {
                        type uint32;
                        units "ms";
                        description
                          "Delay delete timer remain.";
                      }
    
                      leaf state {
                        type string {
                          length "1..31";
                        }
                        description
                          "Segment list state.";
                      }
    
                      leaf weight {
                        type uint32 {
                          ext:value-meaning {
                            ext:item "0" {
                              ext:meaning "Invalid";
                              description "The segment list is invalid when weight is 0.";
                            }
                          }
                          range "0..4294967295";
                        }
                        description
                          "Segment-list weighted loadshare.";
                      }
    
                      leaf bfd-state {
                        type string {
                          length "1..31";
                        }
                        description
                          "Segment list BFD state.";
                      }
    
                      leaf exp-value {
                        type uint32;
                        description "EXP value.";
                      }
    
                      leaf ttl-value {
                        type uint32;
                        description "TTL value.";
                      }
    
                      container sids {
                        description
                          "List of SIDs.";
                        list sid {
                          key "index";
                          max-elements 10;
                          description
                            "Operational data of SID.";
                          leaf index {
                            type uint32 {
                              range
                                "0..4294967295";
                            }
                            description "Index.";
                          }
    
                          leaf value {
                            type uint32 {
                              range
                                "16..1048575";
                            }
                            description "Value.";
                          }
                        }  // list sid
                      }  // container sids
                    }  // list segment-list
                  }  // container segment-lists
                }  // list candidate-path
              }  // container candidate-paths
            }  // list policy-info
          }  // container policy-infos
        }  // grouping srv4-policy-infos
    
        grouping srv6-source-sids {
          description
            "SRv6 TE Policy SID informations.";
          container source-sids {
            config false;
            description
              "List of SRv6 TE Policy SID informations.";
            list source-sid {
              key "sid-value topology";
              description
                "Operational state of SRv6 TE Policy SID information.";
              leaf sid-value {
                type inet:ipv6-address-no-zone;
                description
                  "The SRv6 TE Policy SID value.";
              }
    
              leaf topology {
                type uint32 {
                  range "0..2";
                }
                description
                  "The SRv6 TE Policy SID topology.";
              }
    
              leaf func-type {
                ext:support-filter "true";
                type function-type;
                description
                  "The SRv6 TE Policy SID type.";
              }
    
              leaf overload {
                type boolean;
                description
                  "The SRv6 TE Policy SID overload flag.";
              }
    
              container sources {
                description
                  "List of SRv6 TE Policy SID source informations.";
                list source {
                  key "protocol process sub-process";
                  description
                    "Operational state of SRv6 TE Policy SID source information.";
                  leaf protocol {
                    type protocol-type;
                    description
                      "The origin protocol.";
                  }
    
                  leaf process {
                    type uint32 {
                      range "1..4294967295";
                    }
                    description
                      "The origin protocol process.";
                  }
    
                  leaf sub-process {
                    type sub-process-type;
                    description
                      "The origin protocol sub process.";
                  }
    
                  leaf node {
                    type string {
                      length "1..48";
                    }
                    description
                      "Node information.";
                  }
    
                  leaf local {
                    type string {
                      length "1..48";
                    }
                    description
                      "Local information.";
                  }
    
                  leaf peer {
                    type string {
                      length "1..48";
                    }
                    description
                      "Peer information.";
                  }
                }  // list source
              }  // container sources
            }  // list source-sid
          }  // container source-sids
        }  // grouping srv6-source-sids
    
        grouping srv6-sid-statistics {
          description
            "SRv6 Policy SID statistics infos.";
          container sid-statistics {
            config false;
            description
              "Operational state of SRv6 Policy SID statistics infos.";
            leaf endx-total-num {
              type uint32 {
                range "0..4294967295";
              }
              description
                "SRv6 Policy End.X SID statistics.";
            }
    
            leaf end-total-num {
              type uint32 {
                range "0..4294967295";
              }
              description
                "SRv6 Policy End SID statistics.";
            }
    
            container sid-nums {
              description
                "List of SRv6 Policy SID num.";
              list sid-num {
                key "protocol process sub-process";
                description
                  "Operational state of SRv6 Policy SID num.";
                leaf protocol {
                  type protocol-type;
                  description
                    "The origin protocol.";
                }
    
                leaf process {
                  type uint32 {
                    range "1..4294967295";
                  }
                  description
                    "The origin protocol process.";
                }
    
                leaf sub-process {
                  type sub-process-type;
                  description
                    "The origin protocol sub process.";
                }
    
                leaf endx-num {
                  type uint32 {
                    range "0..4294967295";
                  }
                  description
                    "The End.X SID num.";
                }
    
                leaf end-num {
                  type uint32 {
                    range "0..4294967295";
                  }
                  description "The End SID num.";
                }
              }  // list sid-num
            }  // container sid-nums
          }  // container sid-statistics
        }  // grouping srv6-sid-statistics
    
        grouping reset-traffic-statistics {
          description
            "Reset SR Policy traffic statistics.";
          leaf name {
            type string {
              length "1..31";
            }
            description "SR Policy name.";
          }
    
          leaf endpoint {
            type inet:ip-address;
            description
              "SR Policy endpoint address.";
          }
    
          leaf color {
            type uint32 {
              range "0..4294967295";
            }
            description "SR Policy color.";
          }
    
          leaf binding-sid {
            type sid-value-type;
            description "SR Policy binding sid.";
          }
        }  // grouping reset-traffic-statistics
    
        container srpolicy {
          description
            "Configure SR Policy parameters.";
          container attribute-templates {
            description
              "List of SR Policy template attribute.";
            list attribute-template {
              key "id";
              description
                "Configure SR Policy template attribute.";
              leaf id {
                type uint32 {
                  range "1..4294967269";
                }
                description "The template ID.";
              }
    
              leaf description {
                type string {
                  length "1..242";
                }
                description
                  "The template description.";
              }
    
              leaf bfd-enable {
                type policy-bfd-enable-type;
                default "not-configured";
                description
                  "The template BFD flag.";
              }
    
              leaf bfd-bypass {
                type policy-bfd-bypass-type;
                default "not-configured";
                description
                  "The template BFD bypass flag.";
              }
    
              leaf hsb-enable {
                type enable-3types;
                default "not-configured";
                description
                  "The template hot standby flag.";
              }
    
              leaf traffic-statistics-enable {
                type enable-3types;
                default "not-configured";
                description
                  "The template traffic statistics flag.";
              }
    
              leaf path-verification-enable {
                type path-verification-type;
                default "not-configured";
                description
                  "The template path verification flag.";
              }
            }  // list attribute-template
          }  // container attribute-templates
    
          container attribute-template-infos {
            config false;
            description
              "List of SR Policy attribute template informations.";
            list attribute-template-info {
              key "id";
              description
                "Operational state of SR Policy attribute template.";
              leaf id {
                type uint32 {
                  range "1..4294967295";
                }
                description "The template ID.";
              }
    
              leaf description {
                type string {
                  length "1..242";
                }
                description
                  "The template description.";
              }
    
              leaf bfd-enable {
                type policy-bfd-enable-type;
                description
                  "Enable/disable BFD.";
              }
    
              leaf bfd-bypass {
                type policy-bfd-bypass-type;
                description
                  "Enable/disable BFD bypass.";
              }
    
              leaf hsb-enable {
                type enable-3types;
                description
                  "Enable/disable hot standby.";
              }
    
              leaf path-verification-enable {
                type path-verification-type;
                description
                  "Enable/disable path verification.";
              }
    
              leaf traffic-statistics-enable {
                type enable-3types;
                description
                  "Enable/disable traffic statistics.";
              }
    
              leaf configuratin-path-refcnt {
                type uint32 {
                  range "0..4294967295";
                }
                description
                  "The configuratin path reference count.";
              }
    
              leaf bgp-path-refcnt {
                type uint32 {
                  range "0..4294967295";
                }
                description
                  "The BGP path reference count.";
              }
            }  // list attribute-template-info
          }  // container attribute-template-infos
        }  // container srpolicy
    
        rpc reset-srv6-te-policy-traffic-statistics {
          ext:node-ref "/ni:network-instance/ni:instances/ni:instance/srv6:srv6/srpolicy:srpolicy/srpolicy:policy-traffic-statistics/srpolicy:policy-traffic-statistic";
          ext:node-ref "/ni:network-instance/ni:instances/ni:instance/srv6:srv6/srpolicy:srpolicy/srpolicy:list-traffic-statistics/srpolicy:list-traffic-statistic";
          description
            "Reset SRv6 TE Policy traffic statistics.";
          input {
            uses reset-traffic-statistics;
          }
        }  // rpc reset-srv6-te-policy-traffic-statistics
    
        rpc reset-sr-mpls-te-policy-traffic-statistics {
          ext:node-ref "/ni:network-instance/ni:instances/ni:instance/sr:segment-routing/srpolicy:srpolicy/srpolicy:policy-traffic-statistics/srpolicy:policy-traffic-statistic";
          ext:node-ref "/ni:network-instance/ni:instances/ni:instance/sr:segment-routing/srpolicy:srpolicy/srpolicy:list-traffic-statistics/srpolicy:list-traffic-statistic";
          description
            "Reset SR-MPLS TE Policy traffic statistics.";
          input {
            uses reset-traffic-statistics;
          }
        }  // rpc reset-sr-mpls-te-policy-traffic-statistics
    
        augment /ni:network-instance/ni:instances/ni:instance/srv6:srv6 {
          description
            "Augment for Segment Routing Policy.";
          container srpolicy {
            when "../srv6:enable='true'";
            description
              "Configure SR Policy parameters.";
            uses srv6-policy-attributes;
    
            uses srv6-policys;
    
            uses traffic-statistics;
    
            uses srv6-policy-infos;
    
            uses srv6-source-sids;
    
            uses srv6-sid-statistics;
          }  // container srpolicy
        }
    
        augment /ni:network-instance/ni:instances/ni:instance/sr:segment-routing {
          description "Augment for SR Policy.";
          container srpolicy {
            when "../sr:enable='true'";
            description
              "Configure SR Policy parameters.";
            uses srv4-policy-attributes;
    
            uses srv4-policys;
    
            uses srv4-policy-infos;
    
            uses policy-groups;
    
            uses traffic-statistics;
          }  // container srpolicy
        }
      }  // module huawei-srpolicy
    

© 2023 YumaWorks, Inc. All rights reserved.