
    9Yf                     J    d dl Z d dlmZ d dlmZ d dlmZmZ  G d de      Z	y)    N)pretty_json)api)report_errorsreport_warningsc                   <    e Zd Zed        Zed        Zed        Zy)
HostClientc                    |j                  dd      }|j                  dd      }d|_        |j                  dd	      }|j                  d
d       |j                  ddd        |j                  ddd        |j                  ddd       |j	                  | j
                         |j                  dd      }|j                  d
d       |j	                  | j                         y )NhostzMute, unmute hosts)helpVerbsverb)titledestTmutezMute a host	host_namezhost to mutez--endzHPOSIX timestamp, if omitted, host will be muted until explicitly unmuted)r   defaultz	--messagez0string to associate with the muting of this hostz
--overridezZtrue/false, if true and the host is already muted, will overwrite existing end on the host
store_true)r   action)funcunmutezUnmute a host)
add_parseradd_subparsersrequiredadd_argumentset_defaults_mute_unmute)cls
subparsersparserverb_parsersmute_parserunmute_parsers         U/var/www/highfloat_scraper/venv/lib/python3.12/site-packages/datadog/dogshell/host.pysetup_parserzHostClient.setup_parser   s   &&v4H&I,,7,H $"--f=-I  > B  gqu 	! 	
 	  3hrv w  p 	! 	

 	  cii 0$///O"";^"D"""4    c                 x   |j                   t        _        |j                  }t        j                  j                  |j                  |j                  |j                  |j                        }t        |       t        |       |dk(  rt        t        |             y t        t        j                  |             y )N)endmessageoverridepretty)timeoutr   _timeoutformatHostr   r   r(   r)   r*   r   r   printr   jsondumpsr   argsr.   ress       r$   r   zHostClient._mute'   sx    ||hhmmDNN$,,Y]YfYfmgcX+c"#$**S/"r&   c                 4   |j                   t        _        |j                  }t        j                  j                  |j                        }t        |       t        |       |dk(  rt        t        |             y t        t        j                  |             y )Nr+   )r,   r   r-   r.   r/   r   r   r   r   r0   r   r1   r2   r3   s       r$   r   zHostClient._unmute3   sa    ||hhoodnn-cX+c"#$**S/"r&   N)__name__
__module____qualname__classmethodr%   r   r    r&   r$   r   r      s<    5 5, 	# 	# 	# 	#r&   r   )
r1   datadog.util.formatr   datadogr   datadog.dogshell.commonr   r   objectr   r;   r&   r$   <module>r@      s#   
  ,  B.# .#r&   