d39e0e4a4d985189fb83fc50c341e08390f4baed
[groupbasedpolicy.git] / groupbasedpolicy / src / main / yang / model / forwarding.yang
1 /*
2  * Copyright (c) 2016 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 module forwarding {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:forwarding";
13     prefix "forwarding";
14
15     import gbp-common { prefix gbp-common; revision-date 2014-04-21; }
16
17     revision "2016-04-27" {
18         description
19                 "Initial revision.";
20     }
21
22     identity address-type {
23         description "Address type used in endoints.";
24     }
25
26     identity network-domain {
27         description "Basic forwarding entity";
28     }
29
30     identity context-type {
31         description "Type of context.";
32         base network-domain;
33     }
34
35     typedef address-type-ref {
36         description "Reference to address type.";
37         type identityref {
38             base address-type;
39         }
40     }
41
42     typedef network-domain-ref {
43         description "Reference to network domain.";
44         type identityref {
45             base network-domain;
46         }
47     }
48
49     typedef context-type-ref {
50         description "Reference to context type.";
51         type identityref {
52             base context-type;
53         }
54     }
55
56     grouping network-domain-key {
57         leaf network-domain-type {
58             type network-domain-ref;
59             mandatory true;
60         }
61         leaf network-domain-id {
62             type gbp-common:network-domain-id;
63             mandatory true;
64         }
65     }
66
67     grouping context-key {
68         leaf context-type {
69             type context-type-ref;
70             mandatory true;
71         }
72         leaf context-id {
73             type gbp-common:context-id;
74             mandatory true;
75         }
76     }
77
78     grouping has-address-type {
79         leaf address-type {
80             type address-type-ref;
81             mandatory true;
82         }
83     }
84
85     grouping forwarding-with-tenant-fields {
86         leaf tenant-id {
87             type gbp-common:tenant-id;
88             description
89                         "The tenant with which forwarding-context is associated";
90         }
91
92         list forwarding-context {
93             key "context-type context-id";
94             uses context-key;
95
96             uses has-address-type;
97             container parent {
98                 uses context-key;
99             }
100         }
101
102         list network-domain {
103             key "network-domain-type network-domain-id";
104             uses network-domain-key;
105
106             container parent {
107                 uses context-key;
108             }
109
110             description "Network domain can be augmented with further information.";
111         }
112     }
113
114     container forwarding {
115         list forwarding-by-tenant {
116             key tenant-id;
117             uses forwarding-with-tenant-fields;
118         }
119     }
120
121 }