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_http2.pyc

�
�Udac@`ssddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZy�dd
l
mZddlmZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
r�dd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd ��YZd!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_profile_http2
short_description: Manage HTTP2 profiles on a BIG-IP
description:
  - Manage HTTP2 profiles on a BIG-IP.
version_added: 2.8
options:
  name:
    description:
      - Specifies the name of the 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(http2) profile.
    type: str
    default: /Common/http2
  description:
    description:
      - Description of the profile.
    type: str
  streams:
    description:
      - Specifies the number of outstanding concurrent requests that are allowed on a single HTTP/2 connection.
      - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
      - The valid value range is C(1 - 256).
    type: int
  idle_timeout:
    description:
      - Specifies the number of seconds that an HTTP/2 connection is idly left open before being shut down.
      - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
    type: int
  insert_header:
    description:
      - Specifies whether an HTTP header indicating the use of HTTP/2 should be inserted into the request
        that goes to the server.
      - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
    type: bool
  insert_header_name:
    description:
      - Specifies the name of the HTTP header controlled by C(insert_header) parameter.
      - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
    type: str
  enforce_tls_requirements:
    description:
      - Specifies whether the system requires TLS for communications between specified senders and recipients.
      - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
    type: bool
  activation_modes:
    description:
      - Specifies what will cause an incoming connection to be handled as a HTTP/2 connection.
      - The C(alpn) and C(always) are mutually exclusive.
      - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
    type: list
    choices:
      - alpn
      - always
  frame_size:
    description:
      - Specifies the size of data frames, in bytes, that HTTP/2 sends to the client.
      - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
      - The valid value range in bytes is C(1024 - 16384).
    type: int
  write_size:
    description:
      - Specifies the total size of combined data frames, in bytes, that HTTP/2 sends in a single write.
      - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
      - The valid value range in bytes is C(2048 - 32768).
    type: int
  receive_window:
    description:
      - Specifies the way that the HTTP/2 profile performs flow control.
      - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
      - The valid value range in kilobytes is C(16 - 128).
    type: int
  header_table_size:
    description:
      - Specifies the size of the header table, in bytes.
      - When creating a new profile, if this parameter is not specified, the default is provided by the parent profile.
      - The valid value range in bytes is C(0 - 65535).
    type: int
  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:
  - Wojciech Wypior (@wojtek0806)
s�
- name: Create HTTP2 profile
  bigip_profile_http2:
    name: my_profile
    insert_header: yes
    insert_header_name: FOO
    state: present
    provider:
      user: admin
      password: secret
      server: lb.mydomain.com
  delegate_to: localhost

- name: Remove HTTP profile
  bigip_profile_http2:
    name: my_profile
    state: absent
    provider:
      server: lb.mydomain.com
      user: admin
      password: secret
  delegate_to: localhost

- name: Add HTTP profile set activation modes
  bigip_profile_http:
    name: my_profile
    activation_modes:
      - always
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s�
description:
  description: Description of the profile.
  returned: changed
  type: str
  sample: My profile
insert_header_name:
  description: Specifies the name of the HTTP2 header
  returned: changed
  type: str
  sample: X-HTTP2
streams:
  description: The number of outstanding concurrent requests allowed on a single HTTP/2 connection
  returned: changed
  type: int
  sample: 30
enforce_tls_requirements:
  description: pecifies whether the system requires TLS for communications.
  returned: changed
  type: bool
  sample: yes
frame_size:
  description: The size of the data frames
  returned: changed
  type: int
  sample: 30
activation_modes:
  description: Specifies HTTP/2 connection handling modes
  returned: changed
  type: list
  sample: ['always']
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(ttransform_name(tflatten_boolean(t
is_empty_list(tf5_argument_spect
ParameterscB`s�eZidd6dd6dd6dd6dd	6d
d6dd
6dd6dd6dd6dd6Zdddddd	dd
ddddgZddddddd
dddddgZddddddd
dddddgZRS(tactivation_modestactivationModeststreamstconcurrentStreamsPerConnectiontidle_timeouttconnectionIdleTimeouttparenttdefaultsFromtenforce_tls_requirementstenforceTlsRequirementst
frame_sizet	frameSizetheader_table_sizetheaderTableSizet
insert_headertinsertHeadertinsert_header_nametinsertHeaderNametreceive_windowt
receiveWindowt
write_sizet	writeSizetdescription(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR�s`
		t
ApiParameterscB`seZRS((R*R+(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR0stModuleParameterscB`s�eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
ed��ZRS(	cC`s4|jddkrdSt|j|jd�}|S(NR(t_valuestNoneR
t	partition(tselftresult((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRscC`sO|jd}|dkrdS|dks5|dkrDtd��n|jdS(NRiis'Streams value must be between 1 and 256(R2R3R(R5R((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRs
cC`sO|jd}|dkrdS|dks5|dkrDtd��n|jdS(NR%ii�s/Receive Window value must be between 16 and 128(R2R3R(R5twindow((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR%%s
cC`sO|jd}|dkrdS|dks5|dkrDtd��n|jdS(NRii��s3Header Table Size value must be between 0 and 65535(R2R3R(R5theader((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR0s
cC`sO|jd}|dkrdS|dks5|dkrDtd��n|jdS(NR'ii�s/Write Size value must be between 2048 and 32768(R2R3R(R5twrite((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR';s
cC`sO|jd}|dkrdS|dks5|dkrDtd��n|jdS(NRii@s/Write Size value must be between 1024 and 16384(R2R3R(R5tframe((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRFs
cC`s7t|jd�}|dkr#dS|dkr3dSdS(NRtyestenabledtdisabled(RR2R3(R5R6((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRQscC`s7t|jd�}|dkr#dS|dkr3dSdS(NR!R;R<R=(RR2R3(R5R6((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR!ZscC`s<|jd}|dkrdSt|�r8td��n|S(NRs8Activation Modes cannot be empty, please provide a value(R2R3RR(R5tvalue((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRcs
(R*R+tpropertyRRR%RR'RRR!R(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR1s		tChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R.tgetattrt_filter_paramst	Exception(R5R6t
returnable((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyt	to_returnps
(R*R+RE(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR@ost
UsableChangescB`seZRS((R*R+(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRF{stReportableChangescB`s&eZed��Zed��ZRS(cC`s2|jddkrdS|jddkr.dSdS(NR!R<R;tno(R2R3(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR!�s
cC`s2|jddkrdS|jddkr.dSdS(NRR<R;RH(R2R3(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR�s
(R*R+R?R!R(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRGst
DifferencecB`sDeZdd�Zd�Zd�Zed��Zed��ZRS(cC`s||_||_dS(N(twantthave(R5RJRK((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(RAtAttributeErrort_Difference__default(R5tparamR6((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RARJRKRM(R5ROtattr1tattr2((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyt	__default�s
cC`s+|jj|jjkr'td��ndS(Ns$The parent profile cannot be changed(RJRRKR(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR�scC`sy|jjdkrdS|jjdkrS|jjdksL|jjdkrSdSn|jj|jjkru|jjSdS(Nttnone(RJR)R3RK(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR)�s$N(	R*R+R3RLRPRNR?RR)(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRI�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(tgetR3RWR
RXtclientR1RJR0RKRFtchanges(R5targstkwargs((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRL�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRX(RR.RARJR3RFR[(R5tchangedtkey((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.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(NRX(RIRJRKRR/tdictRPR3t
isinstancetupdateRFR[tTruetFalse(R5tdiffR/R^tktchange((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyt_update_changed_options�s		
cC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRXR^(ReRaRJtstateRjRkRGR[RERct_announce_deprecations(R5R^R6Rlt
reportableR[((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pytexec_module�s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRZRWt	deprecate(R5R6twarningstwarning((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRm�s


cC`s$|j�r|j�S|j�SdS(N(texistsRctcreate(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRj�s
cC`s|j�r|j�StS(N(RwtremoveRe(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRk�s
cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceRKt
should_updateReRWt
check_modeRdtupdate_on_device(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRc�s
cC`s|j�}|rtStS(N(RiRdRe(R5R6((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR{scC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RWR|Rdtremove_from_deviceRwR(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRys
cC`s(|j�|jjrtS|j�tS(N(R`RWR|Rdtcreate_on_device(R5((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRxs


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/profile/http2/{2}tservertserver_porti�tcode(tformatRZtproviderRRJR4tnametapiRYtjsont
ValueErrorReRRd(R5turitresptresponse((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRws


+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|dS(NR�R4s*https://{0}:{1}/mgmt/tm/ltm/profile/http2/R�R�R�R�i�i�i�tmessagetselfLink(i�i�i�(R[t
api_paramsRJR�R4R�RZR�R�tpostR�R�Rtstrtcontent(R5RXR�R�R�tex((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR*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(
Ns-https://{0}:{1}/mgmt/tm/ltm/profile/http2/{2}R�R�R�R�i�i�R�(i�i�(R[R�R�RZR�RRJR4R�R�tpatchR�R�RR�R�(R5RXR�R�R�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR}?s

cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns-https://{0}:{1}/mgmt/tm/ltm/profile/http2/{2}R�R�i�(
R�RZR�RRJR4R�R�tdeleteRRdRR�(R5R�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR~Rs

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/profile/http2/{2}R�R�R�i�R�RX(R�RZR�RRJR4R�R�RYR�R�RR�R�R0(R5R�R�R�R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRz]s

(R*R+RLR`RiRoRmRjRkRcR{RyRxRwRR}R~Rz(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRV�s 																tArgumentSpeccB`seZd�ZRS(c$C`sGt|_tdtdt�dtdd�dtddd	d
dgddd
g�d
t�dtdd�dtdd�dtdd�dtdd�dtdd�dtdd�dt�dtdd�dtdd�dtddd	ddg�dtdddtdgf��}i|_|jjt�|jj|�dS( NR�trequiredRtdefaults
/Common/http2Rttypetlisttchoicestalpntalwaystmutually_exclusiveR)RtboolRtintRRRR!R#R%R'RlRjRkR4tCommontfallbacktF5_PARTITION(Rdtsupports_check_modeRaR	t
argument_specRcR(R5R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyRLrs6				(R*R+RL(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyR�qscC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RWRq(
R�RR�R�RVRot	exit_jsonRt	fail_jsonR�(tspecRWtmmtresultsR�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.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
RRRRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commonRR0R1R@RFRGtobjectRIRVR�R�R*(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_profile_http2.pyt<module>sN


g#!
=]'�%	

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