Added revisions into imports in yang
[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 {
10         prefix inet;
11         revision-date 2010-09-24;
12     }
13
14     description 
15         "This module defines the mapping model between Neutron entities and GBP entities.";
16
17     revision "2015-05-13" {
18         description
19             "Initial revision.";
20     }
21
22     grouping neutron-port-key {
23         leaf port-id {
24             description "A unique ID for the neutron port";
25             type gbp-common:unique-id;
26         }
27     }
28     
29     grouping internal-port-floating-ip-port-association-fields {
30         leaf floating-ip-port-id {
31             description "A unique ID for the neutron port";
32             type gbp-common:unique-id;
33             mandatory true;
34         }
35         leaf floating-ip-port-ip-address {
36             type inet:ip-address;
37             mandatory true;
38         }
39         leaf internal-port-id {
40             description "A unique ID for the neutron port";
41             type gbp-common:unique-id;
42             mandatory true;
43         }
44         leaf internal-port-ip-address {
45             type inet:ip-address;
46             mandatory true;
47         }
48     }
49
50     container mappings {
51         description "Mapping of neutron entities by groupbasedpolicy entities and vice versa.";
52         config false;
53         container neutron-by-gbp-mappings {
54             description "Neutron entities by groupbasedpolicy entities";
55             container ports-by-endpoints {
56                 description "Neutron ports by groupbasedpolicy endpoint";
57                 list port-by-endpoint {
58                     description "Neutron port key by groupbasedpolicy endpoint key";
59                     key "l2-context mac-address";
60                     uses gbp-endpoint:l2-key;
61                     uses neutron-port-key;
62                 }
63             }
64             container router-gateway-ports-by-endpoints {
65                 description "Neutron router gateway ports by groupbasedpolicy endpoint";
66                 list router-gateway-port-by-endpoint {
67                     description "Neutron router gateway port key by groupbasedpolicy endpoint key";
68                     key "l2-context mac-address";
69                     uses gbp-endpoint:l2-key;
70                     uses neutron-port-key;
71                 }
72             }
73             container router-interface-ports-by-endpoints {
74                 description "Neutron router interface ports by groupbasedpolicy endpoint";
75                 list router-interface-port-by-endpoint {
76                     description "Neutron router interface port key by groupbasedpolicy endpoint key";
77                     key "l2-context mac-address";
78                     uses gbp-endpoint:l2-key;
79                     uses neutron-port-key;
80                 }
81             }
82             container floating-ip-ports-by-endpoints {
83                 description "Neutron floating IP ports by groupbasedpolicy endpoint";
84                 list floating-ip-port-by-endpoint {
85                     description "Neutron floating ip port key by groupbasedpolicy endpoint key";
86                     key "l2-context mac-address";
87                     uses gbp-endpoint:l2-key;
88                     uses neutron-port-key;
89                 }
90             }
91
92             container external-gateways-as-l3-endpoints {
93                 description "L3Endpoints that represent Neutron External Gateways for External Subnets.
94                     Please note these ARE NOT Neutron router ports, they are outside of Neutron.";
95                 list external-gateway-as-l3-endpoint {
96                     description "L3Endpoints that represent Neutron External Gateways for External Subnets.
97                         Please note these ARE NOT Neutron router ports, they are outside of Neutron.";
98                     key "l3-context ip-address";
99                     uses gbp-endpoint:l3-key;
100                 }
101             }
102
103             container external-networks-by-l2-flood-domains {
104                 list external-network-by-l2-flood-domain {
105                     key l2-flood-domain-id;
106                     leaf l2-flood-domain-id {
107                         description "The L2 Flood Domain ID";
108                         type gbp-common:l2-flood-domain-id;
109                     }
110                 }
111             }
112         }
113
114         container gbp-by-neutron-mappings {
115             description "Groupbasedpolicy entities by neutron entities";
116             container endpoints-by-ports {
117                 description "Groupbasedpolicy endpoints by neutron ports";
118                 list endpoint-by-port {
119                     description "Groupbasedpolicy endpoint key by neutron port key";
120                     key port-id;
121                     uses neutron-port-key;
122                     uses gbp-endpoint:l2-key;
123                 }
124             }
125             container endpoints-by-router-gateway-ports {
126                 description "Groupbasedpolicy endpoints by neutron router gateway ports";
127                 list endpoint-by-router-gateway-port {
128                     description "Groupbasedpolicy endpoint key by neutron router gateway port key";
129                     key port-id;
130                     uses neutron-port-key;
131                     uses gbp-endpoint:l2-key;
132                 }
133             }
134             container endpoints-by-router-interface-ports {
135                 description "Groupbasedpolicy endpoints by neutron router interface ports";
136                 list endpoint-by-router-interface-port {
137                     description "Groupbasedpolicy endpoint key by neutron router interface port key";
138                     key port-id;
139                     uses neutron-port-key;
140                     uses gbp-endpoint:l2-key;
141                 }
142             }
143             container endpoints-by-floating-ip-ports {
144                 description "Groupbasedpolicy endpoints by neutron floating IP ports";
145                 list endpoint-by-floating-ip-port {
146                     description "Groupbasedpolicy endpoint key by neutron floating IP port key";
147                     key port-id;
148                     uses neutron-port-key;
149                     uses gbp-endpoint:l2-key;
150                 }
151             }
152         }
153
154         container floating-ip-association-mappings {
155             description "Mapping of association between neutron port representing floating IP and internal neutron port";
156             container internal-ports-by-floating-ip-ports {
157                 list internal-port-by-floating-ip-port {
158                     key floating-ip-port-id;
159                     uses internal-port-floating-ip-port-association-fields;
160                 }
161             }
162             container floating-ip-ports-by-internal-ports {
163                 list floating-ip-port-by-internal-port {
164                     key internal-port-id;
165                     uses internal-port-floating-ip-port-association-fields;
166                 }
167             }
168         }
169     }
170
171 }