Bug 4988: OF statistics & REST client
[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     import policy {prefix policy;}
24
25     description
26         "This module defines the group-based policy ofoverlay renderer model.";
27
28     revision "2014-05-28" {
29         description
30             "Initial revision.";
31     }
32
33     // ******************
34     // Configuration Data
35     // ******************
36     container of-overlay-config {
37         description
38             "Configuration for the OpenFlow overlay renderer";
39
40         config true;
41
42         leaf encapsulation-format {
43             description "The encapsulation format to use for tunnels";
44             type enumeration {
45                 enum vxlan {
46                     description "Use VXLAN encapsulation";
47                 }
48             }
49         }
50
51         leaf learning-mode {
52             description
53                 "Selects how and whether we learn endpoints";
54             type enumeration {
55                 enum orchestrated {
56                     description
57                         "An external orchestration system will provide
58                          information about all endpoints, and no
59                          direct learning will occur.";
60                 }
61             }
62         }
63
64         uses initial-values;
65         uses sflow-values;
66     }
67
68     grouping initial-values {
69         description
70             "Initial value of table offset is set in config subsystem";
71         leaf gbp-ofoverlay-table-offset {
72             description
73                 "Used to offset pipeline to start at offset+1. Table0 is required.
74                 This is to allow the enduser to configure where the GBP pipeline starts.";
75             type uint8;
76         }
77     }
78
79     grouping sflow-values {
80         description
81             "Values for sFlow-RT collector setup";
82         container sflow-client-settings {
83             leaf gbp-ofoverlay-sflow-retrieve-interval {
84                 description
85                     "Interval (seconds) for periodical flowcache data retrieve.";
86                 type uint32;
87                 default 20;
88             }
89             leaf gbp-ofoverlay-sflow-collector-uri {
90                 description
91                     "URI of sFlow-RT collector, including schema, IP/domain, port. No trailing slash.";
92                 mandatory true;
93                 type string;
94             }
95         }
96     }
97
98     grouping endpoint-location {
99         description
100             "The location for this endpoint in the overlay network";
101         leaf node-id {
102             description
103                 "The OpenFlow switch for the endpoint. Must be included
104                  for all internal endpoints.  The format is
105                  openflow:[dpid] where the dpid is the value of the
106                  switch DPID cast to a long.";
107             type inv:node-id;
108         }
109         leaf node-connector-id {
110             description
111                 "The node connector for the endpoint's OpenFlow port. The
112                  format is openflow:[dpid]:[port] where the dpid is
113                  the value of the switch DPID cast to a long, and port
114                  is the openflow port number of the interface where
115                  the endpoint is connected.";
116             type inv:node-connector-id;
117         }
118         leaf port-name {
119             type gbp-common:name;
120             description
121                 "Port name";
122         }
123         leaf interface-id {
124             type gbp-common:unique-id;
125             description
126                 "Unique identifier for interface";
127         }
128     }
129
130     augment "/endpoint:endpoints/endpoint:endpoint" {
131         ext:augment-identifier "of-overlay-context";
132         uses endpoint-location;
133     }
134
135     augment "/endpoint:endpoints/endpoint:endpoint-l3" {
136         ext:augment-identifier "of-overlay-l3-context";
137         uses endpoint-location;
138     }
139
140     augment "/endpoint:register-endpoint/endpoint:input" {
141         ext:augment-identifier "of-overlay-context-input";
142         uses endpoint-location;
143     }
144
145     augment "/policy:tenants/policy:tenant/policy:forwarding-context/policy:l2-flood-domain" {
146         ext:augment-identifier "segmentation";
147         leaf segmentation-id {
148             description "Logical segmentation of an l2-flood-domain, e.g. by using VLANs.";
149             type uint16 {
150                 range "1 .. 4095";
151             }
152         }
153     }
154
155     /* 
156     * TODO: should add "portname" to this instead of using heuristic name.
157     * Then SwitchManager could pull from here potentially. The only things that should
158     * populate this are REST or OVSDB-Neutron ... but now we could listen on OVSDB for when
159     * an SFF creates this for us and use the same tunnel... 
160     */
161     augment "/inv:nodes/inv:node" {
162         ext:augment-identifier "of-overlay-node-config";
163         list tunnel {
164             key "tunnel-type";
165             uses ovsdb-overlay:tunnel-type-attributes;
166             uses ovsdb-overlay:ip-port-locator;
167             leaf node-connector-id {
168                 description
169                     "The node connector where is the tunnel located. The
170                      format is openflow:[dpid]:[port] where the dpid is
171                      the value of the switch DPID cast to a long, and port
172                      is the openflow port number of the interface where
173                      the endpoint is connected.";
174                 type inv:node-connector-id;
175             }
176         }
177         container ovsdb-config {
178             leaf ip {
179                 description
180                     "The IP address used to connect to OVSDB on this switch";
181                 type inet:ip-address;
182             }
183             leaf port {
184                 description
185                     "The port number used to connect to OVSDB on this switch";
186                 type inet:port-number;
187                 default 6640;
188             }
189         }
190         list external-interfaces {
191             description
192                 "The node connectors for the external interfaces to the underlay.
193                 If interface name is required, can be looked up from inventory using
194                 this field as a key to FCNC (FlowCapableNodeConnector)";
195             key "node-connector-id";
196             leaf node-connector-id {
197                 type inv:node-connector-id;
198             }
199         }
200     }
201 }