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

�
�Udac@`s3ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZyddd
l
mZddlmZddlmZddlmZddlmZddlmZWnqek
rIdd
lmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd ��YZd!efd"��YZ d#efd$��YZ!d%�Z"e#d&kr/e"�nd'S((i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigip_firewall_dos_profile
short_description: Manage AFM DoS profiles on a BIG-IP
description:
  - Manages AFM Denial of Service (DoS) profiles on a BIG-IP. To manage the vectors
    associated with a DoS profile, refer to the C(bigip_firewall_dos_vector) module.
version_added: 2.7
options:
  name:
    description:
      - Specifies the name of the profile.
    type: str
    required: True
  description:
    description:
      - The description of the DoS profile.
    type: str
  default_whitelist:
    description:
      - The default whitelist address list for the system to use to determine which
        IP addresses are legitimate.
      - The system does not examine traffic from the IP addresses in the list when
        performing DoS prevention.
      - To define a new whitelist, use the C(bigip_firewall_address_list) module.
    type: str
  threshold_sensitivity:
    description:
      - Specifies the threshold sensitivity for the DoS profile.
      - Thresholds for detecting attacks are higher when sensitivity is C(low), and
        lower when sensitivity is C(high).
      - When creating a new profile, if this parameter is not specified, the default
        is C(medium).
    type: str
    choices:
      - low
      - medium
      - high
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
  state:
    description:
      - When C(present), ensures that the resource exists.
      - When C(absent), ensures the resource is removed.
    type: str
    choices:
      - present
      - absent
    default: present
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
s�
- name: Create a new DoS profile
  bigip_firewall_dos_profile:
    name: profile1
    description: DoS profile 1
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s�
threshold_sensitivity:
  description: The new threshold sensitivity of the profile.
  returned: changed
  type: str
  sample: low
default_whitelist:
  description: The new whitelist attached to the profile.
  returned: changed
  type: str
  sample: /Common/whitelist1
description:
  description: The description of the profile.
  returned: changed
  type: str
  sample: New description
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_namet
ParameterscB`sIeZidd6dd6ZdddgZdddgZdddgZRS(tthreshold_sensitivitytthresholdSensitivitytdefault_whitelistt	whitelisttdescription(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyRys
		t
ApiParameterscB`seZRS((RR(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyR�stModuleParameterscB`seZed��ZRS(cC`s.|jddkrdSt|j|jd�S(NR(t_valuestNoneR
t	partition(tself((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyR�s(RRtpropertyR(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyR�stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(Rtgetattrt_filter_paramst	Exception(R!tresultt
returnable((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyt	to_return�s
(RRR)(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyR#�st
UsableChangescB`seZRS((RR(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyR*�stReportableChangescB`seZRS((RR(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyR+�st
DifferencecB`s&eZdd�Zd�Zd�ZRS(cC`s||_||_dS(N(twantthave(R!R-R.((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R$tAttributeErrort_Difference__default(R!tparamR'((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R$R-R.R0(R!R2tattr1tattr2((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyt	__default�s
N(RRRR/R3R1(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyR,�s	t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�ZRS(cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tgetRR8R
R9tclientRR-RR.R*tchanges(R!targstkwargs((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyR/�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR9(RRR$R-RR*R<(R!tchangedtkey((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.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(NR9(R,R-R.RRtdictR3Rt
isinstancetupdateR*R<tTruetFalse(R!tdiffRR?tktchange((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(RJRERF(R!R'((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyt
should_update�scC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentR9R?(RFRBR-tstateRLRMR+R<R)RDt_announce_deprecations(R!R?R'RNt
reportableR<((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pytexec_module�s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopR;R8t	deprecate(R!R'twarningstwarning((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyROs


cC`s$|j�r|j�S|j�SdS(N(texistsRDtcreate(R!((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyRL	s
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns0https://{0}:{1}/mgmt/tm/security/dos/profile/{2}tservertserver_porti�tcode(tformatR;tproviderRR-R tnametapiR:tjsont
ValueErrorRFRRE(R!turitresptresponse((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyRYs


+cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR.RKRFR8t
check_modeREtupdate_on_device(R!((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyRDs
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(R8RhREtremove_from_deviceRYR(R!((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pytremove's
cC`s(|j�|jjrtS|j�tS(N(RAR8RhREtcreate_on_device(R!((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyRZ/s


cC`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`R s-https://{0}:{1}/mgmt/tm/security/dos/profile/R[R\RbR]i�i�tmessage(i�i�(R<t
api_paramsR-R`R R^R;R_RatpostRbRcRtstrtcontent(R!R9RdReRftex((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyRl6s
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(Ns0https://{0}:{1}/mgmt/tm/security/dos/profile/{2}R[R\RbR]i�Rm(R<RnR^R;R_RR-R R`RatpatchRbRcRRpRq(R!R9RdReRfRr((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyRiJs

cC`s|j�r|j�StS(N(RYRkRF(R!((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyRM]s
cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns0https://{0}:{1}/mgmt/tm/security/dos/profile/{2}R[R\i�(
R^R;R_RR-R R`RatdeleteRRERRq(R!RdRe((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyRjbs

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(Ns0https://{0}:{1}/mgmt/tm/security/dos/profile/{2}R[R\R]i�RmR9(R^R;R_RR-R R`RaR:RbRcRRpRqR(R!RdReRfRr((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyRgms

(RRR/RARJRKRQRORLRYRDRkRZRlRiRMRjRg(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyR7�s 																tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdt�dt�dtddddg�d	t�d
tddddd
g�dtdddtdgf��}i|_|jjt�|jj|�dS(NR`trequiredRRtchoicestlowtmediumthighRRNtdefaultRLRMR tCommontfallbacktF5_PARTITION(REtsupports_check_modeRBR	t
argument_specRDR(R!R�((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyR/�s 				(RRR/(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyRu�scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�RR8RS(
RuRR�RR7RQt	exit_jsonRt	fail_jsonRp(tspecR8tmmtresultsRr((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pytmain�s		t__main__N($t
__future__RRRttypet
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
RRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRRRR#R*R+tobjectR,R7RuR�R(((sY/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_firewall_dos_profile.pyt<module>sF


9
�	

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