af849e218c515a1283a046f76176f1327edcc0ac
[groupbasedpolicy.git] / neutron-mapper / src / main / yang / neutron-gbp-mapper.yang
1 module neutron-gbp-mapper {
2     yang-version 1;
3
4     namespace "urn:opendaylight:groupbasedpolicy:neutron-gbp-mapper";
5     prefix "neutron-gbp-mapper";
6
7     import gbp-common {prefix gbp-common;}
8     import endpoint {prefix gbp-endpoint;}
9     import ietf-inet-types {prefix inet;}
10
11     description 
12         "This module defines the mapping model between Neutron entities and GBP entities.";
13
14     revision "2015-05-13" {
15         description
16             "Initial revision.";
17     }
18
19     grouping neutron-port-key {
20         leaf port-id {
21             description "A unique ID for the neutron port";
22             type gbp-common:unique-id;
23         }
24     }
25
26     container mappings {
27         description "Mapping of neutron entities by groupbasedpolicy entities and vice versa.";
28         config false;
29         container neutron-by-gbp-mappings {
30             description "Neutron entities by groupbasedpolicy entities";
31             container ports-by-endpoints {
32                 description "Neutron ports by groupbasedpolicy endpoint";
33                 list port-by-endpoint {
34                     description "Neutron port key by groupbasedpolicy endpoint key";
35                     key "l2-context mac-address";
36                     uses gbp-endpoint:l2-key;
37                     uses neutron-port-key;
38                 }
39             }
40             container router-gateway-ports-by-endpoints {
41                 description "Neutron router gateway ports by groupbasedpolicy endpoint";
42                 list router-gateway-port-by-endpoint {
43                     description "Neutron router gateway port key by groupbasedpolicy endpoint key";
44                     key "l2-context mac-address";
45                     uses gbp-endpoint:l2-key;
46                     uses neutron-port-key;
47                 }
48             }
49             container router-interface-ports-by-endpoints {
50                 description "Neutron router interface ports by groupbasedpolicy endpoint";
51                 list router-interface-port-by-endpoint {
52                     description "Neutron router interface port key by groupbasedpolicy endpoint key";
53                     key "l2-context mac-address";
54                     uses gbp-endpoint:l2-key;
55                     uses neutron-port-key;
56                 }
57             }
58             container floating-ip-ports-by-endpoints {
59                 description "Neutron floating IP ports by groupbasedpolicy endpoint";
60                 list floating-ip-port-by-endpoint {
61                     description "Neutron floating ip port key by groupbasedpolicy endpoint key";
62                     key "l2-context mac-address";
63                     uses gbp-endpoint:l2-key;
64                     uses neutron-port-key;
65                 }
66             }
67         }
68
69         container gbp-by-neutron-mappings {
70             description "Groupbasedpolicy entities by neutron entities";
71             container endpoints-by-ports {
72                 description "Groupbasedpolicy endpoints by neutron ports";
73                 list endpoint-by-port {
74                     description "Groupbasedpolicy endpoint key by neutron port key";
75                     key port-id;
76                     uses neutron-port-key;
77                     uses gbp-endpoint:l2-key;
78                 }
79             }
80             container endpoints-by-router-gateway-ports {
81                 description "Groupbasedpolicy endpoints by neutron router gateway ports";
82                 list endpoint-by-router-gateway-port {
83                     description "Groupbasedpolicy endpoint key by neutron router gateway port key";
84                     key port-id;
85                     uses neutron-port-key;
86                     uses gbp-endpoint:l2-key;
87                 }
88             }
89             container endpoints-by-router-interface-ports {
90                 description "Groupbasedpolicy endpoints by neutron router interface ports";
91                 list endpoint-by-router-interface-port {
92                     description "Groupbasedpolicy endpoint key by neutron router interface port key";
93                     key port-id;
94                     uses neutron-port-key;
95                     uses gbp-endpoint:l2-key;
96                 }
97             }
98             container endpoints-by-floating-ip-ports {
99                 description "Groupbasedpolicy endpoints by neutron floating IP ports";
100                 list endpoint-by-floating-ip-port {
101                     description "Groupbasedpolicy endpoint key by neutron floating IP port key";
102                     key port-id;
103                     uses neutron-port-key;
104                     uses gbp-endpoint:l2-key;
105                 }
106             }
107         }
108
109         container floating-ip-association-mappings {
110             description "Mapping of association between neutron port representing floating IP and internal neutron port";
111             container internal-ports-by-floating-ip-ports {
112                 list internal-port-by-floating-ip-port {
113                     key floating-ip-port-id;
114                     leaf floating-ip-port-id {
115                         description "A unique ID for the neutron port";
116                         type gbp-common:unique-id;
117                         mandatory true;
118                     }
119                     leaf floating-ip-port-ip-address {
120                         type inet:ip-address;
121                         mandatory true;
122                     }
123                     leaf internal-port-id {
124                         description "A unique ID for the neutron port";
125                         type gbp-common:unique-id;
126                         mandatory true;
127                     }
128                     leaf internal-port-ip-address {
129                         type inet:ip-address;
130                         mandatory true;
131                     }
132                 }
133             }
134             container floating-ip-ports-by-internal-ports {
135                 list floating-ip-port-by-internal-port {
136                     key internal-port-id;
137                     leaf internal-port-id {
138                         description "A unique ID for the neutron port";
139                         type gbp-common:unique-id;
140                         mandatory true;
141                     }
142                     leaf internal-port-ip-address {
143                         type inet:ip-address;
144                         mandatory true;
145                     }
146                     leaf floating-ip-port-id {
147                         description "A unique ID for the neutron port";
148                         type gbp-common:unique-id;
149                         mandatory true;
150                     }
151                     leaf floating-ip-port-ip-address {
152                         type inet:ip-address;
153                         mandatory true;
154                     }
155                 }
156             }
157         }
158     }
159
160 }