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 {prefix inet;}
17 import ietf-yang-types {
19 revision-date 2010-09-24;
22 revision "2014-04-21" {
29 "The fields that identify an endpoint by a layer 2 address";
31 type gbp-common:l2-bridge-domain-id;
33 "The bridge domain for the layer 2 address for this endpoint";
36 type yang:mac-address;
38 "The MAC address for the endpoint";
44 "The fields that identify an endpoint by a layer 3 address";
46 type gbp-common:l3-context-id;
49 "The context for this layer 3 address";
55 "The actual IP address for the endpoint";
59 grouping l3-prefix-key {
61 "The fields that identify an endpoint by a layer 3 prefix";
63 type gbp-common:l3-context-id;
66 "The context for this layer 3 prefix";
72 "The IP prefix for the endpoint";
76 // A base type for an end point
77 grouping endpoint-fields {
78 description "An endpoint and its associated metadata";
80 type gbp-common:tenant-id;
83 "The tenant with which this endpoint is associated";
88 leaf network-containment {
90 "The network domain associated with this endpoint's fowarding
92 type gbp-common:network-domain-id;
96 "All the layer 3 addresses associated with this endpoint";
97 key "l3-context ip-address";
100 leaf endpoint-group {
101 type gbp-common:endpoint-group-id;
103 "The group associated with this endpoint";
105 leaf-list endpoint-groups {
106 type gbp-common:endpoint-group-id;
108 "The groups associated with this endpoint";
111 leaf-list condition {
112 type gbp-common:condition-name;
114 "The conditions associated with this endpoint";
119 "The last timestamp associated with this endpoint record.
120 This will be used for aging data in the registry.";
124 // L3 Prefix EndPointFields
125 grouping endpoint-l3-prefix-fields {
126 description "An l3 prefix endpoint and its associated metadata";
129 type gbp-common:tenant-id;
132 "The tenant with which this endpoint is associated";
134 leaf endpoint-group {
135 type gbp-common:endpoint-group-id;
137 "The group associated with this endpoint";
139 leaf-list endpoint-groups {
140 type gbp-common:endpoint-group-id;
142 "The groups associated with this endpoint";
145 leaf-list condition {
146 type gbp-common:condition-name;
148 "The conditions associated with this endpoint";
150 list endpoint-l2-gateways {
151 key "l2-context mac-address";
154 list endpoint-l3-gateways {
155 key "l3-context ip-address";
161 "The last timestamp associated with this endpoint record.
162 This will be used for aging data in the registry.";
166 grouping has-endpoint-group-conditions {
168 "Base type for object with endpoint group to condition
171 leaf endpoint-group {
172 description "The endpoint group conditions to assign";
173 type gbp-common:endpoint-group-id;
175 list endpoint-group-condition {
177 "The conditions associated with this endpoint
181 description "A condition name to associate.";
182 type gbp-common:condition-name;
187 container endpoints {
189 "Repository for operational state data about endpoints needed for
195 "Endpoints indexed by layer 2 addreses. When modifying
196 data here, you must also modify data in the
197 endpoints-l3 list as well.";
198 key "l2-context mac-address";
199 uses endpoint-fields;
204 "Endpoints indexed by layer 3 addreses. When modifying
205 data here, you must also modify data in the endpoints
207 key "l3-context ip-address";
209 uses endpoint-fields;
212 list endpoint-l3-prefix {
213 key "l3-context ip-prefix";
214 uses endpoint-l3-prefix-fields;
217 list condition-mapping {
219 "A list mapping conditions to entire endpoint groups.
220 This offers a quickly way to set a condition on many
223 key "endpoint-group";
224 uses has-endpoint-group-conditions;
228 rpc register-endpoint {
230 "Register a new endpoint into the registry. If there
231 is already an existing endpoint with the same keys, they
232 will be overwritten with the new information.";
235 uses endpoint-fields;
239 rpc register-l3-prefix-endpoint {
241 "Register an L3 Prefix Endpoint to the endpoint registery. If there
242 is already an existing endpoint with the same keys, they
243 will be overwritten with the new information.";
246 uses endpoint-l3-prefix-fields;
250 rpc unregister-endpoint {
251 description "Unregister an endpoint or endpoints from the registry.";
255 key "l2-context mac-address";
259 key "l3-context ip-address";
263 key "l3-context ip-prefix";
269 rpc set-endpoint-group-conditions {
271 "Set a list of conditions for a particular endpoint group.
272 These conditions will apply to all endpoints in the
273 endpoint group. These conditions will be added to the
274 existing list of conditions.";
277 uses has-endpoint-group-conditions;
281 rpc unset-endpoint-group-conditions {
283 "Remove a list of conditions from an endpoint group.";
286 uses has-endpoint-group-conditions;