2 * Copyright (c) 2016 Cisco Systems, Inc. and others. All rights reserved.
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
12 namespace "urn:opendaylight:groupbasedpolicy:endpoints";
13 prefix "base-endpoint";
15 import gbp-common { prefix gbp-common; revision-date 2014-04-21; }
16 import ietf-inet-types { prefix inet; revision-date 2010-09-24; }
17 import ietf-yang-types { prefix yang; revision-date 2010-09-24; }
19 revision "2016-04-27" {
29 // TODO should be moved to separate yang
31 pattern '[0-9a-fA-F]{2}(:[0-9a-fA-F]{2}){5}';
36 // TODO should be moved to separate yang
39 '(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}'
40 + '([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])'
41 + '/(([0-9])|([1-2][0-9])|(3[0-2]))';
44 "The ipv4-prefix type represents an IPv4 address prefix.
45 The prefix length is given by the number following the
46 slash character and must be less than or equal to 32.
47 A prefix length value of n corresponds to an IP address
48 mask that has n contiguous 1-bits from the most
49 significant bit (MSB) and all other bits set to 0.
50 The canonical format of an IPv4 prefix has all bits of
51 the IPv4 address set to zero that are not part of the
56 // TODO should be moved to separate yang
58 pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
59 + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
60 + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
61 + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
62 + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';
63 pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
64 + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
68 "The ipv6-prefix type represents an IPv6 address prefix.
69 The prefix length is given by the number following the
70 slash character and must be less than or equal 128.
71 A prefix length value of n corresponds to an IP address
72 mask that has n contiguous 1-bits from the most
73 significant bit (MSB) and all other bits set to 0.
74 The IPv6 address should have all bits that do not belong
75 to the prefix set to zero.
76 The canonical format of an IPv6 prefix has all bits of
77 the IPv6 address set to zero that are not part of the
78 IPv6 prefix. Furthermore, IPv6 address is represented
79 in the compressed format described in RFC 4291, Section
80 2.2, item 2 with the following additional rules: the ::
81 substitution must be applied to the longest sequence of
82 all-zero 16-bit chunks in an IPv6 address. If there is
83 a tie, the first sequence of all-zero 16-bit chunks is
84 replaced by ::. Single all-zero 16-bit chunks are not
85 compressed. The canonical format uses lowercase
86 characters and leading zeros are not allowed.";
88 "RFC 4291: IP Version 6 Addressing Architecture";
91 grouping containment-endpoint-key {
93 type gbp-common:context-id;
98 grouping address-endpoint-key {
105 grouping endpoint-key {
106 uses containment-endpoint-key;
107 uses address-endpoint-key;
110 grouping has-child-endpoints {
111 list child-endpoint {
112 key "containment address";
117 grouping parent-child-endpoints {
118 choice parent-endpoint-choice {
119 case parent-containment-endpoint-case {
120 list parent-containment-endpoint {
122 uses containment-endpoint-key;
125 case parent-endpoint-case {
126 list parent-endpoint {
127 key "containment address";
132 uses has-child-endpoints;
135 grouping common-endpoint-fields {
137 type gbp-common:tenant-id;
140 "The tenant with which this endpoint is associated";
142 leaf network-containment {
144 "The network domain associated with this endpoint's fowarding
147 type gbp-common:network-domain-id;
149 leaf-list endpoint-group {
150 type gbp-common:endpoint-group-id;
152 "The groups associated with this endpoint";
156 leaf-list condition {
157 type gbp-common:condition-name;
159 "The conditions associated with this endpoint";
164 "The last timestamp associated with this endpoint record. This
165 will be used for aging data in the registry.";
169 grouping has-endpoint-group-conditions {
171 "Base type for object with endpoint group to condition mappings.";
173 leaf endpoint-group {
174 description "The endpoint group conditions to assign";
175 type gbp-common:endpoint-group-id;
177 list endpoint-group-condition {
179 "The conditions associated with this endpoint group";
182 description "A condition name to associate.";
183 type gbp-common:condition-name;
188 grouping has-regular-location {
191 type instance-identifier;
193 leaf node-connector {
194 type instance-identifier;
198 grouping has-external-location {
199 leaf external-node-mount-point {
201 type instance-identifier;
203 leaf external-node-location {
204 type string; // TODO switch to external-reference
206 leaf external-node-connector {
207 type string; // TODO switch to external-reference
211 grouping has-location {
212 container real-location {
213 choice location-type {
214 case regular-location {
215 uses has-regular-location;
217 case external-location {
218 uses has-external-location;
222 container relative-location {
224 key "node node-connector";
225 uses has-regular-location;
227 list external-location {
228 key "external-node-mount-point external-node-connector";
229 uses has-external-location;
234 container endpoints {
236 "Repository for operational state data about endpoints needed
237 for policy resolution.";
240 list address-endpoints-by-containment {
242 uses containment-endpoint-key;
244 list address-endpoint {
246 uses address-endpoint-key;
248 uses parent-child-endpoints;
249 uses common-endpoint-fields;
254 list containment-endpoint {
256 uses containment-endpoint-key;
258 uses has-child-endpoints;
259 uses common-endpoint-fields;
263 container endpoint-locations {
264 list address-endpoint-location {
265 key "containment address";
270 list containment-endpoint-location {
272 uses containment-endpoint-key;
277 rpc register-endpoint {
279 "Register a new endpoint into the registry. If there is already
280 an existing endpoint with the same keys, they will be overwritten
281 with the new information.";
284 list address-endpoint {
285 key "containment address";
288 uses parent-child-endpoints;
289 uses common-endpoint-fields;
292 list containment-endpoint {
294 uses containment-endpoint-key;
296 uses has-child-endpoints;
297 uses common-endpoint-fields;
303 rpc unregister-endpoint {
304 description "Unregister an endpoint or endpoints from the registry.";
307 list address-endpoint {
308 key "containment address";
311 list containment-endpoint {
313 uses containment-endpoint-key;