Merge "Add utility apis"
[genius.git] / itm / itm-api / src / main / yang / itm-state.yang
1 module itm-state {
2
3       namespace "urn:opendaylight:genius:itm:op";
4
5       prefix itm-state;
6
7       import ietf-interfaces {
8           prefix if;
9       }
10
11       import ietf-yang-types {
12           prefix yang;
13       }
14
15       import ietf-inet-types {
16           prefix inet;
17           revision-date "2013-07-15";
18       }
19       import odl-interface {
20           prefix odlif; revision-date "2016-04-06";
21       }
22     
23
24       description "This YANG module defines operation part of the model.";
25
26       revision "2016-04-06";
27
28         /* Operational state */
29
30       identity tep-type-base {
31               description "Base TEP device type";
32           }
33
34           identity tep-type-internal {
35               base tep-type-base;
36               description "TEP type internal e.g. Compute OVS";
37           }
38
39           identity tep-type-external {
40               base tep-type-base;
41               description "TEP type external e.g. DC Gateway";
42           }
43
44           identity tep-type-hwvtep {
45               base tep-type-base;
46               description "TEP type Hwvtep e.g. TOR devices";
47           }
48
49           typedef tep-type {
50               type identityref {
51                   base tep-type-base;
52               }
53               description "This type is used to refer to an TEP Device Type.";
54           }
55
56             container dpn-endpoints {
57
58               list DPN-TEPs-info {
59
60                 key "DPN-ID";
61
62                 leaf DPN-ID {
63                          type uint64;
64                 }
65                 leaf up {
66                    type boolean;
67                    config false;
68                 }
69
70                 /* Minimum 1 port. We may for now support only two ports */
71                 list tunnel-end-points {
72                       ordered-by user;
73                      key "portname VLAN-ID ip-address tunnel-type"; /* Multiple tunnels on the same physical port but on different VLAN can be supported */
74
75                        leaf portname {
76                            type string;
77                            }
78                        leaf VLAN-ID {
79                            type uint16;
80                            }
81                        leaf ip-address {
82                            type inet:ip-address;
83                        }
84                        leaf subnet-mask {
85                            type inet:ip-prefix;
86                        }
87                        leaf gw-ip-address {
88                                 type inet:ip-address;
89                        }
90                        leaf transport-zone {
91                                 type string;
92                        }
93                        leaf interface-name {
94                                 type string;
95                        }
96                        leaf tunnel-type {
97                             type identityref {
98                                 base odlif:tunnel-type-base;
99                             }
100                        }
101                        leaf option-of-tunnel {
102                            description "Use flow based tunnels for remote-ip";
103                            type boolean;
104                            default false;
105                        }
106                  }
107
108                }
109             }
110
111
112             container tunnel-list {
113                    list internal-tunnel {
114
115                      key  "source-DPN destination-DPN transport-type";
116
117                      leaf source-DPN {
118                          type uint64;
119                      }
120
121                      leaf destination-DPN {
122                          type uint64;
123                      }
124
125                      leaf transport-type {
126                           type identityref {
127                               base odlif:tunnel-type-base;
128                           }
129                      }
130
131                      /* logical-group interface id */
132
133                      leaf tunnel-interface-name {
134                           type string;
135                      }
136                    }
137                 }
138
139             container external-tunnel-list {
140                    list external-tunnel {
141
142                      key  "source-device destination-device transport-type";
143
144                      leaf source-device {
145                          type string; //dpnid or node-id
146                      }
147
148                      leaf destination-device {
149                          type string; //dpn-id or node-id or ip
150                      }
151
152                      leaf transport-type {
153                           type identityref {
154                               base odlif:tunnel-type-base;
155                           }
156                      }
157
158                      /* logical-group interface id */
159
160                      leaf tunnel-interface-name {
161                           type string;
162                      }
163
164                    }
165                 }
166
167               grouping tep-info-attributes {
168                   leaf tep-device-type {
169                       type identityref {
170                           base tep-type-base;
171                       }
172                   }
173                   leaf tep-device-id {
174                       type string; //dpnid or node-id
175                   }
176                   leaf tep-ip {
177                       type inet:ip-address; //dpnid or node-id
178                   }
179               }
180
181         typedef tunnel-oper-status {
182             type enumeration {
183                  enum up;
184                  enum down;
185                  enum unknown;
186                  enum ignore;
187              }
188         }
189
190       container tunnels_state {
191         list state-tunnel-list {
192             key  "tunnel-interface-name";
193
194                   leaf tunnel-interface-name {
195                       type string;
196                   }
197             leaf tunnel-state {
198                                   type boolean;
199                                   config false;
200                                   status deprecated;
201                               }
202             leaf oper-state { type tunnel-oper-status; }
203             container src-info {
204                 uses tep-info-attributes;
205             }
206
207                   container dst-info {
208                       uses tep-info-attributes;
209                   }
210
211                   leaf transport-type {
212                       type identityref {
213                           base odlif:tunnel-type-base;
214                       }
215                   }
216
217               }
218             }
219
220             notification itm-tunnel-build-complete{
221             }
222
223       }