0

我的代码如下。

1.

grouping policy-attributes {
    container qospolicies {
        list qospolicy {
            key "uuid";
            uses attrs:base-attributes;
            uses qos-policy-attributes;
            uses bandwidth-limit-attributes;
            uses dscp-marking-attributes;
        }
    }
}

与列表的分组

2.

grouping bandwidth-limit-rules-attributes {
    list bandwidth-limit-rule{
    leaf qos-rule-id {
        type yang:uuid;
        description "The rule id of the associated rule";
    }
    leaf max-kbps {
        type uint64;
        description "The maximum KBPS value";
    }
    leaf max-burst-kbps {
        type uint64;
        description "The burst over the maximum KBPS value";
    }
    leaf policy-id {
        type yang:uuid;
        description "The policy id to which the rule is associated";
    }
    }
}

3.

grouping dscp-marking-rules-attributes {
    list dscp-marking-rule{
    leaf qos-rule-id {
        type yang:uuid;
        description "The rule id of the associated rule";
    }
    leaf dscp-mark {
        type uint8{
        range "0 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 | 34 | 36 | 38
        | 40 | 46 | 48 | 56 ";}
        description "the value of dscp mark";
    }
    leaf policy-id {
        type yang:uuid;
        description "the policy id to which the rule is associated";
    }
    }
}

分组bandwidth-limit-rules-attributes有带叶子的列表。也bandwidth-limit-rules-attributes用于分组policy-attributes。我想知道拥有bandwidth-limit-rules-attributesin是否有效policy-attributes

4

1 回答 1

0

是的,您可以将 alist作为 a 的子语句groupinggrouping这是来自RFC6020 (YANG 1.0)的可能子语句的列表。

 +--------------+---------+-------------+
 | substatement | section | cardinality |
 +--------------+---------+-------------+
 | anyxml       | 7.10    | 0..n        |
 | choice       | 7.9     | 0..n        |
 | container    | 7.5     | 0..n        |
 | description  | 7.19.3  | 0..1        |
 | grouping     | 7.11    | 0..n        |
 | leaf         | 7.6     | 0..n        |
 | leaf-list    | 7.7     | 0..n        |
 | list         | 7.8     | 0..n        | <--
 | reference    | 7.19.4  | 0..1        |
 | status       | 7.19.2  | 0..1        |
 | typedef      | 7.3     | 0..n        |
 | uses         | 7.12    | 0..n        |
 +--------------+---------+-------------+

在分组中使用policy-attributes分组也是有效的:

grouping policy-attributes {
    container qospolicies {
        list qospolicy {
            key uuid;
            /*
            uses attrs:base-attributes;
            uses qos-policy-attributes;
            uses bandwidth-limit-attributes;
            uses dscp-marking-attributes;
            */
            uses bandwidth-limit-rules-attributes;
        }
    }
}
于 2016-06-16T07:00:40.243 回答