summaryrefslogtreecommitdiff
path: root/redis/commands/cluster.py
diff options
context:
space:
mode:
authordvora-h <67596500+dvora-h@users.noreply.github.com>2022-03-14 13:43:05 +0200
committerGitHub <noreply@github.com>2022-03-14 13:43:05 +0200
commit9376ed82cd8b8296f5585eb96d137e54b56d723d (patch)
tree8579dd80f033f2f7fb30fa2585cd191a7ec2888d /redis/commands/cluster.py
parent8d949a3f39bc6fe17ee90009e78f17b32f69899a (diff)
downloadredis-py-9376ed82cd8b8296f5585eb96d137e54b56d723d.tar.gz
Add support for CLUSTER ADDSLOTSRANGE (#2017)
* add cluster addslotsrange * Add support for CLUSTER ADDSLOTSRANGE * docstring * fix test * skip test * linters
Diffstat (limited to 'redis/commands/cluster.py')
-rw-r--r--redis/commands/cluster.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/redis/commands/cluster.py b/redis/commands/cluster.py
index e14b6e3..3d42317 100644
--- a/redis/commands/cluster.py
+++ b/redis/commands/cluster.py
@@ -248,6 +248,22 @@ class RedisClusterCommands(
"CLUSTER ADDSLOTS", *slots, target_nodes=target_node
)
+ def cluster_addslotsrange(self, target_node, *slots):
+ """
+ Similar to the CLUSTER ADDSLOTS command.
+ The difference between the two commands is that ADDSLOTS takes a list of slots
+ to assign to the node, while ADDSLOTSRANGE takes a list of slot ranges
+ (specified by start and end slots) to assign to the node.
+
+ :target_node: 'ClusterNode'
+ The node to execute the command on
+
+ For more information check https://redis.io/commands/cluster-addslotsrange
+ """
+ return self.execute_command(
+ "CLUSTER ADDSLOTSRANGE", *slots, target_nodes=target_node
+ )
+
def cluster_countkeysinslot(self, slot_id):
"""
Return the number of local keys in the specified hash slot