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