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:base_endpoint";
13 prefix "base-endpoint";
15 import gbp-common { prefix gbp-common; revision-date 2014-04-21; }
16 import forwarding { prefix forwarding; revision-date 2016-04-27; }
18 revision "2016-04-27" {
23 grouping address-endpoint-key {
24 uses forwarding:context-key;
25 uses forwarding:has-address-type;
32 grouping has-child-endpoints {
34 key "context-type context-id address-type address";
35 uses address-endpoint-key;
39 grouping parent-child-endpoints {
40 choice parent-endpoint-choice {
41 case parent-containment-endpoint-case {
42 list parent-containment-endpoint {
43 key "context-type context-id";
44 uses forwarding:context-key;
47 case parent-endpoint-case {
48 list parent-endpoint {
49 key "context-type context-id address-type address";
50 uses address-endpoint-key;
54 uses has-child-endpoints;
57 grouping common-endpoint-fields {
59 type gbp-common:tenant-id;
62 "The tenant with which this endpoint is associated";
64 container network-containment {
67 "The network domain associated with this endpoint's fowarding
69 case network-domain-containment {
70 uses forwarding:network-domain-key;
72 case forwarding-context-containment {
73 uses forwarding:context-key;
77 leaf-list endpoint-group {
78 type gbp-common:endpoint-group-id;
80 "The groups associated with this endpoint";
85 type gbp-common:condition-name;
87 "The conditions associated with this endpoint";
92 "The last timestamp associated with this endpoint record. This
93 will be used for aging data in the registry.";
97 grouping address-endpoint-fields {
98 uses address-endpoint-key;
99 uses parent-child-endpoints;
100 uses common-endpoint-fields;
103 grouping containment-endpoint-fields {
104 uses forwarding:context-key;
105 uses has-child-endpoints;
106 uses common-endpoint-fields;
109 grouping has-endpoint-group-conditions {
111 "Base type for object with endpoint group to condition mappings.";
113 leaf endpoint-group {
114 description "The endpoint group conditions to assign";
115 type gbp-common:endpoint-group-id;
117 list endpoint-group-condition {
119 "The conditions associated with this endpoint group";
122 description "A condition name to associate.";
123 type gbp-common:condition-name;
128 grouping internal-location-fields {
129 description "Location inside ODL - node and node-connector
130 are represented directly in ODL.";
133 type instance-identifier;
135 leaf internal-node-connector {
136 type instance-identifier;
140 grouping external-location-fields {
141 description "Location outside of ODL - node and node-connector
142 are outside of ODL. external-node-mount-point is path
143 to external system where node and node-connector are located.";
144 leaf external-node-mount-point {
146 type instance-identifier;
149 type string; // TODO switch to external-reference
151 leaf external-node-connector {
152 type string; // TODO switch to external-reference
156 grouping has-absolute-location {
157 container absolute-location {
158 choice location-type {
159 case internal-location-case {
160 uses internal-location-fields;
162 case external-location-case {
163 uses external-location-fields;
169 grouping has-relative-location {
170 container relative-locations {
171 list internal-location {
172 key "internal-node internal-node-connector";
173 uses internal-location-fields;
175 list external-location {
176 key "external-node-mount-point external-node-connector";
177 uses external-location-fields;
182 grouping has-location {
183 uses has-absolute-location;
184 uses has-relative-location;
187 container endpoints {
189 "Repository for operational state data about endpoints needed
190 for policy resolution.";
193 container address-endpoints {
194 list address-endpoint {
195 key "context-type context-id address-type address";
196 uses address-endpoint-fields;
200 container containment-endpoints {
201 list containment-endpoint {
202 key "context-type context-id";
203 uses containment-endpoint-fields;
208 container endpoint-locations {
211 list address-endpoint-location {
212 key "context-type context-id address-type address";
213 uses address-endpoint-key;
217 list containment-endpoint-location {
218 key "context-type context-id";
219 uses forwarding:context-key;
220 uses has-relative-location;
224 rpc register-endpoint {
226 "Register a new endpoint into the registry. If there is already
227 an existing endpoint with the same keys, they will be overwritten
228 with the new information.";
231 list address-endpoint-reg {
232 key "context-type context-id address-type address";
233 uses address-endpoint-fields;
236 list containment-endpoint-reg {
237 key "context-type context-id";
238 uses containment-endpoint-fields;
239 uses has-relative-location;
244 rpc unregister-endpoint {
245 description "Unregister an endpoint or endpoints from the registry.";
248 list address-endpoint-unreg {
249 key "context-type context-id address-type address";
250 uses address-endpoint-key;
252 list containment-endpoint-unreg {
253 key "context-type context-id";
254 uses forwarding:context-key;