Add support for minimum packet rate rule to the client
With the introduction of QoS minimum packet rate rule in Neutron, it's important to ensure that tools like Heat support it as well. Unfortunately, Heat still depends on python-neutronclient instead of python-openstackclient. So even though QoS minimum packet rate rule support have been proposed for python-openstackclient [1] and openstacksdk [2], it's still necessary to extend python-neutronclient code. Since Heat uses only the client part, can skip CLI support. [1] https://review.opendev.org/c/openstack/python-openstackclient/+/810559 [2] https://review.opendev.org/c/openstack/openstacksdk/+/810364 Partial-Bug: #1922237 See-Also: https://review.opendev.org/785236 Change-Id: I4f16b963a202a476cd3cd2b69c1dd4e4ee6f0fc7
This commit is contained in:
parent
3a65712b45
commit
3b80135a3d
|
@ -625,6 +625,10 @@ class Client(ClientBase):
|
|||
"/qos/policies/%s/minimum_bandwidth_rules"
|
||||
qos_minimum_bandwidth_rule_path = \
|
||||
"/qos/policies/%s/minimum_bandwidth_rules/%s"
|
||||
qos_minimum_packet_rate_rules_path = \
|
||||
"/qos/policies/%s/minimum_packet_rate_rules"
|
||||
qos_minimum_packet_rate_rule_path = \
|
||||
"/qos/policies/%s/minimum_packet_rate_rules/%s"
|
||||
qos_rule_types_path = "/qos/rule-types"
|
||||
qos_rule_type_path = "/qos/rule-types/%s"
|
||||
flavors_path = "/flavors"
|
||||
|
@ -709,6 +713,7 @@ class Client(ClientBase):
|
|||
'policies': 'policy',
|
||||
'bandwidth_limit_rules': 'bandwidth_limit_rule',
|
||||
'minimum_bandwidth_rules': 'minimum_bandwidth_rule',
|
||||
'minimum_packet_rate_rules': 'minimum_packet_rate_rule',
|
||||
'rules': 'rule',
|
||||
'dscp_marking_rules': 'dscp_marking_rule',
|
||||
'rule_types': 'rule_type',
|
||||
|
@ -1982,6 +1987,35 @@ class Client(ClientBase):
|
|||
return self.delete(self.qos_minimum_bandwidth_rule_path %
|
||||
(policy, rule))
|
||||
|
||||
def list_minimum_packet_rate_rules(self, policy_id, retrieve_all=True,
|
||||
**_params):
|
||||
"""Fetches a list of all minimum packet rate rules for the given policy
|
||||
|
||||
"""
|
||||
return self.list('minimum_packet_rate_rules',
|
||||
self.qos_minimum_packet_rate_rules_path %
|
||||
policy_id, retrieve_all, **_params)
|
||||
|
||||
def show_minimum_packet_rate_rule(self, rule, policy, body=None):
|
||||
"""Fetches information of a certain minimum packet rate rule."""
|
||||
return self.get(self.qos_minimum_packet_rate_rule_path %
|
||||
(policy, rule), body=body)
|
||||
|
||||
def create_minimum_packet_rate_rule(self, policy, body=None):
|
||||
"""Creates a new minimum packet rate rule."""
|
||||
return self.post(self.qos_minimum_packet_rate_rules_path % policy,
|
||||
body=body)
|
||||
|
||||
def update_minimum_packet_rate_rule(self, rule, policy, body=None):
|
||||
"""Updates a minimum packet rate rule."""
|
||||
return self.put(self.qos_minimum_packet_rate_rule_path %
|
||||
(policy, rule), body=body)
|
||||
|
||||
def delete_minimum_packet_rate_rule(self, rule, policy):
|
||||
"""Deletes a minimum packet rate rule."""
|
||||
return self.delete(self.qos_minimum_packet_rate_rule_path %
|
||||
(policy, rule))
|
||||
|
||||
def create_flavor(self, body=None):
|
||||
"""Creates a new Neutron service flavor."""
|
||||
return self.post(self.flavors_path, body=body)
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Added new client methods for QoS minimum packet rate rule:
|
||||
``list_minimum_packet_rate_rules``, ``show_minimum_packet_rate_rule``,
|
||||
``create_minimum_packet_rate_rule``, ``update_minimum_packet_rate_rule``,
|
||||
``delete_minimum_packet_rate_rule``.
|
Loading…
Reference in New Issue