Merge "Adding name param for forwarding enties:"
[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         }
70         leaf context-id {
71             type gbp-common:context-id;
72         }
73     }
74
75     grouping has-address-type {
76         leaf address-type {
77             type address-type-ref;
78             mandatory true;
79         }
80     }
81
82     grouping forwarding-fields {
83
84         container parent {
85             uses context-key;
86         }
87
88         leaf name {
89             type gbp-common:name;
90         }
91     }
92
93     grouping forwarding-with-tenant-fields {
94         leaf tenant-id {
95             type gbp-common:tenant-id;
96             description
97                         "The tenant with which forwarding-context is associated";
98         }
99
100         list forwarding-context {
101             key "context-type context-id";
102             uses context-key;
103
104             uses forwarding-fields;
105         }
106
107         list network-domain {
108             key "network-domain-type network-domain-id";
109             uses network-domain-key;
110
111             uses forwarding-fields;
112             description "Network domain can be augmented with further information.";
113         }
114     }
115
116     container forwarding {
117         list forwarding-by-tenant {
118             key tenant-id;
119             uses forwarding-with-tenant-fields;
120         }
121     }
122
123 }