pyang fixes for inventory and topology models
[controller.git] / opendaylight / md-sal / model / model-inventory / src / main / yang / opendaylight-inventory.yang
1 module opendaylight-inventory {
2     namespace "urn:opendaylight:inventory";
3     prefix inv;
4
5     import yang-ext {prefix ext; revision-date "2013-07-09";}
6     import ietf-inet-types {prefix inet; revision-date "2010-09-24";}
7
8
9     revision "2013-08-19" {
10         description "Initial revision of Inventory model";
11     }
12     
13     
14     typedef support-type {
15         type enumeration {
16             enum native;
17             enum emulated;
18             enum not-supported;
19         }
20     }
21
22     typedef node-id {
23         type inet:uri;
24     }
25
26     typedef node-connector-id {
27         type inet:uri;
28     }
29
30     typedef node-ref {
31         type instance-identifier;
32     }
33
34     typedef node-connector-ref {
35         type instance-identifier;
36     }
37
38     identity node-context {
39         description "Identity used to mark node context";
40     }
41
42     identity node-connector-context {
43         description "Identity used to mark node connector context";
44     }
45
46     identity node-type {
47         description "Base identity for node types";
48     }
49
50     identity node-connector-type {
51         description "Base identity for node connectors type";
52     }
53
54     grouping node {
55         leaf id {
56             type node-id;
57         }
58
59         list "node-connector" {
60             key "id";
61             ext:context-instance "node-connector-context";
62
63             uses node-connector;
64         }
65     }
66
67     grouping node-connector {
68         leaf id {
69             type node-connector-id;
70         }
71     }
72
73     grouping node-context-ref {
74         description 
75         "Helper grouping which contains a reference to node context.";
76         leaf node {
77             ext:context-reference "node-context";
78             type node-ref;
79         }
80     }
81
82     /** Base structure **/
83     container nodes {
84         list node {
85             key "id";
86             ext:context-instance "node-context";
87
88             uses node;
89         }
90     }
91
92     notification node-updated {
93         leaf node-ref {
94             ext:context-reference "node-context";
95             type node-ref;
96         }
97         uses node;
98     }
99
100     notification node-connector-updated {
101         leaf node-connector-ref {
102             ext:context-reference "node-connector-context";
103             type node-connector-ref;
104         }
105         uses node-connector;
106     }
107
108     notification node-removed {
109         leaf node-ref {
110             ext:context-reference "node-context";
111             type node-ref;
112         }
113     }
114
115     notification node-connector-removed {
116         leaf node-connector-ref {
117             ext:context-reference "node-connector-context";
118             type node-connector-ref;
119         }
120     }
121 }