1 module affinity-config-all {
2 namespace "urn:opendaylight:affinity";
5 import ietf-inet-types { prefix inet; }
6 import ietf-yang-types { prefix yang; }
7 import yang-ext { prefix ext; }
8 import opendaylight-inventory {prefix inv;}
9 import opendaylight-l2-types { prefix l2types; }
11 revision "2013-09-25" {
12 description "Initial revision of affinity model to be reviewed";
16 //**************************************************
17 // Stationary location within the network -- switch + port, including physical switch port
18 // or virtual switch port within a hypervisor virtual switch.
19 //**************************************************
20 grouping affinity-endpoint {
22 type inv:node-connector-id;
26 //**************************************************
27 // Affinity address domain: This represents a domain (i.e, set) of one or
28 // more addresses. An affinity address may not always have a corresponding
29 // endpoint on the network, for example, an address domain representing
30 // external addresses, or north-south traffic in a data center). Here the
31 // IP address domain representing such external addresses does not map to
32 // endpoints or node connectors on the network.
33 // Whenever possible, the affinity service must resolve the address domain
34 // into a list of endpoints especially when the address is present on the network.
36 // Affinity address domains specify one or more of the following:
37 // layer 2 address (vlan + mac range)
38 // layer 3 address (IP prefix)
39 // layer 4 address (tcp or udp port number)
40 //**************************************************
42 grouping affinity-address-domain {
43 // l2-domain-address is vlan + MAC address range
44 container l2-address {
48 container mac-address-range {
49 uses mac-address-range;
53 // l3-domain-address is IPv4 prefix
55 type inet:ipv4-prefix;
59 container l4-address {
61 type string; // "tcp" or "udp"
64 type inet:port-number;
69 grouping mac-address-range {
71 type yang:mac-address;
74 type yang:mac-address;
78 typedef affinity-group-ref {
79 type instance-identifier;
82 typedef affinity-link-ref {
83 type instance-identifier;
86 grouping affinity-element {
91 description "affinity element";
92 case affinity-endpoint {
93 uses affinity-endpoint;
96 case affinity-address-domain {
97 uses affinity-address-domain;
101 //**************************************************
103 //**************************************************
104 grouping affinity-group {
108 list affinity-element {
110 uses affinity-element;
114 //**************************************************
115 // Affinity link connects one group (from group) to another (to
116 // group). It represents a set of flows that start from the source group
117 // and end in the destination group. An affinity link has attributes
118 // (policies) attached to it that represent how these flows must be
119 // handled. An affinity link also has directionality associated with
120 // it. A bidirectional affinity link is equivalent to two unidirectional
121 // affinity links, one in each direction.
122 //**************************************************
123 grouping affinity-link {
127 leaf from-affinity-group {
128 type affinity-group-ref;
130 leaf to-affinity-group {
131 type affinity-group-ref;
133 container attribute {
134 uses affinity-attribute;
138 typedef affinity-access-control-type {
145 //**************************************************
146 // Affinity attribute. Each is expanded in their own grouping construct below.
147 //**************************************************
148 grouping affinity-attribute {
152 choice attribute-type {
153 description "affinity attribute";
154 // Apply access control to selected flows.
155 case affinity-access-control {
156 leaf affinity-access-control {
157 type affinity-access-control-type;
161 // Apply waypoint routing to the selected flows and send it through service chain.
162 case network-service-chain {
163 leaf network-service-chain {
164 type network-service-chain-ref;
170 //**************************************************
171 // Network service chain configuration.
172 //**************************************************
173 typedef network-service-chain-ref {
174 type instance-identifier;
177 grouping network-service-chain {
183 uses network-service-function;
187 //**************************************************
188 // Network-service-function represented by one of the following
189 // types of addresses.
190 //**************************************************
191 grouping network-service-function {
195 // Address is either an IP address, MAC address, or switch/port.
197 description "Mac or Inet address";
199 type inv:node-connector-id;
200 type yang:mac-address;
201 type inet:ip-address;
206 // Main container that represents the complete set of affinity
207 // groups and links. Each set is represented as a YANG list with 'id'
208 // as the key. List contains affinity group and affinity link objects
210 container affinity-config {
211 list affinity-group {
213 ext:context-instance "affinity-group-context";
218 ext:context-instance "affinity-link-context";
223 //******************************
224 // RPCs to create affinity groups, add endpoints and address domains.
225 //******************************
226 rpc create-affinity-group {
237 rpc add-affinity-endpoint {
239 leaf affinity-endpoint {
240 type inv:node-connector-id;
250 rpc add-affinity-domain {
252 container affinity-domain {
253 uses affinity-address-domain;
263 rpc get-affinity-groups {
265 list affinity-group {
271 rpc get-affinity-links;
272 rpc get-affinity-group;
273 rpc get-affinity-link;
275 rpc get-stats-per-affinity-link;
277 //**************************************************
279 //**************************************************
280 notification new-affinity-endpoint;
281 notification new-affinity-domain;
282 notification modify-affinity-attribute;