Bug 5213 - Missing segmentation-id for physical networks
[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     container mappings {
30         description "Mapping of neutron entities by groupbasedpolicy entities and vice versa.";
31         config false;
32         container neutron-by-gbp-mappings {
33             description "Neutron entities by groupbasedpolicy entities";
34             container ports-by-endpoints {
35                 description "Neutron ports by groupbasedpolicy endpoint";
36                 list port-by-endpoint {
37                     description "Neutron port key by groupbasedpolicy endpoint key";
38                     key "l2-context mac-address";
39                     uses gbp-endpoint:l2-key;
40                     uses neutron-port-key;
41                 }
42             }
43
44             container external-gateways-as-l3-endpoints {
45                 description "L3Endpoints that represent Neutron External Gateways for External Subnets.
46                     Please note these ARE NOT Neutron router ports, they are outside of Neutron.";
47                 list external-gateway-as-l3-endpoint {
48                     description "L3Endpoints that represent Neutron External Gateways for External Subnets.
49                         Please note these ARE NOT Neutron router ports, they are outside of Neutron.";
50                     key "l3-context ip-address";
51                     uses gbp-endpoint:l3-key;
52                 }
53             }
54
55             container provider-physical-networks-as-l2-flood-domains {
56                 list provider-physical-network-as-l2-flood-domain {
57                     key "tenant-id l2-flood-domain-id";
58                     leaf tenant-id {
59                         description "Tenant of L2 Flood Domain";
60                         type gbp-common:tenant-id;
61                     }
62                     leaf l2-flood-domain-id {
63                         description "The L2 Flood Domain ID";
64                         type gbp-common:l2-flood-domain-id;
65                     }
66                     leaf segmentation-id {
67                         mandatory true;
68                         description "An isolated segment on the physical network. The network-type
69                             attribute defines the segmentation model. For example, if network-type
70                             is vlan, this ID is a vlan identifier.";
71                         type string;
72                     }
73                 }
74             }
75         }
76
77         container gbp-by-neutron-mappings {
78             description "Groupbasedpolicy entities by neutron entities";
79             container endpoints-by-ports {
80                 description "Groupbasedpolicy endpoints by neutron ports";
81                 list endpoint-by-port {
82                     description "Groupbasedpolicy endpoint key by neutron port key";
83                     key port-id;
84                     uses neutron-port-key;
85                     uses gbp-endpoint:l2-key;
86                 }
87             }
88         }
89
90     }
91
92 }