Added range type to subject-feature-definition/parameter
[groupbasedpolicy.git] / renderers / ofoverlay / src / main / yang / ofoverlay.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 ofoverlay {
10     yang-version 1;
11
12     namespace "urn:opendaylight:groupbasedpolicy:ofoverlay";
13     prefix "ofoverlay";
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 opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
19
20     import gbp-common {prefix gbp-common;}
21     import endpoint {prefix endpoint;}
22
23     description
24         "This module defines the group-based policy ofoverlay renderer model.";
25
26     revision "2014-05-28" {
27         description
28             "Initial revision.";
29     }
30
31     // ******************
32     // Configuration Data
33     // ******************
34     container of-overlay-config {
35         description
36             "Configuration for the OpenFlow overlay renderer";
37
38         config true;
39
40         leaf encapsulation-format {
41             description "The encapsulation format to use for tunnels";
42             type enumeration {
43                 enum vxlan {
44                     description "Use VXLAN encapsulation";
45                 }
46             }
47         }
48
49         leaf learning-mode {
50             description 
51                 "Selects how and whether we learn endpoints";
52             type enumeration {
53                 enum orchestrated {
54                     description 
55                         "An external orchestration system will provide 
56                          information about all endpoints, and no
57                          direct learning will occur.";
58                 }
59             }
60         }
61     }
62     /*
63     container of-overlay-operational {
64         description 
65             "Operational parameters for the OpenFlow overlay renderer";
66
67         config false;
68
69         list data-plane-ordinal {
70             description 
71                 "Map elements of the policy to the id used on the network";
72             key "tenant id";
73             leaf tenant {
74                 description "The tenant for the policy element";
75                 type gbp-common:tenant-id;
76             }
77             leaf id {
78                 description "The ID of the item";
79                 type gbp-common:unique-id;
80             }
81             leaf ordinal {
82                 description "The 32-bit ordinal for the item";
83                 type uint32;
84             }
85         }
86     }
87     */
88     grouping endpoint-location {
89         description 
90             "The location for this endpoint in the overlay network";
91
92         leaf location-type {
93             default internal;
94
95             type enumeration {
96                 enum internal {
97                     description 
98                     "The endpoint is located on a port that is part of 
99                      the overlay network.  You must include the node
100                      ID and port number for this endpoint.";
101                 }
102                 enum external {
103                     description "This endpoint is not inside the overlay.";
104                 }
105             }
106         }
107
108         leaf node-id {
109             description 
110                 "The OpenFlow switch for the endpoint. Must be included 
111                  for all internal endpoints.  The format is
112                  openflow:[dpid] where the dpid is the value of the
113                  switch DPID cast to a long.";
114             type inv:node-id;
115         }
116
117         leaf node-connector-id {
118             description 
119                 "The node connector for the endpoint's OpenFlow port. The 
120                  format is openflow:[dpid]:[port] where the dpid is
121                  the value of the switch DPID cast to a long, and port
122                  is the openflow port number of the interface where
123                  the endpoint is connected.";
124             type inv:node-connector-id;
125         }
126     }
127
128     augment "/endpoint:endpoints/endpoint:endpoint" {
129         ext:augment-identifier "of-overlay-context";
130         uses endpoint-location;
131     }
132
133     augment "/endpoint:register-endpoint/endpoint:input" {
134         ext:augment-identifier "of-overlay-context-input";
135         uses endpoint-location;
136     }
137
138     augment "/inv:nodes/inv:node" {
139         ext:augment-identifier "of-overlay-node-config";
140
141         leaf tunnel-ip {
142             description 
143                 "The IP address used for tunnel termination on this switch";
144             type inet:ip-address;
145         }
146         container ovsdb-config {
147             leaf ip {
148                 description 
149                     "The IP address used to connect to OVSDB on this switch";
150                 type inet:ip-address;
151             }
152             leaf port {
153                 description 
154                     "The port number used to connect to OVSDB on this switch";
155                 type inet:port-number;
156                 default 6640;
157             }
158         }
159         leaf-list external-interfaces {
160             description 
161                 "The names of the OpenFlow interfaces that are external and 
162                  lead to the underlay network.  Can be specified as a 
163                  regular expression.";
164             type string;
165         }
166     }
167 }