
    Vh                         d dl mZmZmZ eZdZdZd dlZdZ		 d dl
Z
dZd dlmZmZ d Zd	 Zd
 Zedk(  r e        yy# e$ r  ej                         Z	dZY 9w xY w)    )absolute_importdivisionprint_functiona  
module: pingdom
short_description: Pause/unpause Pingdom alerts
description:
  - This module will let you pause/unpause Pingdom alerts.
author:
  - "Dylan Silva (@thaumos)"
  - "Justin Johns (!UNKNOWN)"
requirements:
  - "This pingdom python library: U(https://github.com/mbabineau/pingdom-python)"
extends_documentation_fragment:
  - community.general.attributes
attributes:
  check_mode:
    support: none
  diff_mode:
    support: none
options:
  state:
    type: str
    description:
      - Define whether or not the check should be running or paused.
    required: true
    choices: ["running", "paused", "started", "stopped"]
  checkid:
    type: str
    description:
      - Pingdom ID of the check.
    required: true
  uid:
    type: str
    description:
      - Pingdom user ID.
    required: true
  passwd:
    type: str
    description:
      - Pingdom user password.
    required: true
  key:
    type: str
    description:
      - Pingdom API key.
    required: true
notes:
  - This module does not yet have support to add/remove checks.
a}  
- name: Pause the check with the ID of 12345
  community.general.pingdom:
    uid: example@example.com
    passwd: password123
    key: apipassword123
    checkid: 12345
    state: paused

- name: Unpause the check with the ID of 12345
  community.general.pingdom:
    uid: example@example.com
    passwd: password123
    key: apipassword123
    checkid: 12345
    state: running
NTF)AnsibleModulemissing_required_libc                     t        j                  |||      }|j                  | d       |j                  |       }|j                  }|j
                  }d||fS )NTpausedFpingdomPingdomConnectionmodify_check	get_checknamestatuscheckiduidpasswdkeyccheckr   results           m/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/community/general/plugins/modules/pingdom.pypauser   Z   sU    !!#vs3ANN74N(KK E::D\\F 4      c                     t        j                  |||      }|j                  | d       |j                  |       }|j                  }|j
                  }d||fS )NFr	   r   r   s           r   unpauser   f   sU    !!#vs3ANN75N)KK E::D\\F 4  r   c                  R   t        t        t        dg d      t        d      t        d      t        dd      t        dd                  } t        s | j                  t	        d      t
        	       | j                  d
   }| j                  d   }| j                  d   }| j                  d   }| j                  d   }|dk(  s|dk(  rt        ||||      \  }}}|dk(  s|dk(  rt        ||||      \  }}}dk7  r| j                  |       | j                  |       y )NT)runningr
   startedstopped)requiredchoices)r#   )r#   no_log)stater   r   r   r   )argument_specr   )msg	exceptionr   r&   r   r   r   r
   r"   r    r!   r   )r   r   r   )
r   dictHAS_PINGDOM	fail_jsonr   PINGDOM_IMP_ERRparamsr   r   	exit_json)	moduler   r&   r   r   r   rcr   r   s	            r   mainr2   r   s$   .YZ$'d#d3d40
F 1)<XmmI&GMM'"E
--
C]]8$F
--
CUi/"7C=T6ey0$Wc63?T6	QwtFC
W4?r   __main__)
__future__r   r   r   type__metaclass__DOCUMENTATIONEXAMPLES	tracebackr-   r   r+   	Exception
format_excansible.module_utils.basicr   r   r   r   r2   __name__ r   r   <module>r?      s    A @.`$ K
 K	!	!@B zF A  *i**,OKs   = AA