Merge "ITM Tep Auto Config Unit test using Guice."
[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                        list tz-membership {
91                            key "zone-name";
92                            leaf zone-name {
93                                type string;
94                            }
95                        }
96                        leaf interface-name {
97                                 type string;
98                        }
99                        leaf tunnel-type {
100                             type identityref {
101                                 base odlif:tunnel-type-base;
102                             }
103                        }
104                        leaf option-of-tunnel {
105                            description "Use flow based tunnels for remote-ip";
106                            type boolean;
107                            default false;
108                        }
109                  }
110
111                }
112             }
113
114
115             container tunnel-list {
116                    list internal-tunnel {
117
118                      key  "source-DPN destination-DPN transport-type";
119
120                      leaf source-DPN {
121                          type uint64;
122                      }
123
124                      leaf destination-DPN {
125                          type uint64;
126                      }
127
128                      leaf transport-type {
129                           type identityref {
130                               base odlif:tunnel-type-base;
131                           }
132                      }
133
134                      /* logical-group interface id */
135
136                      leaf-list tunnel-interface-names {
137                           type string;
138                      }
139                    }
140                 }
141
142             container external-tunnel-list {
143                    list external-tunnel {
144
145                      key  "source-device destination-device transport-type";
146
147                      leaf source-device {
148                          type string; //dpnid or node-id
149                      }
150
151                      leaf destination-device {
152                          type string; //dpn-id or node-id or ip
153                      }
154
155                      leaf transport-type {
156                           type identityref {
157                               base odlif:tunnel-type-base;
158                           }
159                      }
160
161                      /* logical-group interface id */
162
163                      leaf tunnel-interface-name {
164                           type string;
165                      }
166
167                    }
168                 }
169
170               grouping tep-info-attributes {
171                   leaf tep-device-type {
172                       type identityref {
173                           base tep-type-base;
174                       }
175                   }
176                   leaf tep-device-id {
177                       type string; //dpnid or node-id
178                   }
179                   leaf tep-ip {
180                       type inet:ip-address; //dpnid or node-id
181                   }
182               }
183
184         typedef tunnel-oper-status {
185             type enumeration {
186                  enum up;
187                  enum down;
188                  enum unknown;
189                  enum ignore;
190              }
191         }
192
193       container tunnels_state {
194         list state-tunnel-list {
195             key  "tunnel-interface-name";
196
197                   leaf tunnel-interface-name {
198                       type string;
199                   }
200             leaf tunnel-state {
201                                   type boolean;
202                                   config false;
203                                   status deprecated;
204                               }
205             leaf oper-state { type tunnel-oper-status; }
206             container src-info {
207                 uses tep-info-attributes;
208             }
209
210                   container dst-info {
211                       uses tep-info-attributes;
212                   }
213
214                   leaf transport-type {
215                       type identityref {
216                           base odlif:tunnel-type-base;
217                       }
218                   }
219
220               }
221             }
222
223             notification itm-tunnel-build-complete{
224             }
225
226       }