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_gtm_monitor_tcp_half_open.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_bysi
---
module: bigip_gtm_monitor_tcp_half_open
short_description: Manages F5 BIG-IP GTM tcp half-open monitors
description:
  - Manages F5 BIG-IP GTM tcp half-open monitors.
version_added: 2.6
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(tcp_half_open)
        parent on the C(Common) partition.
    type: str
    default: "/Common/tcp_half_open"
  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:
      - Specifies, in seconds, the frequency at which the system issues the monitor
        check when either the resource is down or the status of the resource is unknown.
      - When creating a new monitor, if this parameter is not provided, then the
        default value will be C(30). This value B(must) be less than the C(timeout) value.
    type: int
  timeout:
    description:
      - Specifies the number of seconds the target has in which to 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.
      - When this value is set to 0 (zero), the system uses the interval from the parent monitor.
      - When creating a new monitor, if this parameter is not provided, then
        the default value will be C(120).
    type: int
  probe_interval:
    description:
      - Specifies the number of seconds the big3d process waits before sending out a
        subsequent probe attempt when a probe fails and multiple probe attempts have
        been requested.
      - When creating a new monitor, if this parameter is not provided, then the default
        value will be C(1).
    type: int
  probe_timeout:
    description:
      - Specifies the number of seconds after which the system times out the probe request
        to the system.
      - When creating a new monitor, if this parameter is not provided, then the default
        value will be C(5).
    type: int
  probe_attempts:
    description:
      - Specifies the number of times the system attempts to probe the host server, after
        which the system considers the host server down or unavailable.
      - When creating a new monitor, if this parameter is not provided, then the default
        value will be C(3).
    type: int
  ignore_down_response:
    description:
      - Specifies that the monitor allows more than one probe attempt per interval.
      - When C(yes), specifies that the monitor ignores down responses for the duration of
        the monitor timeout. Once the monitor timeout is reached without the system receiving
        an up response, the system marks the object down.
      - When C(no), specifies that the monitor immediately marks an object down when it
        receives a down response.
      - When creating a new monitor, if this parameter is not provided, then the default
        value will be C(no).
    type: bool
  transparent:
    description:
      - Specifies whether the monitor operates in transparent mode.
      - A monitor in transparent mode directs traffic through the associated pool members
        or nodes (usually a router or firewall) to the aliased destination (that is, it
        probes the C(ip)-C(port) combination specified in the monitor).
      - If the monitor cannot successfully reach the aliased destination, the pool member
        or node through which the monitor traffic was sent is marked down.
      - When creating a new monitor, if this parameter is not provided, then the default
        value will be C(no).
    type: bool
  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
notes:
  - Requires BIG-IP software version >= 12
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s�
- name: Create TCP half-open Monitor
  bigip_gtm_monitor_tcp_half_open:
    state: present
    ip: 10.10.10.10
    name: my_monitor
    provider:
      user: admin
      password: secret
      server: lb.mydomain.com
  delegate_to: localhost

- name: Remove TCP half-open Monitor
  bigip_gtm_monitor_tcp_half_open:
    state: absent
    name: my_monitor
    provider:
      user: admin
      password: secret
      server: lb.mydomain.com
  delegate_to: localhost

- name: Add half-open monitor for all addresses, port 514
  bigip_gtm_monitor_tcp_half_open:
    port: 514
    name: my_monitor
    provider:
      user: admin
      password: secret
      server: lb.mydomain.com
  delegate_to: localhost
s�
parent:
  description: New parent template of the monitor.
  returned: changed
  type: str
  sample: tcp_half_open
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
probe_timeout:
  description: The new timeout in which the system will timeout the monitor probe.
  returned: changed
  type: int
  sample: 10
probe_interval:
  description: The new interval in which the system will check the monitor probe.
  returned: changed
  type: int
  sample: 10
probe_attempts:
  description: The new number of attempts the system will make in checking the monitor probe.
  returned: changed
  type: int
  sample: 10
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_name(tmodule_provisioned(tis_valid_ipt
Parametersc
B`s�eZidd6dd6dd6dd6dd	6Zdd
ddd
ddd	dg	Zdddd
dd
ddddg
Zdd
dd
ddddgZed��Zed��Zed��Z	ed��Z
ed��Zed��ZRS(tparenttdefaultsFromtignore_down_responsetignoreDownResponsetprobe_attemptst
probeAttemptstprobe_intervalt
probeIntervalt
probe_timeouttprobeTimeouttintervalttimeouttdestinationttransparenttiptportcC`s`|jddkrdSdt|jd�ko;dknrOtd��nt|jd�S(NRii�Qs*Interval value must be between 1 and 86400(t_valuestNonetintR(tself((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR�s)cC`s(|jddkrdSt|jd�S(NR(R#R$R%(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRscC`s(|jddkrdSt|jd�S(NR(R#R$R%(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR
scC`s(|jddkrdSt|jd�S(NR(R#R$R%(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRscC`s(|jddkrdSt|jd�S(NR(R#R$R%(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRscC`sdS(Nt
tcp_half_open((R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyttypes(
t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestpropertyRRRRRR((((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR�s$
t
ApiParameterscB`sDeZed��Zed��Zed��Zed��ZRS(cC`s |jdjd�\}}|S(NRt:(R#tsplit(R&R!R"((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR!"scC`s&|jdjd�\}}t|�S(NRR1(R#R2R%(R&R!R"((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR"'scC`s2|jddkrdS|jddkr.tStS(NRtdisabled(R#R$tFalsetTrue(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR,s
cC`s2|jddkrdS|jddkr.tStS(NR R3(R#R$R4R5(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR 4s
(R)R*R/R!R"RR (((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR0!stModuleParameterscB`sDeZed��Zed��Zed��Zed��ZRS(cC`s>|jdkr"|jdkr"dSdj|j|j�}|S(Ns{0}:{1}(R!R$R"tformat(R&R((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR>scC`s.|jddkrdSt|j|jd�S(NR(R#R$R
t	partition(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyREscC`s\|jddkrdS|jddkr.dSt|jd�rL|jdStd��dS(NR!t*s0.0.0.0s1The provided 'ip' parameter is not an IP address.(R9s0.0.0.0(R#R$RR(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR!KscC`s?|jddkrdS|jddkr.dSt|jd�S(NR"R9(R#R$R%(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR"Xs
(R)R*R/RRR!R"(((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR6=s
tChangescB`seZd�ZRS(cC`s]i}y>x$|jD]}t||�||<qW|j|�}|SWntk
rX|SXdS(N(R-tgetattrt_filter_paramst	Exception(R&tresultt
returnable((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyt	to_returnbs
(R)R*R@(((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR:ast
UsableChangescB`s&eZed��Zed��ZRS(cC`s|jdrdSdS(NR tenabledR3(R#(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR ns
cC`s|jdrdSdS(NRRBR3(R#(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRts
(R)R*R/R R(((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRAmstReportableChangescB`seZRS((R)R*(((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRC{st
DifferencecB`sSeZdd�Zd�Zed��Zed��Zed��Zd�Z	RS(cC`s||_||_dS(N(twantthave(R&RERF((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyt__init__�s	cC`s?yt||�}|SWn!tk
r:|j|�}|SXdS(N(R;tAttributeErrort_Difference__default(R&tparamR>((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pytcompare�s
cC`s+|jj|jjkr'td��ndS(Ns$The parent monitor cannot be changed(RERRFR(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR�scC`s�|jjdkr(|jjdkr(dS|jjdkrZ|jji|jjd6�n|jjdkr�|jji|jjd6�n|jjdkr�|jjdkr�td��n|jj|jjkr�|jjSdS(NR"R!R9sASpecifying an IP address requires that a port number be specified(NR9(RER!R$R"tupdateRFRR(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.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'.(RERR$RRRF(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR�s$cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R;RERFRH(R&RJtattr1tattr2((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyt	__default�s
N(
R)R*R$RGRKR/RRRRI(((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRDs	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�|_d|_td|jj�|_t	�|_
dS(Ntmoduletparams(tgetR$RQR
RRtclientRFR6RERAtchanges(R&targstkwargs((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRG�s
	cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRR(RR-R;RER$RARU(R&tchangedtkey((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyt_set_changed_options�scC`s�t|j|j�}tj}t�}x9|D]1}|j|�}|dkrUq.q.|||<q.W|rtd|�|_	t
StS(NRR(RDRERFRR.tdictRKR$RARUR5R4(R&tdiffR.RXtktchange((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyt_update_changed_options�s		
cC`sH|jdg�}x/|D]'}|jjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRQt	deprecate(R&R>twarningstwarning((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyt_announce_deprecations�s


cC`s�|jjdkr,|jjidd6�n|jjdkrX|jjidd6�n|jjdkr�|jjidd6�n|jjdkr�|jjidd6�n|jjdkr�|jjidd	6�n|jjdkr|jjid
d6�n|jj	dkr4|jjidd
6�n|jj
dkr`|jjitd6�n|jjdkr�|jjitd6�ndS(NixRiRR9R!R"iRiRiRRR (
RERR$RLRR!R"RRRRR4R (R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyt_set_default_creation_values�s$cC`s�t|jd�s!td��nt}t�}|jj}|dkrW|j�}n|dkrr|j�}nt	d|j
j��}|j�}|j|�|jtd|��|j
|�|S(Ntgtms+GTM must be provisioned to use this module.tpresenttabsentRRRX(RRTRR4R[REtstateRjRkRCRUR@RLRg(R&RXR>Rlt
reportableRU((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pytexec_module�s 	

cC`s$|j�r|j�S|j�SdS(N(texistsRLtcreate(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRjs
cC`s2|j�|j�|jjr$tS|j�tS(N(RhRZRQt
check_modeR5tcreate_on_device(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRps


cC`s|j�}|rtStS(N(R_R5R4(R&R>((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyt
should_update scC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceRFRsR4RQRqR5tupdate_on_device(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRL&s
cC`s|j�r|j�StS(N(RotremoveR4(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRk/s
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the monitor.(RQRqR5tremove_from_deviceRoR(R&((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRv4s
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(Ns5https://{0}:{1}/mgmt/tm/gtm/monitor/tcp-half-open/{2}tservertserver_porttcodei�tmessageRR(R7RTtproviderRRER8tnametapiRStjsont
ValueErrorRtstrtcontentR0(R&turitresptresponsetex((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRt<s

cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns5https://{0}:{1}/mgmt/tm/gtm/monitor/tcp-half-open/{2}RxRyi�Rz(R7RTR|RRER8R}R~RSRR�R4RR5(R&R�R�R�((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRoOs


+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(Ns5https://{0}:{1}/mgmt/tm/gtm/monitor/tcp-half-open/{2}RxRyRRzi�R{(RUt
api_paramsR7RTR|RRER8R}R~tpatchRR�RR�R�(R&RRR�R�R�R�((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRu^s

cC`s�|jj�}|jj|d<|jj|d<dj|jjd|jjd�}|jjj	|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr�|ddkr�d
|kr�t|d
��q�t|j��n|dS(
NR}R8s2https://{0}:{1}/mgmt/tm/gtm/monitor/tcp-half-open/RxRyRRzi�i�R{tselfLink(i�i�(RUR�RER}R8R7RTR|R~tpostRR�RR�R�(R&RRR�R�R�R�((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRrqs 
cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns5https://{0}:{1}/mgmt/tm/gtm/monitor/tcp-half-open/{2}RxRyi�(
R7RTR|RRER8R}R~tdeleteRR5RR�(R&R�R�((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRw�s

(R)R*RGRZR_RgRhRnRjRpRsRLRkRvRtRoRuRrRw(((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRP�s"																	tArgumentSpeccB`seZd�ZRS(c C`st|_tdtdt�dtdd�dt�dt�dtd	d
�dtd	d
�dtd	d
�d
td	d
�dtd	d
�dtd	d�dtd	d�dtdddddg�dtdddtdgf��
}i|_|jjt�|jj|�dS(NR}trequiredRtdefaults/Common/tcp_half_openR!R"RR(R%RRRRRtboolR RlRjtchoicesRkR8tCommontfallbacktF5_PARTITION(R5tsupports_check_modeR[R	t
argument_specRLR(R&R�((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyRG�s,				(R)R*RG(((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyR��scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RQRa(
R�RR�R�RPRnt	exit_jsonRt	fail_jsonR�(tspecRQtmmtresultsR�((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.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.icontrolRt)library.module_utils.network.f5.ipaddressRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont(ansible.module_utils.network.f5.icontrolt)ansible.module_utils.network.f5.ipaddressRR0R6R:RARCtobjectRDRPR�R�R)(((s^/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_gtm_monitor_tcp_half_open.pyt<module>sN


t!&
@$C�	

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