summaryrefslogtreecommitdiffstats
path: root/v3po/it/test-model/src/main/yang/hc-test.yang
blob: e13b5001f0b04318098589e99d915ae16b02def4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
module hc-test {
  yang-version 1;
  namespace "urn:opendaylight:params:xml:ns:yang:hc:test";
  prefix "hct";

  revision "2015-01-05" {
    description "Testing HC model with bindings";
  }

  import yang-ext {
    prefix "ext";
  }

  // WRITE ORDER 3
  // READ ORDER 1
  container simple-container {
    leaf simple-container-name {
      type string;
    }
  }

  grouping some-attributes {
    leaf leaf-from-grouping {
        type string;
    }

    // WRITE ORDER 5
    container container-from-grouping {
        leaf leaf-in-container-from-grouping {
            type int32;
        }
    }
  }

  // WRITE ORDER 9 (no real attributes though)
  // READ ORDER 2
  container container-with-list {
    // WRITE ORDER 7
    // READ ORDER 2.1
    list list-in-container {
        key "id";
        ordered-by "user";

        leaf id {
            type uint32;
        }

        // WRITE ORDER 8
        // READ ORDER 2.1.1
        container container-in-list {
            leaf name {
                type string;
            }

            // WRITE ORDER 6
            // READ ORDER 2.1.1.1
            list nested-list {
                key "nested-id";
                ordered-by "user";

                leaf nested-id {
                    type string;
                }

                leaf nested-name {
                    type string;
                }
            }
        }
    }
  }

  // WRITE ORDER 4
  container container-with-choice {
    leaf name {
        type string;
    }

    uses some-attributes;

    choice choice {
        leaf c1 {
            type string;
        }

        leaf c2 {
            type string;
        }

        // WRITE ORDER: 2
        container c3 {
            leaf name {
                type string;
            }
        }
    }
  }

  // WRITE ORDER: 2
  // READ ORDER 1.1
  augment "/hct:simple-container" {
    ext:augment-identifier "simple-augment";

    leaf simple-augment-leaf {
        type string;
    }
  }

  // WRITE UNORDERED
  // READ ORDER 1.2
  augment "/hct:simple-container" {
    ext:augment-identifier "complex-augment";

    // WRITE ORDER: 1
    // READ ORDER 1.2.1
    container complex-augment-container {
        leaf some-leaf {
            type string;
        }
    }
  }

}