Added range type to subject-feature-definition/parameter
[groupbasedpolicy.git] / renderers / ofoverlay / src / main / yang / integration / openstackgbp / openstackgbp.yang
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8
9 module openstack-endpoint {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:openstackendpoint";
13     prefix "gbp-openstackendpoint";
14
15     import gbp-common {prefix gbp-common;}
16     import ietf-inet-types {prefix inet;}
17     import ietf-yang-types {
18         prefix yang;
19         revision-date 2010-09-24;
20     }
21 /*
22     import endpoint {
23         prefix endpoint;
24         revision-date 2014-04-21;
25     }
26 */
27     revision "2014-12-04" {
28         description
29             "Initial revision.";
30     }
31
32     grouping l2-key {
33         description
34             "The fields that identify an endpoint by a layer 2 address";
35         leaf l2-context {
36             type gbp-common:l2-bridge-domain-id;
37             description
38                 "The bridge domain for the layer 2 address for this endpoint";
39         }
40         leaf mac-address {
41             type yang:mac-address;
42             description
43                 "The MAC address for the endpoint";
44         }
45     }
46
47     grouping l3-key {
48         description
49             "The fields that identify an endpoint by a layer 3 address";
50         leaf l3-context {
51             type gbp-common:l3-context-id;
52             mandatory true;
53             description
54                 "The context for this layer 3 address";
55         }
56         leaf ip-address {
57             type inet:ip-address;
58             mandatory true;
59             description
60                 "The actual IP address for the endpoint";
61         }
62     }
63
64     // A base type for an end point
65     grouping endpoint-fields {
66         description "An endpoint and its associated metadata";
67         leaf tenant {
68             type gbp-common:tenant-id;
69             mandatory true;
70             description
71                 "The tenant with which this endpoint is associated";
72         }
73
74         uses l2-key;
75
76         list l3-address {
77             description
78                 "All the layer 3 addresses associated with this endpoint";
79             key "l3-context ip-address";
80             uses l3-key;
81         }
82         leaf endpoint-group {
83             type gbp-common:endpoint-group-id;
84             description
85                 "The group associated with this endpoint";
86         }
87         leaf-list condition {
88             type gbp-common:condition-name;
89             description
90                 "The conditions associated with this endpoint";
91         }
92         leaf timestamp {
93             type int64;
94             description
95                 "The last timestamp associated with this endpoint record.
96                  This will be used for aging data in the registry.";
97         }
98         leaf neutron-port-id {
99             description
100                   "Tap port known to neutron at time of VM creation";
101             type gbp-common:name;
102         }
103     }
104
105     grouping has-endpoint-group-conditions {
106         description
107             "Base type for object with endpoint group to condition
108              mappings.";
109
110         leaf endpoint-group {
111             description "The endpoint group conditions to assign";
112             type gbp-common:endpoint-group-id;
113         }
114         list endpoint-group-condition {
115             description
116                 "The conditions associated with this endpoint
117                  group";
118             key "condition";
119             leaf condition {
120                 description "A condition name to associate.";
121                 type gbp-common:condition-name;
122             }
123         }
124     }
125
126
127     // A base type for an end point
128     container openstack-endpoints {
129         description
130             "Repository for operational state data about endpoints needed for
131              policy resolution.";
132         config false;
133
134         list endpoint {
135             description
136                 "Endpoints indexed by layer 2 addreses.  When modifying
137                  data here, you must also modify data in the
138                  endpoints-l3 list as well.";
139             key "l2-context mac-address";
140             uses endpoint-fields;
141         }
142
143         list endpoint-l3 {
144             description
145                 "Endpoints indexed by layer 3 addreses.  When modifying
146                  data here, you must also modify data in the endpoints
147                  list as well.";
148
149             key "l3-context ip-address";
150             uses l3-key;
151
152             uses endpoint-fields;
153         }
154
155         list condition-mapping {
156             description
157                 "A list mapping conditions to entire endpoint groups.
158                  This offers a quickly way to set a condition on many
159                  endpoints at once.";
160
161             key "endpoint-group";
162             uses has-endpoint-group-conditions;
163         }
164
165     }
166
167     rpc unregister-endpoint {
168         description "Unregister an endpoint or endpoints from the registry.";
169
170         input {
171             list l2 {
172                 key "l2-context mac-address";
173                 uses l2-key;
174             }
175             list l3 {
176                 key "l3-context ip-address";
177                 uses l3-key;
178             }
179         }
180     }
181
182     rpc register-endpoint {
183         description
184             "Register a new endpoint into the registry.  If there
185              is already an existing endpoint with the same keys, they
186              will be overwritten with the new information.";
187
188         input {
189             uses endpoint-fields;
190           }
191         }
192     }
193
194 }