Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/f5/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZy�dd
l
mZddlmZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
r�dd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZ defd��YZ!de!fd��YZ"de!fd ��YZ#d!e$fd"��YZ%d#e$fd$��YZ&d%e$fd&��YZ'd'�Z(e)d(kre(�nd)S(*i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigip_monitor_https
short_description: Manages F5 BIG-IP LTM https monitors
description: Manages F5 BIG-IP LTM https monitors.
version_added: 2.5
options:
  name:
    description:
      - Monitor name.
    type: str
    required: True
  description:
    description:
      - The description of the monitor.
    type: str
    version_added: 2.7
  parent:
    description:
      - The parent template of this monitor template. Once this value has
        been set, it cannot be changed. By default, this value is the C(https)
        parent on the C(Common) partition.
    type: str
    default: /Common/https
  send:
    description:
      - The send string for the monitor call. When creating a new monitor, if
        this value is not provided, the default C(GET /\\r\\n) will be used.
    type: str
  receive:
    description:
      - The receive string for the monitor call.
    type: str
  receive_disable:
    description:
      - This setting works like C(receive), except that the system marks the node
        or pool member disabled when its response matches the C(receive_disable)
        string but not C(receive). To use this setting, you must specify both
        C(receive_disable) and C(receive).
    type: str
  ip:
    description:
      - IP address part of the IP/port definition. If this parameter is not
        provided when creating a new monitor, then the default value will be
        '*'.
    type: str
  port:
    description:
      - Port address part of the IP/port definition. If this parameter is not
        provided when creating a new monitor, then the default value will be
        '*'. Note that if specifying an IP address, a value between 1 and 65535
        must be specified.
    type: str
  interval:
    description:
      - The interval specifying how frequently the monitor instance of this
        template will run. If this parameter is not provided when creating
        a new monitor, then the default value will be 5. This value B(must)
        be less than the C(timeout) value.
    type: int
  timeout:
    description:
      - The number of seconds in which the node or service must respond to
        the monitor request. If the target responds within the set time
        period, it is considered up. If the target does not respond within
        the set time period, it is considered down. You can change this
        number to any number you want, however, it should be 3 times the
        interval number of seconds plus 1 second. If this parameter is not
        provided when creating a new monitor, then the default value will be 16.
    type: int
  time_until_up:
    description:
      - Specifies the amount of time in seconds after the first successful
        response before a node will be marked up. A value of 0 will cause a
        node to be marked up immediately after a valid response is received
        from the node. If this parameter is not provided when creating
        a new monitor, then the default value will be 0.
    type: int
  target_username:
    description:
      - Specifies the user name, if the monitored target requires authentication.
    type: str
  target_password:
    description:
      - Specifies the password, if the monitored target requires authentication.
    type: str
  ssl_profile:
    description:
      - Specifies the SSL profile to use for the HTTPS monitor.
      - Defining SSL profiles enables refined customization of the SSL attributes
        for an HTTPS monitor.
      - This parameter is only supported on BIG-IP versions 13.x and later.
    type: str
    version_added: 2.8
  up_interval:
    description:
      - Specifies the interval for the system to use to perform the health check
        when a resource is up.
      - When C(0), specifies that the system uses the interval specified in
        C(interval) to check the health of the resource.
      - When any other number, enables specification of a different interval to
        use when checking the health of a resource that is up.
    type: int
    version_added: 2.8
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
  state:
    description:
      - When C(present), ensures that the monitor exists.
      - When C(absent), ensures the monitor is removed.
    type: str
    choices:
      - present
      - absent
    default: present
    version_added: 2.5
notes:
  - Requires BIG-IP software version >= 12
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s�
- name: Create HTTPS Monitor
  bigip_monitor_https:
    name: my_http_monitor
    state: present
    ip: 10.10.10.10
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Remove HTTPS Monitor
  bigip_monitor_https:
    name: my_http_monitor
    state: absent
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost
s�
parent:
  description: New parent template of the monitor.
  returned: changed
  type: str
  sample: https
ip:
  description: The new IP of IP/port definition.
  returned: changed
  type: str
  sample: 10.12.13.14
interval:
  description: The new interval in which to run the monitor check.
  returned: changed
  type: int
  sample: 2
description:
  description: The description of the monitor.
  returned: changed
  type: str
  sample: Important Monitor
timeout:
  description: The new timeout in which the remote system must respond to the monitor.
  returned: changed
  type: int
  sample: 10
time_until_up:
  description: The new time in which to mark a system as up after first successful response.
  returned: changed
  type: int
  sample: 2
up_interval:
  description: Interval for the system to use to perform the health check when a resource is up.
  returned: changed
  type: int
  sample: 0
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_name(tis_valid_ip(tcmp_str_with_nonet
Parametersc
B`saeZidd6dd6dd6dd6dd	6d
d6Zdddd
dddddddd	dg
Zddddddd
ddddd
gZddddd
ddddddd
gZed��Zed��Zed��Z	e	j
d��Z	ed��Zed��Zed��Z
ed��Zed��Zed ��Zed!��ZRS("t
time_until_upttimeUntilUptparenttdefaultsFromtreceivetrecvtreceive_disabletrecvDisabletssl_profilet
sslProfiletup_intervalt
upIntervaltintervalttimeouttsendtdestinationtusernametpasswordtdescriptiontiptportttarget_usernamettarget_passwordcC`s|jdS(NR((t_values(tself((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR#scC`s|jdS(NR)(R*(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR$ scC`s>|jdkr"|jdkr"dSdj|j|j�}|S(Ns{0}:{1}(R&tNoneR'tformat(R+R"((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR"$scC`s3|jd�\}}||jd<||jd<dS(Nt:R&R'(tsplitR*(R+tvalueR&R'((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR"+s
cC`s`|jddkrdSdt|jd�ko;dknrOtd��nt|jd�S(NRii�Qs*Interval value must be between 1 and 86400(R*R,tintR(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR1s)cC`s(|jddkrdSt|jd�S(NR (R*R,R1(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR >scC`s\|jddkrdS|jddkr.dSt|jd�rL|jdStd��dS(NR&t*s0.0.0.0s1The provided 'ip' parameter is not an IP address.(R2s0.0.0.0(R*R,RR(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR&DscC`s?|jddkrdS|jddkr.dSt|jd�S(NR'R2(R*R,R1(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR'Ps
cC`s(|jddkrdSt|jd�S(NR(R*R,R1(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRXscC`s4|jddkrdSt|j|jd�}|S(NR(R*R,R
t	partition(R+tresult((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR^scC`sdS(Nthttps((R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyttypees(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestpropertyR#R$R"tsetterRR R&R'RRR6(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR�sn
			
t
ApiParameterscB`seZed��ZRS(cC`s"|jddkrdS|jdS(NR%tnone(NR@(R*R,(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR%ks(R7R8R=R%(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR?jstModuleParameterscB`s&eZed��Zed��ZRS(cC`s9|jddkrdS|jddkr.dS|jdS(NR%R@t(snoneRB(R*R,(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR%ss
cC`sK|jddkrdS|jddkr.dSt|j|jd�}|S(NRRBR@(RBsnone(R*R,R
R3(R+R4((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR{s(R7R8R=R%R(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRArstChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R;tgetattrt_filter_paramst	Exception(R+R4t
returnable((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyt	to_return�s
(R7R8RH(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRC�st
UsableChangescB`seZRS((R7R8(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRI�stReportableChangescB`seZRS((R7R8(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRJ�st
DifferencecB`s�eZd
d�Zd�Zed��Zed��Zed��Zed��Z	d�Z
ed��Zed��Zed	��Z
RS(cC`s||_||_dS(N(twantthave(R+RLRM((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyt__init__�s	cC`s?yt||�}|SWn!tk
r:|j|�}|SXdS(N(RDtAttributeErrort_Difference__default(R+tparamR4((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pytcompare�s
cC`s+|jj|jjkr'td��ndS(Ns$The parent monitor cannot be changed(RLRRMR(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR�scC`s�|jjdkr(|jjdkr(dS|jjdkrZ|jji|jjd6�n|jjdkr�|jji|jjd6�n|jjdkr�|jjdkr�td��n|jj|jjkr�|jjSdS(NR'R&R2sASpecifying an IP address requires that a port number be specified(NR2(RLR&R,R'tupdateRMRR"(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR"�s$  $cC`s�|jjdk	rN|jjdk	rN|jj|jjkr�td��q�nx|jjdk	r�|jj|jjkr�td��q�n<|jjdk	r�|jj|jjkr�td��q�n|jj|jjkr�|jjSdS(Ns1Parameter 'interval' must be less than 'timeout'.(RLR R,RRRM(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR�s$cC`sd|jjdkrdS|jjdkr>|jjdkr>dS|jj|jjkr`|jjSdS(NRB(RLRR,RM(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR�s$cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RDRLRMRO(R+RQtattr1tattr2((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyt	__default�s
cC`st|jj|jj�S(N(RRLR%RM(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR%�scC`st|jj|jj�S(N(RRLRRM(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR�scC`st|jj|jj�S(N(RRLRRM(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR�sN(R7R8R,RNRRR=RR"RRRPR%RR(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRK�s				t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�ZRS(cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tgetR,RXR
RYtclientRARLR?RMRItchanges(R+targstkwargs((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRN�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRY(RR;RDRLR,RIR\(R+tchangedtkey((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyt_set_changed_options�scC`s�t|j|j�}tj}t�}xX|D]P}|j|�}|dkrUq.q.t|t�rt|j	|�q.|||<q.W|r�t
d|�|_tSt
S(NRY(RKRLRMRR<tdictRRR,t
isinstanceRSRIR\tTruetFalse(R+tdiffR<R_tktchange((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyt_update_changed_optionss		
cC`s|j�}|rtStS(N(RiRdRe(R+R4((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyt
should_updatescC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRYR_(ReRbRLtstateRkRlRJR\RHRSt_announce_deprecations(R+R_R4Rmt
reportableR\((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pytexec_modules	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopR[RXt	deprecate(R+R4twarningstwarning((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRn*s


cC`s$|j�r|j�S|j�SdS(N(texistsRStcreate(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRk2s
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns-https://{0}:{1}/mgmt/tm/ltm/monitor/https/{2}tservertserver_porti�tcode(R-R[tproviderRRLR3tnametapiRZtjsont
ValueErrorReRRd(R+turitresptresponse((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRx8s


+cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceRMRjReRXt
check_modeRdtupdate_on_device(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRSGs
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RXR�Rdtremove_from_deviceRxR(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pytremovePs
cC`s2|j�|j�|jjr$tS|j�tS(N(Rat_set_default_creation_valuesRXR�Rdtcreate_on_device(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRyXs


cC`s|jjdkr,|jjidd6�n|jjdkrX|jjidd6�n|jjdkr�|jjidd6�n|jjdkr�|jjidd6�n|jjdkr�|jjidd	6�n|jjdkr|jjid
d6�ndS(NiR iRiRR2R&R'sGET /
R!(	RLR R,RSRRR&R'R!(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR�`scC`s�|jj�}|jj|d<|jj|d<dj|jjd|jjd�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr�|ddkr�d
|kr�t|d
��q�t|j��ndS(NR~R3s*https://{0}:{1}/mgmt/tm/ltm/monitor/https/RzR{R�R|i�i�tmessage(i�i�(R\t
api_paramsRLR~R3R-R[R}RtpostR�R�Rtstrtcontent(R+RYR�R�R�tex((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR�ns
cC`s�|jj�}dj|jjd|jjdt|jj|jj��}|jj	j
|d|�}y|j�}Wn%tk
r�}t
t|���nXd|kr�|ddkr�d|kr�t
|d��q�t
|j��ndS(Ns-https://{0}:{1}/mgmt/tm/ltm/monitor/https/{2}RzR{R�R|i�R�(R\R�R-R[R}RRLR3R~RtpatchR�R�RR�R�(R+RYR�R�R�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR��s

cC`s|j�r|j�StS(N(RxR�Re(R+((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRl�s
cC`sjdj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
SdS(Ns-https://{0}:{1}/mgmt/tm/ltm/monitor/https/{2}RzR{i�(R-R[R}RRLR3R~RtdeleteRRd(R+R�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR��s

cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wn%t
k
r�}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j
��ntd|�S(Ns-https://{0}:{1}/mgmt/tm/ltm/monitor/https/{2}RzR{R|i�R�RY(R-R[R}RRLR3R~RRZR�R�RR�R�R?(R+R�R�R�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR��s

(R7R8RNRaRiRjRpRnRkRxRSR�RyR�R�R�RlR�R�(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRW�s"																	
tArgumentSpeccB`seZd�ZRS(c(C`s)t|_tdtdt�dtdd�dt�dt�dt�d	t�d
t�dtdd
�dt�dtdd
�dtdd
�dtdd
�dt�dtdt�dt�dtdddddg�dtdddtdgf��}i|_|jjt�|jj|�dS(NR~trequiredRtdefaults
/Common/httpsR%R!RRR&RR6R1R'RR RR(R)tno_logRRmRktchoicesRlR3tCommontfallbacktF5_PARTITION(Rdtsupports_check_modeRbR	t
argument_specRSR(R+R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyRN�s4										(R7R8RN(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyR��scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RXRr(
R�RR�R�RWRpt	exit_jsonRt	fail_jsonR�(tspecRXtmmtresultsR�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pytmain�s		t__main__N(*t
__future__RRRR6t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
RRt)library.module_utils.network.f5.ipaddressRt'library.module_utils.network.f5.compareRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont)ansible.module_utils.network.f5.ipaddresst'ansible.module_utils.network.f5.compareRR?RARCRIRJtobjectRKRWR�R�R7(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_https.pyt<module>sP


&
�X�!	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]