Added range type to subject-feature-definition/parameter
[groupbasedpolicy.git] / groupbasedpolicy / src / main / yang / renderer / opflex / opflex.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 opflex {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:opflex";
13     prefix "opflex";
14
15     import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }
16
17     import yang-ext {prefix ext; revision-date "2013-07-09";}
18     import gbp-common {prefix gbp-common;}
19     import endpoint {prefix endpoint;}
20
21     description
22         "This module defines the group-based policy OpFlex renderer model.";
23
24     revision "2014-05-28" {
25         description
26             "Initial revision.";
27     }
28     
29     typedef serialization {
30         description
31             "The serialization to use for OpFlex messages.";
32
33         type enumeration {
34             enum json {
35                 description
36                 "JSON 1.0 serialization.";
37             }
38             enum xml {
39                 description
40                 "XML serialization.";
41             }
42             enum binary {
43                 description
44                 "OpFlex binary serialization.";
45             }
46         }
47     }
48
49     container discovery-definitions {
50         description
51             "The nodes that any OpFlex agent needs to communicate
52              with in an OpFlex policy fabric.";
53
54         config true;
55
56         leaf domain {
57             description
58                 "The OpFlex administrative domain.";
59     
60             config true;
61     
62             type string;
63         }
64
65         list policy-repository {
66             description
67                 "A repository that the OpFlex agent can use for resolving
68                  policies.";
69
70             key "id";
71
72             leaf id {
73                 description 
74                    "The id for the policy repository.";
75                 type string;
76             }
77             leaf port {
78                 description 
79                    "The port number to use for the connection";
80                 type int32;
81             }
82             leaf serialization-type {
83                 description 
84                     "The serialization to use for this connection.";
85                 type serialization;
86             }
87         }
88
89         list endpoint-registry {
90             description
91                 "A repository that the OpFlex agent can use for registration
92                  and lookup of endpoints.";
93
94             key "id";
95
96             leaf id {
97                 description 
98                    "The id for the endpoint registry.";
99                 type string;
100             }
101             leaf port {
102                 description 
103                    "The port number to use for the connection";
104                 type int32;
105             }
106             leaf serialization-type {
107                 description 
108                     "The serialization to use for this connection.";
109                 type serialization;
110             }
111         }
112
113         list observer {
114             description
115                 "A repository that the OpFlex agent can send State Report
116                  messages to.";
117
118             key "id";
119
120             leaf id {
121                 description 
122                    "The id for the Observer.";
123                 type string;
124             }
125             leaf port {
126                 description 
127                    "The port number to use for the connection";
128                 type int32;
129             }
130             leaf serialization-type {
131                 description 
132                     "The serialization to use for this connection.";
133                 type serialization;
134             }
135         }
136     }
137
138     grouping endpoint-location {
139         description 
140             "The location for this endpoint in the overlay network";
141
142         leaf location-type {
143             default internal;
144
145             type enumeration {
146                 enum internal {
147                     description 
148                     "The endpoint is located on a port that is part of 
149                      the overlay network.  You must include the node
150                      ID and port number for this endpoint.";
151                 }
152                 enum external {
153                     description "This endpoint is not inside the overlay.";
154                 }
155             }
156         }
157         leaf agent-id {
158             description 
159                 "The OpFlex agent where the endpoing is located. Must be included 
160                  for all internal endpoints.  The format is the agent identifier,
161                  which is an IP address or DNS name ':' port number.";
162             type string;
163         }
164         leaf agent-ep-location {
165             description 
166                 "The location of the endpoint on the OpFlex agent. The format of
167                  this is dependent on the renderer used by the agent.";
168             type string;
169         }
170     }
171
172     augment "/endpoint:endpoints/endpoint:endpoint" {
173         ext:augment-identifier "opflex-overlay-context";
174         uses endpoint-location;
175     }
176
177     augment "/endpoint:register-endpoint/endpoint:input" {
178         ext:augment-identifier "opflex-overlay-context-input";
179         uses endpoint-location;
180     }
181
182     augment "/endpoint:endpoints/endpoint:endpoint-l3" {
183         ext:augment-identifier "opflex-overlay-context-l3";
184         uses endpoint-location;
185     }
186
187 }