c76ce52e3a3629f5e062d8960c276064b2cd8a20
[vpnservice.git] / itm / itm-api / src / main / yang / itm-state.yang
1 module itm-state {
2
3       namespace "urn:opendaylight:vpnservice: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 "2010-09-24";
18       }
19       import odl-interface {
20           prefix odlif; revision-date "2015-03-31";
21       }
22     
23
24       description "This YANG module defines operation part of the model.";
25
26       revision "2015-07-01";
27
28         /* Operational state */
29
30     identity tep-type-base {
31         description "Base TEP device type";
32     }
33     identity tep-type-internal {
34         base tep-type-base;
35         description "TEP type internal e.g. Compute OVS";
36     }
37     identity tep-type-external {
38         base tep-type-base;
39         description "TEP type external e.g. DC Gateway";
40     }
41     identity tep-type-hwvtep {
42         base tep-type-base;
43         description "TEP type Hwvtep e.g. TOR devices";
44     }
45     typedef tep-type {
46         type identityref {
47             base tep-type-base;
48         }
49         description "This type is used to refer to an TEP Device Type.";
50     }
51       container dpn-endpoints {
52
53         list DPN-TEPs-info {
54
55           key "DPN-ID";
56
57           leaf DPN-ID {
58                    type uint64;
59           }
60           leaf up {
61              type boolean;
62              config false;
63           }
64
65           /* Minimum 1 port. We may for now support only two ports */
66           list tunnel-end-points {
67                 ordered-by user;
68                key "portname VLAN-ID ip-address tunnel-type"; /* Multiple tunnels on the same physical port but on different VLAN can be supported */
69
70                  leaf portname {
71                      type string;
72                      }
73                  leaf VLAN-ID {
74                      type uint16;
75                      }
76                  leaf ip-address {
77                      type inet:ip-address;
78                  }
79                  leaf subnet-mask {
80                      type inet:ip-prefix;
81                  }
82                  leaf gw-ip-address {
83                           type inet:ip-address;
84                  }
85                  leaf transport-zone {
86                           type string;
87                  }
88                  leaf interface-name {
89                           type string;
90                  }
91                  leaf tunnel-type {
92                       type identityref {
93                           base odlif:tunnel-type-base;
94                       }
95                  }
96            }
97
98          }
99       }
100
101
102       container tunnel-list {
103              list internal-tunnel {
104
105                key  "source-DPN destination-DPN transport-type";
106
107                leaf source-DPN {
108                    type uint64;
109                }
110
111                leaf destination-DPN {
112                    type uint64;
113                }
114                leaf transport-type {
115                     type identityref {
116                         base odlif:tunnel-type-base;
117                     }
118                }
119
120                /* logical-group interface id */
121
122                leaf tunnel-interface-name {
123                     type string;
124                }
125              }
126           }
127
128       container external-tunnel-list {
129              list external-tunnel {
130
131                key  "source-device destination-device transport-type";
132
133                leaf source-device {
134                    type string; //dpnid or node-id
135                }
136
137                leaf destination-device {
138                    type string; //dpn-id or node-id or ip
139                }
140
141                leaf transport-type {
142                     type identityref {
143                         base odlif:tunnel-type-base;
144                     }
145                }
146                /* logical-group interface id */
147
148                leaf tunnel-interface-name {
149                     type string;
150                }
151
152              }
153           }
154
155         grouping tep-info-attributes {
156             leaf tep-device-type {
157                 type identityref {
158                     base tep-type-base;
159                 }
160             }
161             leaf tep-device-id {
162                 type string; //dpnid or node-id
163             }
164             leaf tep-ip {
165                 type inet:ip-address; //dpnid or node-id
166             }
167         }
168
169       container tunnels_state {
170         list state-tunnel-list {
171             key  "tunnel-interface-name";
172             leaf tunnel-interface-name {
173                 type string;
174             }
175             leaf tunnel-state {
176                 type boolean;
177                 config false;
178             }
179             container src-info {
180                 uses tep-info-attributes;
181             }
182             container dst-info {
183                 uses tep-info-attributes;
184             }
185             leaf transport-type {
186                 type identityref {
187                     base odlif:tunnel-type-base;
188                 }
189             }
190         }
191       }
192           notification itm-tunnel-build-complete{
193           }
194
195 }