blob: e4a14cf1b1df0182167daed08086ed3910081c9b [file] [log] [blame]
Chandan Kumar5e619872017-09-07 22:23:55 +05301# Copyright (c) 2015 Red Hat Inc.
2# All rights reserved.
3#
4# Licensed under the Apache License, Version 2.0 (the "License"); you may
5# not use this file except in compliance with the License. You may obtain
6# a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13# License for the specific language governing permissions and limitations
14# under the License.
15
16RULE_TYPE_BANDWIDTH_LIMIT = 'bandwidth_limit'
17RULE_TYPE_DSCP_MARKING = 'dscp_marking'
18RULE_TYPE_MINIMUM_BANDWIDTH = 'minimum_bandwidth'
19VALID_RULE_TYPES = [RULE_TYPE_BANDWIDTH_LIMIT,
20 RULE_TYPE_DSCP_MARKING,
21 RULE_TYPE_MINIMUM_BANDWIDTH,
22 ]
23
24# Names of rules' attributes
25MAX_KBPS = "max_kbps"
26MAX_BURST = "max_burst_kbps"
27MIN_KBPS = "min_kbps"
28DIRECTION = "direction"
29DSCP_MARK = "dscp_mark"
30
31QOS_POLICY_ID = 'qos_policy_id'
32
33QOS_PLUGIN = 'qos_plugin'
34
35# NOTE(slaweq): Value used to calculate burst value for egress bandwidth limit
36# if burst is not given by user. In such case burst value will be calculated
37# as 80% of bw_limit to ensure that at least limits for TCP traffic will work
38# fine.
39DEFAULT_BURST_RATE = 0.8
40
41# Method names for QoSDriver
42PRECOMMIT_POSTFIX = '_precommit'
43CREATE_POLICY = 'create_policy'
44CREATE_POLICY_PRECOMMIT = CREATE_POLICY + PRECOMMIT_POSTFIX
45UPDATE_POLICY = 'update_policy'
46UPDATE_POLICY_PRECOMMIT = UPDATE_POLICY + PRECOMMIT_POSTFIX
47DELETE_POLICY = 'delete_policy'
48DELETE_POLICY_PRECOMMIT = DELETE_POLICY + PRECOMMIT_POSTFIX
49
50QOS_CALL_METHODS = (
51 CREATE_POLICY,
52 CREATE_POLICY_PRECOMMIT,
53 UPDATE_POLICY,
54 UPDATE_POLICY_PRECOMMIT,
55 DELETE_POLICY,
56 DELETE_POLICY_PRECOMMIT, )