Bug 3353 - added table offset to of-overlay-config
[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         uses initial-values;
64     }
65
66     grouping initial-values {
67         description
68             "Initial value of table offset is set in config subsystem";
69         leaf gbp-ofoverlay-table-offset {
70             description
71                 "Used to offset pipeline to start at offset+1. Table0 is required.
72                 This is to allow the enduser to configure where the GBP pipeline starts.";
73             type uint8;
74         }
75     }
76
77     grouping endpoint-location {
78         description
79             "The location for this endpoint in the overlay network";
80         leaf location-type {
81             default internal;
82             type enumeration {
83                 enum internal {
84                     description
85                     "The endpoint is located on a port that is part of
86                      the overlay network.  You must include the node
87                      ID and port number for this endpoint.";
88                 }
89                 enum external {
90                     description "This endpoint is not inside the overlay.";
91                 }
92             }
93         }
94         leaf node-id {
95             description
96                 "The OpenFlow switch for the endpoint. Must be included
97                  for all internal endpoints.  The format is
98                  openflow:[dpid] where the dpid is the value of the
99                  switch DPID cast to a long.";
100             type inv:node-id;
101         }
102         leaf node-connector-id {
103             description
104                 "The node connector for the endpoint's OpenFlow port. The
105                  format is openflow:[dpid]:[port] where the dpid is
106                  the value of the switch DPID cast to a long, and port
107                  is the openflow port number of the interface where
108                  the endpoint is connected.";
109             type inv:node-connector-id;
110         }
111         leaf port-name {
112             type gbp-common:name;
113             description
114                 "Port name";
115         }
116         leaf interface-id {
117             type gbp-common:unique-id;
118             description
119                 "Unique identifier for interface";
120         }
121     }
122
123     grouping napt-translations-fields {
124         container napt-translations {
125             description "List of NAPT translations";
126             list napt-translation {
127                 key "ip-address";
128                 uses napt-fields;
129             }
130         }
131     }
132
133     grouping napt-fields {
134         description "Support for IP NAPT";
135         leaf ip-address {
136             description "Ip address the L3Endpoint translates to.";
137             type inet:ip-address;
138         }
139         leaf port {
140             description "Port that L3Endpoint translates to.";
141             type inet:port-number;
142         }
143     }
144
145     augment "/endpoint:endpoints/endpoint:endpoint" {
146         ext:augment-identifier "of-overlay-context";
147         uses endpoint-location;
148     }
149
150     augment "/endpoint:endpoints/endpoint:endpoint-l3" {
151         ext:augment-identifier "of-overlay-l3-context";
152         uses endpoint-location;
153     }
154
155     augment "/endpoint:register-endpoint/endpoint:input" {
156         ext:augment-identifier "of-overlay-context-input";
157         uses endpoint-location;
158     }
159
160     augment "/endpoint:endpoints/endpoint:endpoint-l3" {
161         ext:augment-identifier "of-overlay-l3-nat";
162         uses napt-translations-fields;
163     }
164
165     augment "/endpoint:register-endpoint/endpoint:input" {
166         ext:augment-identifier "of-overlay-l3-nat-input";
167         uses napt-translations-fields;
168     }
169
170     augment "/inv:nodes/inv:node" {
171         ext:augment-identifier "of-overlay-node-config";
172         list tunnel {
173             key "tunnel-type";
174             uses ovsdb-overlay:tunnel-type-attributes;
175             uses ovsdb-overlay:ip-port-locator;
176             leaf node-connector-id {
177                 description
178                     "The node connector where is the tunnel located. The
179                      format is openflow:[dpid]:[port] where the dpid is
180                      the value of the switch DPID cast to a long, and port
181                      is the openflow port number of the interface where
182                      the endpoint is connected.";
183                 type inv:node-connector-id;
184             }
185         }
186         container ovsdb-config {
187             leaf ip {
188                 description
189                     "The IP address used to connect to OVSDB on this switch";
190                 type inet:ip-address;
191             }
192             leaf port {
193                 description
194                     "The port number used to connect to OVSDB on this switch";
195                 type inet:port-number;
196                 default 6640;
197             }
198         }
199         list external-interfaces {
200             description
201                 "The node connectors for the external interfaces to the underlay.
202                 If interface name is required, can be looked up from inventory using
203                 this field as a key to FCNC (FlowCapableNodeConnector)";
204             key "node-connector-id";
205             leaf node-connector-id {
206                 type inv:node-connector-id;
207             }
208         }
209     }
210 }