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 -- switch + port, includes physical or virtual
18 // ports for example within a hypervisor representing a virtual switch.
19 //**************************************************
20 grouping affinity-endpoint {
22 type inv:node-connector-id;
27 //**************************************************
28 // Affinity address domain: This represents a domain (i.e, set) of one or
29 // more addresses. An affinity address may not have a corresponding
30 // endpoint on the network, for example, for traffic from a set of
31 // external addresses (north-south traffic in a data center), the source
32 // IP address domain is not required to map exactly to endpoints or node
33 // connectors on the network. We assume that there will be a resolution
34 // service that resolves one of these into an endpoint, when the address
35 // is present on the network.
36 //**************************************************
37 grouping affinity-address-domain {
41 // Address is either an IP address, IP prefix, IP range, or
42 // MAC address, or MAC range. Address may also be a transport
43 // protocol layer address.
46 description "Mac or Inet address";
50 type l2types:vlan-id; // tbd
51 type yang:mac-address;
52 // type yang:mac-address-range;
53 // type yang:tp-address; // tbd
58 typedef affinity-group-ref {
59 type instance-identifier;
62 typedef affinity-link-ref {
63 type instance-identifier;
66 typedef network-service-chain-ref {
67 type instance-identifier;
71 grouping affinity-element {
76 description "affinity element";
77 case affinity-endpoint {
78 uses affinity-endpoint;
81 // Apply waypoint routing to the selected flows and send it through service chain.
82 case affinity-address-domain {
83 uses affinity-address-domain;
87 //**************************************************
89 //**************************************************
90 grouping affinity-group {
94 list affinity-element {
96 uses affinity-element;
100 //**************************************************
101 // Affinity link connects one group (from group) to another (to
102 // group). It represents a set of flows that start from the source group
103 // and end in the destination group. An affinity link has attributes
104 // (policies) attached to it that represent how these flows must be
105 // handled. An affinity link also has directionality associated with
106 // it. A bidirectional affinity link is equivalent to two unidirectional
107 // affinity links, one in each direction.
108 //**************************************************
109 grouping affinity-link {
113 leaf from-affinity-group {
114 type affinity-group-ref;
116 leaf to-affinity-group {
117 type affinity-group-ref;
119 container attribute {
120 uses affinity-attribute;
124 typedef affinity-access-control-type {
131 //**************************************************
132 // Affinity attribute. Each is expanded in their own grouping construct below.
133 //**************************************************
134 grouping affinity-attribute {
138 choice attribute-type {
139 description "affinity attribute";
140 // Apply access control to selected flows.
141 case affinity-access-control {
142 leaf affinity-access-control {
143 type affinity-access-control-type;
147 // Apply waypoint routing to the selected flows and send it through service chain.
148 case network-service-chain {
149 leaf network-service-chain {
150 type network-service-chain-ref;
156 //**************************************************
157 // Network service chain configuration.
158 //**************************************************
159 grouping network-service-chain {
165 uses network-service-function;
169 //**************************************************
170 // Network-service-function represented by one of the following
171 // types of addresses.
172 //**************************************************
173 grouping network-service-function {
177 // Address is either an IP address, MAC address, or switch/port.
179 description "Mac or Inet address";
181 type inv:node-connector-id;
182 type yang:mac-address;
183 type inet:ip-address;
188 // Main container that represents the complete set of affinity
189 // groups and links. Each set is represented as a YANG list with 'id'
190 // as the key. List contains affinity group and affinity link objects
192 container affinity-config {
193 list affinity-group {
195 ext:context-instance "affinity-group-context";
200 ext:context-instance "affinity-link-context";