Chandan Kumar | 5e61987 | 2017-09-07 22:23:55 +0530 | [diff] [blame] | 1 | # 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 | |
| 16 | RULE_TYPE_BANDWIDTH_LIMIT = 'bandwidth_limit' |
| 17 | RULE_TYPE_DSCP_MARKING = 'dscp_marking' |
| 18 | RULE_TYPE_MINIMUM_BANDWIDTH = 'minimum_bandwidth' |
| 19 | VALID_RULE_TYPES = [RULE_TYPE_BANDWIDTH_LIMIT, |
| 20 | RULE_TYPE_DSCP_MARKING, |
| 21 | RULE_TYPE_MINIMUM_BANDWIDTH, |
| 22 | ] |
| 23 | |
| 24 | # Names of rules' attributes |
| 25 | MAX_KBPS = "max_kbps" |
| 26 | MAX_BURST = "max_burst_kbps" |
| 27 | MIN_KBPS = "min_kbps" |
| 28 | DIRECTION = "direction" |
| 29 | DSCP_MARK = "dscp_mark" |
| 30 | |
| 31 | QOS_POLICY_ID = 'qos_policy_id' |
| 32 | |
| 33 | QOS_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. |
| 39 | DEFAULT_BURST_RATE = 0.8 |
| 40 | |
| 41 | # Method names for QoSDriver |
| 42 | PRECOMMIT_POSTFIX = '_precommit' |
| 43 | CREATE_POLICY = 'create_policy' |
| 44 | CREATE_POLICY_PRECOMMIT = CREATE_POLICY + PRECOMMIT_POSTFIX |
| 45 | UPDATE_POLICY = 'update_policy' |
| 46 | UPDATE_POLICY_PRECOMMIT = UPDATE_POLICY + PRECOMMIT_POSTFIX |
| 47 | DELETE_POLICY = 'delete_policy' |
| 48 | DELETE_POLICY_PRECOMMIT = DELETE_POLICY + PRECOMMIT_POSTFIX |
| 49 | |
| 50 | QOS_CALL_METHODS = ( |
| 51 | CREATE_POLICY, |
| 52 | CREATE_POLICY_PRECOMMIT, |
| 53 | UPDATE_POLICY, |
| 54 | UPDATE_POLICY_PRECOMMIT, |
| 55 | DELETE_POLICY, |
| 56 | DELETE_POLICY_PRECOMMIT, ) |