From 9376ed82cd8b8296f5585eb96d137e54b56d723d Mon Sep 17 00:00:00 2001 From: dvora-h <67596500+dvora-h@users.noreply.github.com> Date: Mon, 14 Mar 2022 13:43:05 +0200 Subject: Add support for CLUSTER ADDSLOTSRANGE (#2017) * add cluster addslotsrange * Add support for CLUSTER ADDSLOTSRANGE * docstring * fix test * skip test * linters --- redis/commands/cluster.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'redis/commands/cluster.py') 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 -- cgit v1.2.1