Upgrade ietf-{inet,yang}-types to 2013-07-15
[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                  }
102
103                }
104             }
105
106
107             container tunnel-list {
108                    list internal-tunnel {
109
110                      key  "source-DPN destination-DPN transport-type";
111
112                      leaf source-DPN {
113                          type uint64;
114                      }
115
116                      leaf destination-DPN {
117                          type uint64;
118                      }
119
120                      leaf transport-type {
121                           type identityref {
122                               base odlif:tunnel-type-base;
123                           }
124                      }
125
126                      /* logical-group interface id */
127
128                      leaf tunnel-interface-name {
129                           type string;
130                      }
131                    }
132                 }
133
134             container external-tunnel-list {
135                    list external-tunnel {
136
137                      key  "source-device destination-device transport-type";
138
139                      leaf source-device {
140                          type string; //dpnid or node-id
141                      }
142
143                      leaf destination-device {
144                          type string; //dpn-id or node-id or ip
145                      }
146
147                      leaf transport-type {
148                           type identityref {
149                               base odlif:tunnel-type-base;
150                           }
151                      }
152
153                      /* logical-group interface id */
154
155                      leaf tunnel-interface-name {
156                           type string;
157                      }
158
159                    }
160                 }
161
162               grouping tep-info-attributes {
163                   leaf tep-device-type {
164                       type identityref {
165                           base tep-type-base;
166                       }
167                   }
168                   leaf tep-device-id {
169                       type string; //dpnid or node-id
170                   }
171                   leaf tep-ip {
172                       type inet:ip-address; //dpnid or node-id
173                   }
174               }
175
176             container tunnels_state {
177               list state-tunnel-list {
178                   key  "tunnel-interface-name";
179
180                   leaf tunnel-interface-name {
181                       type string;
182                   }
183
184                   leaf tunnel-state {
185                       type boolean;
186                       config false;
187                   }
188
189                   container src-info {
190                       uses tep-info-attributes;
191                   }
192
193                   container dst-info {
194                       uses tep-info-attributes;
195                   }
196
197                   leaf transport-type {
198                       type identityref {
199                           base odlif:tunnel-type-base;
200                       }
201                   }
202
203               }
204             }
205
206             notification itm-tunnel-build-complete{
207             }
208
209       }