Merge "contracts, index, rootGBPcontroller"
[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     }
33
34     typedef address-type-ref {
35         description "Reference to address type.";
36         type identityref {
37             base address-type;
38         }
39     }
40
41     typedef network-domain-ref {
42         description "Reference to network domain.";
43         type identityref {
44             base network-domain;
45         }
46     }
47
48     typedef context-type-ref {
49         description "Reference to context type.";
50         type identityref {
51             base context-type;
52         }
53     }
54
55     grouping network-domain-key {
56         leaf network-domain-type {
57             type network-domain-ref;
58             mandatory true;
59         }
60         leaf network-domain-id {
61             type gbp-common:network-domain-id;
62             mandatory true;
63         }
64     }
65
66     grouping context-key {
67         leaf context-type {
68             type context-type-ref;
69             mandatory true;
70         }
71         leaf context-id {
72             type gbp-common:context-id;
73             mandatory true;
74         }
75     }
76
77     grouping has-address-type {
78         leaf address-type {
79             type address-type-ref;
80             mandatory true;
81         }
82     }
83
84     grouping forwarding-with-tenant-fields {
85         leaf tenant-id {
86             type gbp-common:tenant-id;
87             description
88                         "The tenant with which forwarding-context is associated";
89         }
90
91         list forwarding-context {
92             key "context-type context-id";
93             uses context-key;
94
95             uses has-address-type;
96             container parent {
97                 uses context-key;
98             }
99         }
100
101         list network-domain {
102             key "network-domain-type network-domain-id";
103             uses network-domain-key;
104
105             container parent {
106                 uses context-key;
107             }
108
109             description "Network domain can be augmented with further information.";
110         }
111     }
112
113     container forwarding {
114         list forwarding-by-tenant {
115             key tenant-id;
116             uses forwarding-with-tenant-fields;
117         }
118     }
119
120 }