| 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 |
RULE_TYPE_MINIMUM_PACKET_RATE = 'minimum_packet_rate' |
| 20 |
RULE_TYPE_PACKET_RATE_LIMIT = 'packet_rate_limit' |
| 21 |
VALID_RULE_TYPES = [RULE_TYPE_BANDWIDTH_LIMIT, |
| 22 |
RULE_TYPE_DSCP_MARKING, |
| 23 |
RULE_TYPE_MINIMUM_BANDWIDTH, |
| 24 |
RULE_TYPE_MINIMUM_PACKET_RATE, |
| 25 |
RULE_TYPE_PACKET_RATE_LIMIT, |
| 26 |
] |
| 27 |
|
| 28 |
# Names of rules' attributes |
| 29 |
MAX_KBPS = "max_kbps" |
| 30 |
MAX_BURST = "max_burst_kbps" |
| 31 |
MIN_KBPS = "min_kbps" |
| 32 |
DIRECTION = "direction" |
| 33 |
DSCP_MARK = "dscp_mark" |
| 34 |
|
| 35 |
# Names of pps rules' attributes |
| 36 |
MAX_KPPS = "max_kpps" |
| 37 |
MIN_KPPS = "min_kpps" |
| 38 |
MAX_BURST_KPPS = "max_burst_kpps" |
| 39 |
|
| 40 |
QOS_POLICY_ID = 'qos_policy_id' |
| 41 |
QOS_NETWORK_POLICY_ID = 'qos_network_policy_id' |
| 42 |
|
| 43 |
QOS_PLUGIN = 'qos_plugin' |
| 44 |
|
| 45 |
# NOTE(slaweq): Value used to calculate burst value for egress bandwidth limit |
| 46 |
# if burst is not given by user. In such case burst value will be calculated |
| 47 |
# as 80% of bw_limit to ensure that at least limits for TCP traffic will work |
| 48 |
# fine. |
| 49 |
DEFAULT_BURST_RATE = 0.8 |
| 50 |
|
| 51 |
# Method names for QoSDriver |
| 52 |
PRECOMMIT_POSTFIX = '_precommit' |
| 53 |
CREATE_POLICY = 'create_policy' |
| 54 |
CREATE_POLICY_PRECOMMIT = CREATE_POLICY + PRECOMMIT_POSTFIX |
| 55 |
UPDATE_POLICY = 'update_policy' |
| 56 |
UPDATE_POLICY_PRECOMMIT = UPDATE_POLICY + PRECOMMIT_POSTFIX |
| 57 |
DELETE_POLICY = 'delete_policy' |
| 58 |
DELETE_POLICY_PRECOMMIT = DELETE_POLICY + PRECOMMIT_POSTFIX |
| 59 |
|
| 60 |
QOS_CALL_METHODS = ( |
| 61 |
CREATE_POLICY, |
| 62 |
CREATE_POLICY_PRECOMMIT, |
| 63 |
UPDATE_POLICY, |
| 64 |
UPDATE_POLICY_PRECOMMIT, |
| 65 |
DELETE_POLICY, |
| 66 |
DELETE_POLICY_PRECOMMIT, ) |