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 2010-09-24;
20 import ietf-yang-types {
22 revision-date 2010-09-24;
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 "Repository for operational state data about endpoints needed for
198 "Endpoints indexed by layer 2 addreses. When modifying
199 data here, you must also modify data in the
200 endpoints-l3 list as well.";
201 key "l2-context mac-address";
202 uses endpoint-fields;
207 "Endpoints indexed by layer 3 addreses. When modifying
208 data here, you must also modify data in the endpoints
210 key "l3-context ip-address";
212 uses endpoint-fields;
215 list endpoint-l3-prefix {
216 key "l3-context ip-prefix";
217 uses endpoint-l3-prefix-fields;
220 list condition-mapping {
222 "A list mapping conditions to entire endpoint groups.
223 This offers a quickly way to set a condition on many
226 key "endpoint-group";
227 uses has-endpoint-group-conditions;
231 rpc register-endpoint {
233 "Register a new endpoint into the registry. If there
234 is already an existing endpoint with the same keys, they
235 will be overwritten with the new information.";
238 uses endpoint-fields;
242 rpc register-l3-prefix-endpoint {
244 "Register an L3 Prefix Endpoint to the endpoint registery. If there
245 is already an existing endpoint with the same keys, they
246 will be overwritten with the new information.";
249 uses endpoint-l3-prefix-fields;
253 rpc unregister-endpoint {
254 description "Unregister an endpoint or endpoints from the registry.";
258 key "l2-context mac-address";
262 key "l3-context ip-address";
266 key "l3-context ip-prefix";
272 rpc set-endpoint-group-conditions {
274 "Set a list of conditions for a particular endpoint group.
275 These conditions will apply to all endpoints in the
276 endpoint group. These conditions will be added to the
277 existing list of conditions.";
280 uses has-endpoint-group-conditions;
284 rpc unset-endpoint-group-conditions {
286 "Remove a list of conditions from an endpoint group.";
289 uses has-endpoint-group-conditions;