d2b7d4989a6e8b1ff6951c5ce0994029bc0ec379
[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         leaf port-name {
127             type gbp-common:name;
128             description
129                 "Port name";
130         }
131         leaf interface-id {
132             type gbp-common:unique-id;
133             description
134                 "Unique identifier for interface";
135         }
136
137     }
138
139     augment "/endpoint:endpoints/endpoint:endpoint" {
140         ext:augment-identifier "of-overlay-context";
141         uses endpoint-location;
142     }
143
144     augment "/endpoint:register-endpoint/endpoint:input" {
145         ext:augment-identifier "of-overlay-context-input";
146         uses endpoint-location;
147     }
148
149     augment "/inv:nodes/inv:node" {
150         ext:augment-identifier "of-overlay-node-config";
151
152         leaf tunnel-ip {
153             description
154                 "The IP address used for tunnel termination on this switch";
155             type inet:ip-address;
156         }
157         container ovsdb-config {
158             leaf ip {
159                 description
160                     "The IP address used to connect to OVSDB on this switch";
161                 type inet:ip-address;
162             }
163             leaf port {
164                 description
165                     "The port number used to connect to OVSDB on this switch";
166                 type inet:port-number;
167                 default 6640;
168             }
169         }
170         leaf-list external-interfaces {
171             description
172                 "The names of the OpenFlow interfaces that are external and
173                  lead to the underlay network.  Can be specified as a
174                  regular expression.";
175             type string;
176         }
177     }
178 }