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_profile_http_compression.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_bysT	
---
module: bigip_profile_http_compression
short_description: Manage HTTP compression profiles on a BIG-IP
description:
  - Manage HTTP compression profiles on a BIG-IP.
version_added: 2.7
options:
  name:
    description:
      - Specifies the name of the compression profile.
    type: str
    required: True
  parent:
    description:
      - Specifies the profile from which this profile inherits settings.
      - When creating a new profile, if this parameter is not specified, the default
        is the system-supplied C(httpcompression) profile.
    type: str
  description:
    description:
      - Description of the HTTP compression profile.
    type: str
  buffer_size:
    description:
      - Maximum number of compressed bytes that the system buffers before inserting
        a Content-Length header (which specifies the compressed size) into the response.
      - When creating a new profile, if this parameter is not specified, the default
        is provided by the parent profile.
    type: int
  gzip_level:
    description:
      - Specifies the degree to which the system compresses the content.
      - Higher compression levels cause the compression process to be slower.
      - Valid values are between 1 (least compression and fastest) to 9 (most
        compression and slowest).
    type: int
    choices:
      - 1
      - 2
      - 3
      - 4
      - 5
      - 6
      - 7
      - 8
      - 9
  gzip_memory_level:
    description:
      - Number of kilobytes of memory that the system uses for internal compression
        buffers when compressing a server response.
    type: int
    choices:
      - 1
      - 2
      - 4
      - 8
      - 16
      - 32
      - 64
      - 128
      - 256
  gzip_window_size:
    description:
      - Number of kilobytes in the window size that the system uses when compressing
        a server response.
    type: int
    choices:
      - 1
      - 2
      - 4
      - 8
      - 16
      - 32
      - 64
      - 128
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
  state:
    description:
      - When C(present), ensures that the profile exists.
      - When C(absent), ensures the profile is removed.
    type: str
    choices:
      - present
      - absent
    default: present
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
s_
- name: Create an HTTP compression profile
  bigip_profile_http_compression:
    name: profile1
    description: Custom HTTP Compression Profile
    buffer_size: 131072
    gzip_level: 6
    gzip_memory_level: 16k
    gzip_window_size: 64k
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
st
description:
  description: The new description of the resource.
  returned: changed
  type: str
  sample: My custom profile
buffer_size:
  description: The new buffer size of the profile.
  returned: changed
  type: int
  sample: 4096
gzip_memory_level:
  description: The new GZIP memory level, in KB, of the profile.
  returned: changed
  type: int
  sample: 16
gzip_level:
  description: The new GZIP level of the profile. Smaller is less compression.
  returned: changed
  type: int
  sample: 2
gzip_window_size:
  description: The new GZIP window size, in KB, of the profile.
  returned: changed
  type: int
  sample: 64
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tf5_argument_spec(ttransform_namet
ParameterscB`sseZidd6dd6dd6dd6dd	6Zd
ddddd	gZd
ddddgZd
ddddgZRS(tbuffer_sizet
bufferSizetparenttdefaultsFromtgzip_memory_leveltgzipMemoryLevelt
gzip_levelt	gzipLeveltgzip_window_sizetgzipWindowSizetdescription(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR�s,
		t
ApiParameterscB`s5eZed��Zed��Zed��ZRS(cC`s"|jddkrdS|jdS(NRtnone(NR#(t_valuestNone(tself((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR�scC`s&|jddkrdS|jddS(NRi(R$R%(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR�scC`s&|jddkrdS|jddS(NRi(R$R%(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR�s(RRtpropertyRRR(((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR"�stModuleParameterscB`seZed��ZRS(cC`s4|jddkrdSt|j|jd�}|S(NR(R$R%R
t	partition(R&tresult((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR�s(RRR'R(((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR(�stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R tgetattrt_filter_paramst	Exception(R&R*t
returnable((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyt	to_return�s
(RRR0(((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR+�st
UsableChangescB`s&eZed��Zed��ZRS(cC`s&|jddkrdS|jddS(NRi(R$R%(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR�scC`s&|jddkrdS|jddS(NRi(R$R%(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRs(RRR'RR(((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR1�stReportableChangescB`s&eZed��Zed��ZRS(cC`s&|jddkrdS|jddS(NRi(R$R%(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRscC`s&|jddkrdS|jddS(NRi(R$R%(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRs(RRR'RR(((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR2st
DifferencecB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(twantthave(R&R4R5((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyt__init__s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R,tAttributeErrort_Difference__default(R&tparamR*((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pytcompares

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R,R4R5R7(R&R9tattr1tattr2((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyt	__default!s
cC`s+|jj|jjkr'td��ndS(Ns$The parent profile cannot be changed(R4RR5R(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR*sN(RRR%R6R:R8R'R(((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR3s			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(tgetR%R?R
R@tclientR(R4R"R5R1tchanges(R&targstkwargs((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR63s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NR@(RR R,R4R%R1RC(R&tchangedtkey((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.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(NR@(R3R4R5RR!tdictR:R%t
isinstancetupdateR1RCtTruetFalse(R&tdiffR!RFtktchange((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyt_update_changed_optionsBs		
cC`s|j�}|rtStS(N(RQRLRM(R&R*((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyt
should_updateTscC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentR@RF(RMRIR4tstateRSRTR2RCR0RKt_announce_deprecations(R&RFR*RUt
reportableRC((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pytexec_moduleZs	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRBR?t	deprecate(R&R*twarningstwarning((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRVks


cC`s$|j�r|j�S|j�SdS(N(texistsRKtcreate(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRSss
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns8https://{0}:{1}/mgmt/tm/ltm/profile/http-compression/{2}tservertserver_porti�tcode(tformatRBtproviderRR4R)tnametapiRAtjsont
ValueErrorRMRRL(R&turitresptresponse((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR`ys


+cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR5RRRMR?t
check_modeRLtupdate_on_device(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRK�s
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(R?RoRLtremove_from_deviceR`R(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pytremove�s
cC`s(|j�|jjrtS|j�tS(N(RHR?RoRLtcreate_on_device(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRa�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��ndS(
NRgR)s5https://{0}:{1}/mgmt/tm/ltm/profile/http-compression/RbRcRiRdi�i�i�tmessage(i�i�i�(RCt
api_paramsR4RgR)ReRBRfRhtpostRiRjRtstrtcontent(R&R@RkRlRmtex((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRs�s
cC`s�|jj�}dj|jjd|jjdt|jj|jj��}|jj	j
|d|�}y|j�}Wn%tk
r�}t
t|���nXd|kr�|dd	kr�d|kr�t
|d��q�t
|j��ndS(
Ns8https://{0}:{1}/mgmt/tm/ltm/profile/http-compression/{2}RbRcRiRdi�i�Rt(i�i�(RCRuReRBRfRR4R)RgRhtpatchRiRjRRwRx(R&R@RkRlRmRy((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRp�s

cC`s|j�r|j�StS(N(R`RrRM(R&((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRT�s
cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns8https://{0}:{1}/mgmt/tm/ltm/profile/http-compression/{2}RbRci�(
ReRBRfRR4R)RgRhtdeleteRRLRRx(R&RkRl((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRq�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(Ns8https://{0}:{1}/mgmt/tm/ltm/profile/http-compression/{2}RbRcRdi�RtR@(ReRBRfRR4R)RgRhRARiRjRRwRxR"(R&RkRlRmRy((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyRn�s

(RRR6RHRQRRRXRVRSR`RKRrRaRsRpRTRqRn(((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR>2s 																tArgumentSpeccB`seZd�ZRS(cC`s5t|_tdtdt�dt�dtdd�dt�dtddd	d
ddd
dddddg	�dtddd	d
dd
ddddddg	�dtddd	d
dd
dddddg�dtddd	ddg�dtddd td!gf��	}i|_|jjt�|jj|�dS("NRgtrequiredRRttypetintRRtchoicesiiiiiiiii	Rii i@i�iRRUtdefaultRSRTR)tCommontfallbacktF5_PARTITION(RLtsupports_check_modeRIR	t
argument_specRKR(R&R�((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR6�s0			$$!	(RRR6(((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyR|�scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�R?RZ(
R|RR�R�R>RXt	exit_jsonRt	fail_jsonRw(tspecR?tmmtresultsRy((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.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
RRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRR"R(R+R1R2tobjectR3R>R|R�R(((s]/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http_compression.pyt<module>sF


_
#	�"	

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