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_udp.pyo

�
�Udac@`ssddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZy�dd
l
mZddlmZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
r�dd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��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(kroe(�nd)S(*i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�

---
module: bigip_monitor_udp
short_description: Manages F5 BIG-IP LTM udp monitors
description: Manages F5 BIG-IP LTM udp monitors.
version_added: 2.5
options:
  name:
    description:
      - Monitor name.
    type: str
    required: True
  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(udp)
        parent on the C(Common) partition.
    type: str
    default: /Common/udp
  description:
    description:
      - The description of the monitor.
    type: str
    version_added: 2.7
  send:
    description:
      - The send string for the monitor call. When creating a new monitor, if
        this value is not provided, the default C(default send string) 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
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
    version_added: 2.5
  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 UDP Monitor
  bigip_monitor_udp:
    state: present
    ip: 10.10.10.10
    name: my_udp_monitor
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Remove UDP Monitor
  bigip_monitor_udp:
    state: absent
    name: my_udp_monitor
    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: http
description:
  description: The description of the monitor.
  returned: changed
  type: str
  sample: Important Monitor
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
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
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_name(tcmp_str_with_none(tis_valid_ipt
Parametersc	B`seZidd6dd6dd6Zddddddd	d
gZddddddddd
g	Zd	dddddd
gZed
��Zejd��Zed��Z	ed��Z
ed��Zed��Zed��Z
ed��Zed��ZRS(t
time_until_upttimeUntilUptparenttdefaultsFromtreceivetrecvtintervalttimeouttsendtdestinationtdescriptiontiptportcC`s>|jdkr"|jdkr"dSdj|j|j�}|S(Ns{0}:{1}(RtNoneRtformat(tselfR((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR�scC`s3|jd�\}}||jd<||jd<dS(Nt:RR(tsplitt_values(R"tvalueRR((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.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"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR�s)cC`s(|jddkrdSt|jd�S(NR(R%R R'(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRscC`s\|jddkrdS|jddkr.dSt|jd�rL|jdStd��dS(NRt*s0.0.0.0s1The provided 'ip' parameter is not an IP address.(R(s0.0.0.0(R%R RR(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRscC`s?|jddkrdS|jddkr.dSt|jd�S(NRR((R%R R'(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRs
cC`s(|jddkrdSt|jd�S(NR(R%R R'(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR#scC`s4|jddkrdSt|j|jd�}|S(NR(R%R R
t	partition(R"tresult((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR)scC`sdS(Ntudp((R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyttype0s(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestpropertyRtsetterRRRRRRR,(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR�sJ
			

t
ApiParameterscB`seZed��ZRS(cC`s"|jddkrdS|jdS(NRtnone(NR6(R%R (R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR6s(R-R.R3R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR55stModuleParameterscB`seZed��ZRS(cC`s9|jddkrdS|jddkr.dS|jdS(NRR6t(snoneR8(R%R (R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR>s
(R-R.R3R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR7=stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R1tgetattrt_filter_paramst	Exception(R"R*t
returnable((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyt	to_returnHs
(R-R.R>(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR9Gst
UsableChangescB`seZRS((R-R.(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR?SstReportableChangescB`seZRS((R-R.(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR@Wst
DifferencecB`sbeZdd�Zd�Zed��Zed��Zed��Zd�Z	ed��Z
RS(cC`s||_||_dS(N(twantthave(R"RBRC((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyt__init__\s	cC`s?yt||�}|SWn!tk
r:|j|�}|SXdS(N(R:tAttributeErrort_Difference__default(R"tparamR*((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pytcompare`s
cC`s+|jj|jjkr'td��ndS(Ns$The parent monitor cannot be changed(RBRRCR(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRhscC`s�|jjdkr(|jjdkr(dS|jjdkrZ|jji|jjd6�n|jjdkr�|jji|jjd6�n|jjdkr�|jjdkr�td��n|jj|jjkr�|jjSdS(NRRR(sASpecifying an IP address requires that a port number be specified(NR((RBRR RtupdateRCRR(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRos$  $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'.(RBRR RRRC(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR�s$cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R:RBRCRE(R"RGtattr1tattr2((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyt	__default�s
cC`st|jj|jj�S(N(RRBRRC(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR�sN(R-R.R RDRHR3RRRRFR(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRA[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 RNR
ROtclientR7RBR5RCR?tchanges(R"targstkwargs((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRD�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRO(RR1R:RBR R?RR(R"tchangedtkey((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.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(NRO(RARBRCRR2tdictRHR t
isinstanceRIR?RRtTruetFalse(R"tdiffR2RUtktchange((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(R_RZR[(R"R*((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyt
should_update�scC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRORU(R[RXRBtstateRaRbR@RRR>RIt_announce_deprecations(R"RUR*Rct
reportableRR((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pytexec_module�s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRQRNt	deprecate(R"R*twarningstwarning((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRd�s


cC`s$|j�r|j�S|j�SdS(N(texistsRItcreate(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRa�s
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/udp/{2}tservertserver_porti�tcode(R!RQtproviderRRBR)tnametapiRPtjsont
ValueErrorR[RRZ(R"turitresptresponse((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRn�s


+cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceRCR`R[RNt
check_modeRZtupdate_on_device(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRI�s
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RNR|RZtremove_from_deviceRnR(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pytremoves
cC`s2|j�|j�|jjr$tS|j�tS(N(RWt_set_default_creation_valuesRNR|RZtcreate_on_device(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRo	s


cC`s|jjdkr,|jjidd6�n|jjdkrX|jjidd6�n|jjdkr�|jjidd6�n|jjdkr�|jjidd6�n|jjdkr�|jjidd	6�n|jjdkr|jjid
d6�ndS(NiRiRiRR(RRsdefault send stringR(	RBRR RIRRRRR(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.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(NRtR)s(https://{0}:{1}/mgmt/tm/ltm/monitor/udp/RpRqRvRri�i�tmessage(i�i�(RRt
api_paramsRBRtR)R!RQRsRutpostRvRwRtstrtcontent(R"RORxRyRztex((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR�s
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/udp/{2}RpRqRvRri�R�(RRR�R!RQRsRRBR)RtRutpatchRvRwRR�R�(R"RORxRyRzR�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR}3s

cC`s|j�r|j�StS(N(RnRR[(R"((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRbFs
cC`sjdj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
SdS(Ns+https://{0}:{1}/mgmt/tm/ltm/monitor/udp/{2}RpRqi�(R!RQRsRRBR)RtRutdeleteRRZ(R"RxRy((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR~Ks

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/udp/{2}RpRqRri�R�RO(R!RQRsRRBR)RtRuRPRvRwRR�R�R5(R"RxRyRzR�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR{Us

(R-R.RDRWR_R`RfRdRaRnRIRRoR�R�R}RbR~R{(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRM�s"																	
tArgumentSpeccB`seZd�ZRS(c C`s�t|_tdtdt�dtdd�dt�dt�dt�d	tdt�d
t�dt�dtd
d�dtd
d�dtd
d�dtdddddg�dtdddtdgf��
}i|_|jjt�|jj|�dS(NRttrequiredRtdefaults/Common/udpRRRtreceive_disableRRRR,R'RRRcRatchoicesRbR)tCommontfallbacktF5_PARTITION(RZtsupports_check_modeRXR[R	t
argument_specRIR(R"R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyRDjs,							(R-R.RD(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyR�iscC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RNRh(
R�RR�R�RMRft	exit_jsonRt	fail_jsonR�(tspecRNtmmtresultsR�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pytmain�s		t__main__N(*t
__future__RRRR,t
__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.compareRt)library.module_utils.network.f5.ipaddressRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont'ansible.module_utils.network.f5.comparet)ansible.module_utils.network.f5.ipaddressRR5R7R9R?R@tobjectRARMR�R�R-(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_monitor_udp.pyt<module>sN


f!
o
G�	

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