diff options
author | dvora-h <67596500+dvora-h@users.noreply.github.com> | 2022-03-14 13:43:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-14 13:43:05 +0200 |
commit | 9376ed82cd8b8296f5585eb96d137e54b56d723d (patch) | |
tree | 8579dd80f033f2f7fb30fa2585cd191a7ec2888d /redis/commands/cluster.py | |
parent | 8d949a3f39bc6fe17ee90009e78f17b32f69899a (diff) | |
download | redis-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.py | 16 |
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 |