bug 537 - Node Reconciliation
[controller.git] / opendaylight / md-sal / model / model-flow-service / src / main / yang / flow-node-inventory.yang
1 module flow-node-inventory {
2     namespace "urn:opendaylight:flow:inventory";
3     prefix flownode;
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 opendaylight-port-types {prefix port;revision-date "2013-09-25";}
8     import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
9     import opendaylight-table-types {prefix table;revision-date "2013-10-26";}
10     import opendaylight-flow-types {prefix flow;revision-date "2013-10-26";}
11     import opendaylight-group-types {prefix group;revision-date "2013-10-18";}
12     import opendaylight-meter-types {prefix meter;revision-date "2013-09-18";}
13     
14     revision "2013-08-19" {
15         description "Flow Capable Node extensions to the Inventory model";
16     }
17     
18     identity feature-capability {
19     }
20     
21     identity flow-feature-capability-flow-stats {
22         description "Flow statistics"; 
23         base feature-capability;      
24     }
25     
26     identity flow-feature-capability-table-stats {
27         description "Table statistics";
28         base feature-capability;        
29     }
30     
31     identity flow-feature-capability-port-stats {
32         description "Port statistics";
33         base feature-capability;        
34     }
35     
36     identity flow-feature-capability-stp {
37         description "802.1d spanning tree";
38         base feature-capability;        
39     }
40     
41     identity flow-feature-capability-reserved {
42         description "Reserved, must be zero";
43         base feature-capability;        
44     }
45     
46     identity flow-feature-capability-ip-reasm {
47         description "Can reassemble IP fragments";
48         base feature-capability;        
49     }
50     
51     identity flow-feature-capability-queue-stats {
52         description "Queue statistics";
53         base feature-capability;        
54     }
55     
56     identity flow-feature-capability-arp-match-ip {
57         description "Match IP addresses in ARP pkts";
58         base feature-capability;        
59     }
60     
61     identity flow-feature-capability-group-stats {
62         description "Group statistics";
63         base feature-capability;        
64     }
65     
66     identity flow-feature-capability-port-blocked {
67         description "Switch will block looping ports";
68         base feature-capability;        
69     }
70     
71     grouping feature {
72         leaf support-state {
73             type inv:support-type;
74         }
75     }
76
77     grouping queue {
78          leaf queue-id {
79             type uint32;
80             description "id for the specific queue";
81             mandatory true; 
82         }
83         container properties {
84             leaf minimum-rate {
85                 type uint32;
86             }
87             leaf maximum-rate{
88                 type uint32;
89             }
90         }
91     }
92
93     typedef flow-id {
94         type inet:uri;
95     }
96
97     grouping tables {
98         list table {
99             key "id"; 
100     
101             leaf id {
102                     type uint8;
103             }            
104     
105             uses table:table-features;
106     
107             list flow {
108                 key "id"; 
109     
110                 leaf id {
111                     type flow-id;
112                 }           
113     
114                 uses flow:flow;
115             }
116         }
117     }
118     
119     grouping meters {
120         list meter {
121             key "meter-id";
122             uses meter:meter;
123         }
124     }
125     
126     
127     grouping flow-node {
128
129         leaf manufacturer {
130             type string;
131         }
132         leaf hardware {
133             type string;
134         }
135         leaf software {
136             type string;
137         }
138         leaf serial-number {
139             type string;
140         }
141         leaf description {
142             type string;
143         }
144
145         uses tables;
146         uses group:groups;
147         uses meters;
148         // TODO: ports
149         
150         container supported-match-types {
151             list match-type {
152                 key "match";
153                 uses feature;
154                 leaf match {
155                     type string; // FIXME: Add identity
156                 }
157                 
158             }
159         }
160         
161         container supported-instructions {
162             list instruction-type {
163                 key "instruction";
164                 uses feature;
165                 leaf instruction {
166                     type string; // FIXME: Add identity
167                 }
168             }
169         }
170
171         container supported-actions {
172             list action-type {
173                 key "action";
174                 uses feature;
175
176                 leaf action {
177                     type string; // FIXME: Add identity
178                 }
179             }
180         }
181         
182         container switch-features {
183             
184             leaf max_buffers {
185                 type uint32;
186             }
187             
188             leaf max_tables {
189                 type uint8;
190             }
191             
192             leaf-list capabilities {
193                 type identityref {
194                     base feature-capability;
195                 }
196             }
197             
198         }
199     }
200     
201     grouping flow-node-connector {
202
203         uses port:flow-capable-port;
204     }
205
206     augment "/inv:nodes/inv:node" {
207         ext:augment-identifier "flow-capable-node";
208         uses flow-node;
209     }
210
211     augment "/inv:nodes/inv:node/inv:node-connector" {
212         ext:augment-identifier "flow-capable-node-connector";
213         uses flow-node-connector;
214     }
215
216     augment "/inv:node-updated" {
217         ext:augment-identifier "flow-capable-node-updated";
218         uses flow-node;
219     }
220
221     augment "/inv:node-updated/inv:node-connector" {
222         //ext:identical-augment "flow-capable-node-connector";
223         ext:augment-identifier "flow-capable-node-connector-update-fields";
224         uses flow-node-connector;
225     }
226     
227     augment "/inv:node-connector-updated" {
228         ext:augment-identifier "flow-capable-node-connector-updated";
229         uses flow-node-connector;
230     }
231
232     augment "/inv:nodes/inv:node/table" {
233         ext:augment-identifier "flow-cookie-mapping";
234         list flow-cookie-map {
235             key "cookie";
236             leaf cookie {
237                 type flow:flow-cookie;
238             }
239             leaf-list flow-ids {
240                 type flow-id;
241             }
242         }
243     }
244 }