QoS: Add support for direction
[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         leaf direction {
56             type identityref {
57                 base "constants:direction-base";
58             }
59             description "The traffic direction";
60         }
61     }
62
63     grouping dscpmarking-rule-attributes {
64         leaf dscp-mark {
65             type uint8 {
66                 range "0 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 | 34 | 36
67                 | 38 | 40 | 46 | 48 | 56";
68             }
69             description "the value of dscp mark";
70         }
71     }
72
73     grouping minimumbandwidth-rule-attributes {
74         leaf min-kbps {
75             type uint64;
76             description "The minimum KBPS value";
77         }
78         leaf direction {
79             type identityref {
80                 base "constants:direction-base";
81             }
82             description "The traffic direction";
83         }
84     }
85
86     grouping qos-attributes {
87         container qos-policies {
88             list qos-policy {
89                 key "uuid";
90                 uses attrs:base-attributes;
91                 uses qos-policy-attributes;
92                 list bandwidth-limit-rules {
93                     key "uuid";
94                     uses attrs:id-attributes;
95                     uses bandwidthlimit-rule-attributes;
96                 }
97                 list dscpmarking-rules {
98                     key "uuid";
99                     uses attrs:id-attributes;
100                     uses dscpmarking-rule-attributes;
101                 }
102                 list minimumbandwidth-rules {
103                     key "uuid";
104                     uses attrs:id-attributes;
105                     uses minimumbandwidth-rule-attributes;
106                 }
107             }
108         }
109         container qos-rule-types {
110             config false;
111             list rule-types {
112                 key "rule-type";
113                 uses qos-rule-type;
114             }
115         }
116     }
117 }