diff options
author | Binbin <binloveplay1314@qq.com> | 2022-03-31 14:36:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 09:36:43 +0300 |
commit | 0a5e4861a05c34d927e5cf1831b8515cb2094e1e (patch) | |
tree | 1d9d3cb6eff1cf952784f8a89ff3e363d0475d1f /redis/commands/cluster.py | |
parent | 9cfcaa4f42ac324aa85fa9135961834ff2b9395f (diff) | |
download | redis-py-0a5e4861a05c34d927e5cf1831b8515cb2094e1e.tar.gz |
Add support for CLUSTER MYID (#2063)
Co-authored-by: enjoy-binbin <binbin.zhu@tenclass.com>
Diffstat (limited to 'redis/commands/cluster.py')
-rw-r--r-- | redis/commands/cluster.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/redis/commands/cluster.py b/redis/commands/cluster.py index bcbfbd5..c3d7bd6 100644 --- a/redis/commands/cluster.py +++ b/redis/commands/cluster.py @@ -275,6 +275,17 @@ class RedisClusterCommands( r.cluster_info(target_nodes=RedisCluster.ALL_NODES) """ + def cluster_myid(self, target_node): + """ + Returns the node’s id. + + :target_node: 'ClusterNode' + The node to execute the command on + + For more information check https://redis.io/commands/cluster-myid/ + """ + return self.execute_command("CLUSTER MYID", target_nodes=target_node) + def cluster_addslots(self, target_node, *slots): """ Assign new hash slots to receiving node. Sends to specified node. |