bfbc959b9c43aa93cd78cdb778129ad7c1e2e177
[neutron.git] / model / src / main / yang / neutron-qos.yang
1 /*
2  * Copyright (c) 2016 Intel Corporation.  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 module neutron-qos {
9
10     yang-version 1;
11
12     namespace "urn:opendaylight:neutron-qos";
13
14     prefix neutron-qos;
15
16     import ietf-yang-types { prefix "yang"; revision-date "2013-07-15"; }
17     import neutron-attrs { prefix "attrs"; }
18     import neutron-constants { prefix "constants"; }
19
20     organization "OpenDaylight Neutron Group";
21
22     contact "Pramod Raghavendra Jayathirth <pramod.rj07@gmail.com>";
23
24     description "This YANG module defines qos attributes that are used
25         by OpenDaylight Neutron YANG module.";
26
27     revision "2016-06-13" {
28         description
29                 "OpenDaylight Boron release";
30     }
31
32     grouping qos-policy-attributes {
33         leaf shared {
34             type boolean;
35             description "Whether the policy is shared or not";
36         }
37     }
38
39     grouping qos-rule-type {
40         leaf rule-type {
41             type string;
42             description "The type of the qos rule";
43         }
44     }
45
46     grouping bandwidthlimit-rule-attributes {
47         leaf max-kbps {
48             type uint64;
49             description "The maximum KBPS value";
50         }
51         leaf max-burst-kbps {
52             type uint64;
53             description "The burst over the maximum KBPS value";
54         }
55     }
56
57     grouping dscpmarking-rule-attributes {
58         leaf dscp-mark {
59             type uint8 {
60                 range "0 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 | 34 | 36
61                 | 38 | 40 | 46 | 48 | 56";
62             }
63             description "the value of dscp mark";
64         }
65     }
66
67     grouping minimumbandwidth-rule-attributes {
68         leaf min-kbps {
69             type uint64;
70             description "The minimum KBPS value";
71         }
72         leaf direction {
73             type identityref {
74                 base "constants:direction-minimum-bandwidth-rule";
75             }
76             description "The traffic direction";
77         }
78     }
79
80     grouping qos-attributes {
81         container qos-policies {
82             list qos-policy {
83                 key "uuid";
84                 uses attrs:base-attributes;
85                 uses qos-policy-attributes;
86                 list bandwidth-limit-rules {
87                     key "uuid";
88                     uses attrs:id-attributes;
89                     uses bandwidthlimit-rule-attributes;
90                 }
91                 list dscpmarking-rules {
92                     key "uuid";
93                     uses attrs:id-attributes;
94                     uses dscpmarking-rule-attributes;
95                 }
96                 list minimumbandwidth-rules {
97                     key "uuid";
98                     uses attrs:id-attributes;
99                     uses minimumbandwidth-rule-attributes;
100                 }
101             }
102         }
103         container qos-rule-types {
104             config false;
105             list rule-types {
106                 key "rule-type";
107                 uses qos-rule-type;
108             }
109         }
110     }
111 }