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