1618ee9518c1088d20f6cfedde5975e8cb4d5e39
[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     augment "/endpoint:endpoints/endpoint:endpoint" {
124         ext:augment-identifier "of-overlay-context";
125         uses endpoint-location;
126     }
127
128     augment "/endpoint:endpoints/endpoint:endpoint-l3" {
129         ext:augment-identifier "of-overlay-l3-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         list tunnel {
141             key "tunnel-type";
142             uses ovsdb-overlay:tunnel-type-attributes;
143             uses ovsdb-overlay:ip-port-locator;
144             leaf node-connector-id {
145                 description
146                     "The node connector where is the tunnel located. The
147                      format is openflow:[dpid]:[port] where the dpid is
148                      the value of the switch DPID cast to a long, and port
149                      is the openflow port number of the interface where
150                      the endpoint is connected.";
151                 type inv:node-connector-id;
152             }
153         }
154         container ovsdb-config {
155             leaf ip {
156                 description
157                     "The IP address used to connect to OVSDB on this switch";
158                 type inet:ip-address;
159             }
160             leaf port {
161                 description
162                     "The port number used to connect to OVSDB on this switch";
163                 type inet:port-number;
164                 default 6640;
165             }
166         }
167         list external-interfaces {
168             description
169                 "The node connectors for the external interfaces to the underlay.
170                 If interface name is required, can be looked up from inventory using
171                 this field as a key to FCNC (FlowCapableNodeConnector)";
172             key "node-connector-id";
173             leaf node-connector-id {
174                 type inv:node-connector-id;
175             }
176         }
177     }
178 }