Merge "Add CURD actions for packet rate limit rule"
This commit is contained in:
@@ -619,6 +619,10 @@ class Client(ClientBase):
|
|||||||
qos_policy_path = "/qos/policies/%s"
|
qos_policy_path = "/qos/policies/%s"
|
||||||
qos_bandwidth_limit_rules_path = "/qos/policies/%s/bandwidth_limit_rules"
|
qos_bandwidth_limit_rules_path = "/qos/policies/%s/bandwidth_limit_rules"
|
||||||
qos_bandwidth_limit_rule_path = "/qos/policies/%s/bandwidth_limit_rules/%s"
|
qos_bandwidth_limit_rule_path = "/qos/policies/%s/bandwidth_limit_rules/%s"
|
||||||
|
qos_packet_rate_limit_rules_path = \
|
||||||
|
"/qos/policies/%s/packet_rate_limit_rules"
|
||||||
|
qos_packet_rate_limit_rule_path = \
|
||||||
|
"/qos/policies/%s/packet_rate_limit_rules/%s"
|
||||||
qos_dscp_marking_rules_path = "/qos/policies/%s/dscp_marking_rules"
|
qos_dscp_marking_rules_path = "/qos/policies/%s/dscp_marking_rules"
|
||||||
qos_dscp_marking_rule_path = "/qos/policies/%s/dscp_marking_rules/%s"
|
qos_dscp_marking_rule_path = "/qos/policies/%s/dscp_marking_rules/%s"
|
||||||
qos_minimum_bandwidth_rules_path = \
|
qos_minimum_bandwidth_rules_path = \
|
||||||
@@ -712,6 +716,7 @@ class Client(ClientBase):
|
|||||||
'qos_policies': 'qos_policy',
|
'qos_policies': 'qos_policy',
|
||||||
'policies': 'policy',
|
'policies': 'policy',
|
||||||
'bandwidth_limit_rules': 'bandwidth_limit_rule',
|
'bandwidth_limit_rules': 'bandwidth_limit_rule',
|
||||||
|
'packet_rate_limit_rules': 'packet_rate_limit_rule',
|
||||||
'minimum_bandwidth_rules': 'minimum_bandwidth_rule',
|
'minimum_bandwidth_rules': 'minimum_bandwidth_rule',
|
||||||
'minimum_packet_rate_rules': 'minimum_packet_rate_rule',
|
'minimum_packet_rate_rules': 'minimum_packet_rate_rule',
|
||||||
'rules': 'rule',
|
'rules': 'rule',
|
||||||
@@ -1977,6 +1982,35 @@ class Client(ClientBase):
|
|||||||
return self.post(self.qos_minimum_bandwidth_rules_path % policy,
|
return self.post(self.qos_minimum_bandwidth_rules_path % policy,
|
||||||
body=body)
|
body=body)
|
||||||
|
|
||||||
|
def list_packet_rate_limit_rules(self, policy_id, retrieve_all=True,
|
||||||
|
**_params):
|
||||||
|
"""Fetches a list of all packet rate limit rules for the given policy
|
||||||
|
|
||||||
|
"""
|
||||||
|
return self.list('packet_rate_limit_rules',
|
||||||
|
self.qos_packet_rate_limit_rules_path %
|
||||||
|
policy_id, retrieve_all, **_params)
|
||||||
|
|
||||||
|
def show_packet_rate_limit_rule(self, rule, policy, body=None):
|
||||||
|
"""Fetches information of a certain packet rate limit rule."""
|
||||||
|
return self.get(self.qos_packet_rate_limit_rule_path %
|
||||||
|
(policy, rule), body=body)
|
||||||
|
|
||||||
|
def create_packet_rate_limit_rule(self, policy, body=None):
|
||||||
|
"""Creates a new packet rate limit rule."""
|
||||||
|
return self.post(self.qos_packet_rate_limit_rules_path % policy,
|
||||||
|
body=body)
|
||||||
|
|
||||||
|
def update_packet_rate_limit_rule(self, rule, policy, body=None):
|
||||||
|
"""Updates a packet rate limit rule."""
|
||||||
|
return self.put(self.qos_packet_rate_limit_rule_path %
|
||||||
|
(policy, rule), body=body)
|
||||||
|
|
||||||
|
def delete_packet_rate_limit_rule(self, rule, policy):
|
||||||
|
"""Deletes a packet rate limit rule."""
|
||||||
|
return self.delete(self.qos_packet_rate_limit_rule_path %
|
||||||
|
(policy, rule))
|
||||||
|
|
||||||
def update_minimum_bandwidth_rule(self, rule, policy, body=None):
|
def update_minimum_bandwidth_rule(self, rule, policy, body=None):
|
||||||
"""Updates a minimum bandwidth rule."""
|
"""Updates a minimum bandwidth rule."""
|
||||||
return self.put(self.qos_minimum_bandwidth_rule_path %
|
return self.put(self.qos_minimum_bandwidth_rule_path %
|
||||||
|
@@ -0,0 +1,7 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
Added new client methods for QoS packet rate limit rule:
|
||||||
|
``list_packet_rate_limit_rules``, ``show_packet_rate_limit_rule``,
|
||||||
|
``create_packet_rate_limit_rule``, ``update_packet_rate_limit_rule``,
|
||||||
|
``delete_packet_rate_limit_rule``.
|
Reference in New Issue
Block a user