Introduced neutron-mapper
[groupbasedpolicy.git] / neutron-mapper / src / main / yang / mapper.yang
1 module neutron-mapper {
2     yang-version 1;
3
4     namespace "urn:opendaylight:groupbasedpolicy:neutron-mapper";
5     prefix "gbp-neutron-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 IDs and GBP IDs.";
13
14     revision "2015-02-23" {
15         description
16             "Initial revision.";
17     }
18
19     grouping tenant-id-fields {
20         leaf tenant-id {
21                 description "A unique ID for the tenant";
22                 mandatory true;
23                 type gbp-common:tenant-id;
24         }
25     }
26
27     grouping endpoint-group-pair-fields {
28         leaf provider-epg-id {
29             type gbp-common:endpoint-group-id;
30         }
31         leaf consumer-epg-id {
32             type gbp-common:endpoint-group-id;
33         }
34         leaf contract-id {
35             type gbp-common:contract-id;
36         }
37     }
38
39     container mappings {
40         config false;
41         container network-mappings {
42             list network-mapping {
43                 key network-id;
44                 leaf network-id {
45                     description "A unique ID for the neutron network == gbp l2-flood-domain";
46                     type gbp-common:unique-id;
47                 }
48                 leaf l2-bridge-domain-id {
49                     description "A unique ID of l2-bridge-domain generated for neutron network";
50                     type gbp-common:l2-bridge-domain-id;
51                 }
52                 leaf l3-context-id {
53                     description "A unique ID of l3-context generated for neutron network";
54                     type gbp-common:l3-context-id;
55                 }
56             }
57         }
58         container endpoint-group-pair-to-contract-mappings {
59             list endpoint-group-pair-to-contract-mapping {
60                 key "provider-epg-id consumer-epg-id";
61                 uses endpoint-group-pair-fields;
62             }
63         }
64     }
65
66 }