
    ph                     6    S SK r  " S S5      r " S S\5      rg)    Nc                   r    \ rS rSrSrS rSS jrSS jrS rS r	S r
SS	 jrS
 rS rS rS rS rS rSrg)SentinelCommands   zb
A class containing the commands specific to redis sentinel. This class is
to be used as a mixin.
c                 B    [         R                  " [        S5      5        g)"Redis Sentinel's SENTINEL command.z%Use the individual sentinel_* methodsN)warningswarnDeprecationWarning)selfargss     Q/home/james-whalen/.local/lib/python3.13/site-packages/redis/commands/sentinel.pysentinelSentinelCommands.sentinel
   s    ()PQR    c                 &    U R                  SUSUS9$ )z
Returns a (host, port) pair for the given ``service_name`` when return_responses is True,
otherwise returns a boolean value that indicates if the command was successful.
z SENTINEL GET-MASTER-ADDR-BY-NAMET)oncereturn_responsesexecute_commandr   service_namer   s      r    sentinel_get_master_addr_by_name1SentinelCommands.sentinel_get_master_addr_by_name   s(    
 ##.-	 $ 
 	
r   c                 "    U R                  SXS9$ )z
Returns a dictionary containing the specified masters state, when return_responses is True,
otherwise returns a boolean value that indicates if the command was successful.
zSENTINEL MASTERr   r   r   s      r   sentinel_master SentinelCommands.sentinel_master   s!    
 ##| $ 
 	
r   c                 $    U R                  S5      $ )a	  
Returns a list of dictionaries containing each master's state.

Important: This function is called by the Sentinel implementation and is
called directly on the Redis standalone client for sentinels,
so it doesn't support the "once" and "return_responses" options.
zSENTINEL MASTERSr   r   s    r   sentinel_masters!SentinelCommands.sentinel_masters#   s     ##$677r   c                 (    U R                  SXX45      $ )z,Add a new master to Sentinel to be monitoredzSENTINEL MONITORr   )r   nameipportquorums        r   sentinel_monitor!SentinelCommands.sentinel_monitor-   s    ##$6$OOr   c                 &    U R                  SU5      $ )z*Remove a master from Sentinel's monitoringzSENTINEL REMOVEr   )r   r#   s     r   sentinel_remove SentinelCommands.sentinel_remove1   s    ##$5t<<r   c                 "    U R                  SXS9$ )z
Returns a list of sentinels for ``service_name``, when return_responses is True,
otherwise returns a boolean value that indicates if the command was successful.
zSENTINEL SENTINELSr   r   r   s      r   sentinel_sentinels#SentinelCommands.sentinel_sentinels5   s!    
 ## , $ 
 	
r   c                 (    U R                  SXU5      $ )z5Set Sentinel monitoring parameters for a given masterzSENTINEL SETr   )r   r#   optionvalues       r   sentinel_setSentinelCommands.sentinel_set>   s    ##ND%HHr   c                 &    U R                  SU5      $ )z
Returns a list of slaves for ``service_name``

Important: This function is called by the Sentinel implementation and is
called directly on the Redis standalone client for sentinels,
so it doesn't support the "once" and "return_responses" options.
zSENTINEL SLAVESr   )r   r   s     r   sentinel_slaves SentinelCommands.sentinel_slavesB   s     ##$5|DDr   c                 $    U R                  SUSS9$ )a   
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.
zSENTINEL RESETTr   r   )r   patterns     r   sentinel_resetSentinelCommands.sentinel_resetL   s     ##$4gD#IIr   c                 &    U R                  SU5      $ )z
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).
zSENTINEL FAILOVERr   r   new_master_names     r   sentinel_failover"SentinelCommands.sentinel_failoverW   s     ##$7IIr   c                 $    U R                  SUSS9$ )z
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.
zSENTINEL CKQUORUMTr8   r   r=   s     r   sentinel_ckquorum"SentinelCommands.sentinel_ckquorum`   s     ##$7t#TTr   c                 $    U R                  S5      $ )aX  
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.
zSENTINEL FLUSHCONFIGr   r   s    r   sentinel_flushconfig%SentinelCommands.sentinel_flushconfigk   s      ##$:;;r    N)F)__name__
__module____qualname____firstlineno____doc__r   r   r   r    r'   r*   r-   r2   r5   r:   r?   rB   rE   __static_attributes__rG   r   r   r   r      sO    
S


8P=
IE	JJ	U<r   r   c                   ,   ^  \ rS rSrSU 4S jjrSrU =r$ )AsyncSentinelCommands~   c                 (   >#    [         TU ]  " U6   g7f)r   N)superr   )r   r   	__class__s     r   r   AsyncSentinelCommands.sentinel   s     $s   rG   )returnN)rH   rI   rJ   rK   r   rM   __classcell__)rS   s   @r   rO   rO   ~   s       r   rO   )r   r   rO   rG   r   r   <module>rW      s"    w< w<t ,  r   