Neutron shared routines and utilities.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

58 lines
1.9 KiB

  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. RULE_TYPE_BANDWIDTH_LIMIT = 'bandwidth_limit'
  16. RULE_TYPE_DSCP_MARKING = 'dscp_marking'
  17. RULE_TYPE_MINIMUM_BANDWIDTH = 'minimum_bandwidth'
  18. VALID_RULE_TYPES = [RULE_TYPE_BANDWIDTH_LIMIT,
  19. RULE_TYPE_DSCP_MARKING,
  20. RULE_TYPE_MINIMUM_BANDWIDTH,
  21. ]
  22. # Names of rules' attributes
  23. MAX_KBPS = "max_kbps"
  24. MAX_BURST = "max_burst_kbps"
  25. MIN_KBPS = "min_kbps"
  26. DIRECTION = "direction"
  27. DSCP_MARK = "dscp_mark"
  28. QOS_POLICY_ID = 'qos_policy_id'
  29. QOS_NETWORK_POLICY_ID = 'qos_network_policy_id'
  30. QOS_PLUGIN = 'qos_plugin'
  31. # NOTE(slaweq): Value used to calculate burst value for egress bandwidth limit
  32. # if burst is not given by user. In such case burst value will be calculated
  33. # as 80% of bw_limit to ensure that at least limits for TCP traffic will work
  34. # fine.
  35. DEFAULT_BURST_RATE = 0.8
  36. # Method names for QoSDriver
  37. PRECOMMIT_POSTFIX = '_precommit'
  38. CREATE_POLICY = 'create_policy'
  39. CREATE_POLICY_PRECOMMIT = CREATE_POLICY + PRECOMMIT_POSTFIX
  40. UPDATE_POLICY = 'update_policy'
  41. UPDATE_POLICY_PRECOMMIT = UPDATE_POLICY + PRECOMMIT_POSTFIX
  42. DELETE_POLICY = 'delete_policy'
  43. DELETE_POLICY_PRECOMMIT = DELETE_POLICY + PRECOMMIT_POSTFIX
  44. QOS_CALL_METHODS = (
  45. CREATE_POLICY,
  46. CREATE_POLICY_PRECOMMIT,
  47. UPDATE_POLICY,
  48. UPDATE_POLICY_PRECOMMIT,
  49. DELETE_POLICY,
  50. DELETE_POLICY_PRECOMMIT, )