� J�g��D�ddlZGd�d��ZGd�de��ZdS)�Nc�`�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z d�Z d �Z d �Z d �Z d �Zd �Zd�ZdS)�SentinelCommandszn A class containing the commands specific to redis sentinel. This class is to be used as a mixin. c�H�tjtd����dS)�"Redis Sentinel's SENTINEL command.z%Use the individual sentinel_* methodsN)�warnings�warn�DeprecationWarning)�self�argss �g/home/asafur/pinokio/api/open-webui.git/app/env/lib/python3.11/site-packages/redis/commands/sentinel.py�sentinelzSentinelCommands.sentinel s"��� �(�)P�Q�Q�R�R�R�R�R�c�.�|�d|��S)z:Returns a (host, port) pair for the given ``service_name``z SENTINEL GET-MASTER-ADDR-BY-NAME��execute_command�r � service_names r � sentinel_get_master_addr_by_namez1SentinelCommands.sentinel_get_master_addr_by_names���#�#�$F� �U�U�Urc�.�|�d|��S)z<Returns a dictionary containing the specified masters state.zSENTINEL MASTERrrs r �sentinel_masterz SentinelCommands.sentinel_master����#�#�$5�|�D�D�Drc�,�|�d��S)z>Returns a list of dictionaries containing each master's state.zSENTINEL MASTERSr�r s r �sentinel_mastersz!SentinelCommands.sentinel_masterss���#�#�$6�7�7�7rc�4�|�d||||��S)z,Add a new master to Sentinel to be monitoredzSENTINEL MONITORr)r �name�ip�port�quorums r �sentinel_monitorz!SentinelCommands.sentinel_monitors���#�#�$6��b�$��O�O�Orc�.�|�d|��S)z*Remove a master from Sentinel's monitoringzSENTINEL REMOVEr)r rs r �sentinel_removez SentinelCommands.sentinel_removes���#�#�$5�t�<�<�<rc�.�|�d|��S)z0Returns a list of sentinels for ``service_name``zSENTINEL SENTINELSrrs r �sentinel_sentinelsz#SentinelCommands.sentinel_sentinels"s���#�#�$8�,�G�G�Grc�2�|�d|||��S)z5Set Sentinel monitoring parameters for a given masterz SENTINEL SETr)r r�option�values r � sentinel_setzSentinelCommands.sentinel_set&s���#�#�N�D�&�%�H�H�Hrc�.�|�d|��S)z-Returns a list of slaves for ``service_name``zSENTINEL SLAVESrrs r �sentinel_slavesz SentinelCommands.sentinel_slaves*rrc�2�|�d|d���S)aP This command will reset all the masters with matching name. The pattern argument is a glob-style pattern. The reset process clears any previous state in a master (including a failover in progress), and removes every slave and sentinel already discovered and associated with the master. zSENTINEL RESETT��oncer)r �patterns r �sentinel_resetzSentinelCommands.sentinel_reset.s ���#�#�$4�g�D�#�I�I�Irc�.�|�d|��S)a Force a failover as if the master was not reachable, and without asking for agreement to other Sentinels (however a new version of the configuration will be published so that the other Sentinels will update their configurations). zSENTINEL FAILOVERr�r �new_master_names r �sentinel_failoverz"SentinelCommands.sentinel_failover9s���#�#�$7��I�I�Irc�2�|�d|d���S)a% Check if the current Sentinel configuration is able to reach the quorum needed to failover a master, and the majority needed to authorize the failover. This command should be used in monitoring systems to check if a Sentinel deployment is ok. zSENTINEL CKQUORUMTr,rr1s r �sentinel_ckquorumz"SentinelCommands.sentinel_ckquorumBs ���#�#�$7��t�#�T�T�Trc�,�|�d��S)a� Force Sentinel to rewrite its configuration on disk, including the current Sentinel state. Normally Sentinel rewrites the configuration every time something changes in its state (in the context of the subset of the state which is persisted on disk across restart). However sometimes it is possible that the configuration file is lost because of operation errors, disk failures, package upgrade scripts or configuration managers. In those cases a way to to force Sentinel to rewrite the configuration file is handy. This command works even if the previous configuration file is completely missing. zSENTINEL FLUSHCONFIGrrs r �sentinel_flushconfigz%SentinelCommands.sentinel_flushconfigMs�� �#�#�$:�;�;�;rN)�__name__� __module__� __qualname__�__doc__r rrrr r"r$r(r*r/r3r5r7�rr rrs��������� S�S�S�V�V�V�E�E�E�8�8�8�P�P�P�=�=�=�H�H�H�I�I�I�E�E�E� J� J� J�J�J�J� U� U� U�<�<�<�<�<rrc� ��eZdZd�fd� Z�xZS)�AsyncSentinelCommands�returnNc��8�K�t��j|�dS)rN)�superr )r r � __class__s �r r zAsyncSentinelCommands.sentinelas!����������$����r)r?N)r8r9r:r � __classcell__)rBs@r r>r>`s=������� � � � � � � � � � rr>)rrr>r<rr �<module>rDst������Y<�Y<�Y<�Y<�Y<�Y<�Y<�Y<�x � � � � �,� � � � � r
Memory