2 * Copyright (c) 2014 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:endpoint";
13 prefix "gbp-endpoint";
15 import gbp-common {prefix gbp-common;}
16 import ietf-inet-types {
18 revision-date 2013-07-15;
20 import ietf-yang-types {
22 revision-date 2013-07-15;
25 revision "2014-04-21" {
32 "The fields that identify an endpoint by a layer 2 address";
34 type gbp-common:l2-bridge-domain-id;
36 "The bridge domain for the layer 2 address for this endpoint";
39 type yang:mac-address;
41 "The MAC address for the endpoint";
47 "The fields that identify an endpoint by a layer 3 address";
49 type gbp-common:l3-context-id;
52 "The context for this layer 3 address";
58 "The actual IP address for the endpoint";
62 grouping l3-prefix-key {
64 "The fields that identify an endpoint by a layer 3 prefix";
66 type gbp-common:l3-context-id;
69 "The context for this layer 3 prefix";
75 "The IP prefix for the endpoint";
79 // A base type for an end point
80 grouping endpoint-fields {
81 description "An endpoint and its associated metadata";
83 type gbp-common:tenant-id;
86 "The tenant with which this endpoint is associated";
91 leaf network-containment {
93 "The network domain associated with this endpoint's fowarding
95 type gbp-common:network-domain-id;
99 "All the layer 3 addresses associated with this endpoint";
100 key "l3-context ip-address";
103 leaf endpoint-group {
104 type gbp-common:endpoint-group-id;
106 "The group associated with this endpoint";
108 leaf-list endpoint-groups {
109 type gbp-common:endpoint-group-id;
111 "The groups associated with this endpoint";
114 leaf-list condition {
115 type gbp-common:condition-name;
117 "The conditions associated with this endpoint";
122 "The last timestamp associated with this endpoint record.
123 This will be used for aging data in the registry.";
127 // L3 Prefix EndPointFields
128 grouping endpoint-l3-prefix-fields {
129 description "An l3 prefix endpoint and its associated metadata";
132 type gbp-common:tenant-id;
135 "The tenant with which this endpoint is associated";
137 leaf endpoint-group {
138 type gbp-common:endpoint-group-id;
140 "The group associated with this endpoint";
142 leaf-list endpoint-groups {
143 type gbp-common:endpoint-group-id;
145 "The groups associated with this endpoint";
148 leaf-list condition {
149 type gbp-common:condition-name;
151 "The conditions associated with this endpoint";
153 list endpoint-l2-gateways {
154 key "l2-context mac-address";
157 list endpoint-l3-gateways {
158 key "l3-context ip-address";
164 "The last timestamp associated with this endpoint record.
165 This 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
174 leaf endpoint-group {
175 description "The endpoint group conditions to assign";
176 type gbp-common:endpoint-group-id;
178 list endpoint-group-condition {
180 "The conditions associated with this endpoint
184 description "A condition name to associate.";
185 type gbp-common:condition-name;
190 container endpoints {
192 // use base-endpoint.yang instead
196 "Repository for operational state data about endpoints needed for
202 "Endpoints indexed by layer 2 addreses. When modifying
203 data here, you must also modify data in the
204 endpoints-l3 list as well.";
205 key "l2-context mac-address";
206 uses endpoint-fields;
211 "Endpoints indexed by layer 3 addreses. When modifying
212 data here, you must also modify data in the endpoints
214 key "l3-context ip-address";
216 uses endpoint-fields;
219 list endpoint-l3-prefix {
220 key "l3-context ip-prefix";
221 uses endpoint-l3-prefix-fields;
224 list condition-mapping {
226 "A list mapping conditions to entire endpoint groups.
227 This offers a quickly way to set a condition on many
230 key "endpoint-group";
231 uses has-endpoint-group-conditions;
235 rpc register-endpoint {
237 // use base-endpoint.yang instead
241 "Register a new endpoint into the registry. If there
242 is already an existing endpoint with the same keys, they
243 will be overwritten with the new information.";
246 uses endpoint-fields;
250 rpc register-l3-prefix-endpoint {
252 // use base-endpoint.yang instead
256 "Register an L3 Prefix Endpoint to the endpoint registery. If there
257 is already an existing endpoint with the same keys, they
258 will be overwritten with the new information.";
261 uses endpoint-l3-prefix-fields;
265 rpc unregister-endpoint {
267 // use base-endpoint.yang instead
270 description "Unregister an endpoint or endpoints from the registry.";
274 key "l2-context mac-address";
278 key "l3-context ip-address";
282 key "l3-context ip-prefix";
288 rpc set-endpoint-group-conditions {
293 "Set a list of conditions for a particular endpoint group.
294 These conditions will apply to all endpoints in the
295 endpoint group. These conditions will be added to the
296 existing list of conditions.";
299 uses has-endpoint-group-conditions;
303 rpc unset-endpoint-group-conditions {
308 "Remove a list of conditions from an endpoint group.";
311 uses has-endpoint-group-conditions;