Ietf netmod yang 如何精炼叶子';杨模型的范围是多少?

Ietf netmod yang 如何精炼叶子';杨模型的范围是多少?,ietf-netmod-yang,ietf-netconf,Ietf Netmod Yang,Ietf Netconf,我有一个类似的分组- grouping threshold-value-grouping { container threshold-value { description "Threshold value"; leaf upper-limit-val { description "Upper limit"; type uint32 { range "1..60000";

我有一个类似的分组-

  grouping threshold-value-grouping {
    container threshold-value {
      description "Threshold value";
      leaf upper-limit-val {
        description
          "Upper limit";
        type uint32 {
          range "1..60000";
        }
      }
      leaf lower-limit-val {
        description
          "Lower limit";
        type uint32 {
          range "1..60000";
        }
      }
    }
  }
我想在多个地方重复使用这个分组。 但在不同的地方使用时,叶子的范围会有所不同

所以我想知道如何使用refine语句来实现这一点? 或者有没有更好的方法来解决这个问题?

的第7.13.2节明确规定了所有可能的改进,而
范围
不是其中之一。这两种类型都不是
类型,也可以在ABNF语法(第14节)中看到:

但是您可以在这里添加一个
must
约束,比如

uses threshold-value-grouping {
    refine threshold-value/upper-limit-val {
        must '(. >= 10 and . <= 100)' {
            error-message "Here you can only use values between 10 and 100";
        }
    }
}
使用阈值分组{
细化阈值/上限值{
必须“(.>=10和.的第7.13.2节明确规定了所有可能的改进,
range
不是其中之一。
type
也不是,这也可以在ABNF语法(第14节)中看到:

但是您可以在这里添加一个
must
约束,比如

uses threshold-value-grouping {
    refine threshold-value/upper-limit-val {
        must '(. >= 10 and . <= 100)' {
            error-message "Here you can only use values between 10 and 100";
        }
    }
}
使用阈值分组{
细化阈值/上限值{
必须'(.>=10和。