Integrate the new yang model with Network Topology augmentation
[unimgr.git] / api / src / main / yang / cl-unimgr-mef.yang
1 /*\r
2  * Copyright (c) 2015 Cable Television Laboratories, Inc. All rights reserved.\r
3  *\r
4  * This program and the accompanying materials are made available under the\r
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
6  * and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL\r
7  */\r
8 \r
9 // Constructed based on Adolfo's UML UNI model\r
10 // UNI\r
11 // + uniIdentifier : string\r
12 // + physicalMedium : string = UNI Type 2 Physical Interface\r
13 // + speed : string = Set (10M, 100M, 10M/100M, 10M/100M/1000M, 1G, 10G>\r
14 // + mode : string = Full Duplex\r
15 // + macLayer : string = IEEE 802.3-2005\r
16 // + type : string\r
17 // + uniMtuSize : int = [uniMtuSize >= 1522]\r
18 \r
19 module cl-unimgr-mef {\r
20 \r
21     yang-version 1;\r
22     namespace "urn:opendaylight:params:xml:ns:yang:unimgr";\r
23     prefix "unimgr";\r
24 \r
25     import ietf-yang-types { prefix "yang"; revision-date 2013-07-15; }\r
26     import ietf-inet-types { prefix "inet"; revision-date 2010-09-24; }\r
27     import network-topology { prefix "topo"; revision-date 2013-10-21; }\r
28     import yang-ext { prefix "ext"; }\r
29     import ovsdb { prefix "ovsdb"; revision-date 2015-01-05;}\r
30 \r
31     revision "2015-10-12" {\r
32         description "Updated revision of the unimgr model.";\r
33     }\r
34 \r
35     typedef ovsdb-node-ref {\r
36         description "A reference to an ovsdb node";\r
37         type ovsdb:ovsdb-node-ref;\r
38     }\r
39 \r
40     grouping service-speed {\r
41         choice speed {\r
42             case speed-10M {\r
43                 leaf speed-10M {\r
44                     type empty;\r
45                 }\r
46             }\r
47             case speed-100M {\r
48                 leaf speed-100M {\r
49                     type empty;\r
50                 }\r
51             }\r
52             case speed-1G {\r
53                 leaf speed-1G {\r
54                     type empty;\r
55                 }\r
56             }\r
57             case speed-10G {\r
58                 leaf speed-10G {\r
59                     type empty;\r
60                 }\r
61             }\r
62         }\r
63     }\r
64 \r
65     // represent simplification of MEF Per Uni Attributes\r
66     grouping uni {\r
67         leaf ovsdb-node-ref {\r
68             type ovsdb-node-ref;\r
69             description "A reference to the ovsdb node.";\r
70         }\r
71         leaf physical-medium {\r
72             type string;\r
73             default "UNI TypeFull Duplex 2 Physical Interface";\r
74         }\r
75         leaf ip-address {\r
76             type inet:ip-address;\r
77         }\r
78         leaf mac-address {\r
79            type yang:mac-address;\r
80         }\r
81         container speed {\r
82             uses service-speed;\r
83         }\r
84         leaf mode {\r
85             type string;\r
86             default "Full Duplex";\r
87         }\r
88         leaf mac-layer {\r
89             type string;\r
90             default "IEEE 802.3-2005";\r
91         }\r
92         leaf type {\r
93             type string;\r
94         }\r
95         leaf mtu-size {\r
96             type uint64;\r
97             units byte;\r
98         }\r
99     }\r
100 \r
101     // Represents simplification of MEF EVC Per Uni Atrributes\r
102     grouping evc {\r
103         list uni-source {\r
104             key "order";\r
105             leaf order {\r
106                 type uint8;\r
107             }\r
108             leaf uni {\r
109                 type instance-identifier;\r
110             }\r
111         }\r
112         list uni-dest {\r
113             key "order";\r
114             leaf order {\r
115                 type uint8;\r
116             }\r
117             leaf uni {\r
118                 type instance-identifier;\r
119             }\r
120         }\r
121         leaf cos-id {\r
122             type string;\r
123         }\r
124         container ingress-bw {\r
125             uses service-speed;\r
126         }\r
127         container egress-bw {\r
128             uses service-speed;\r
129         }\r
130     }\r
131 \r
132     augment "/topo:network-topology/topo:topology/topo:node" {\r
133         description "Augmentation for UNI nodes under topology";\r
134         ext:augment-identifier "uni-augmentation";\r
135         uses uni;\r
136     }\r
137 \r
138     augment "/topo:network-topology/topo:topology/topo:link" {\r
139         description "Augmentation for EVC Link under topology";\r
140         ext:augment-identifier "evc-augmentation";\r
141         uses evc;\r
142     }\r
143 \r
144 }\r