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/bigiq_application_fastl4_tcp.pyo

�
�Udac@`s?ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZydddlmZddlmZddlmZddlmZddlmZddlmZWnqek
rUddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��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'kr;e(�ndS((i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys
---
module: bigiq_application_fastl4_tcp
short_description: Manages BIG-IQ FastL4 TCP applications
description:
  - Manages BIG-IQ applications used for load balancing a TCP-based application
    with a FastL4 profile.
version_added: 2.6
options:
  name:
    description:
      - Name of the new application.
    type: str
    required: True
  description:
    description:
      - Description of the application.
    type: str
  servers:
    description:
      - A list of servers that the application is hosted on.
      - If you are familiar with other BIG-IP setting, you might also refer to this
        list as the list of pool members.
      - When creating a new application, at least one server is required.
    suboptions:
      address:
        description:
          - The IP address of the server.
        type: str
        required: True
      port:
        description:
          - The port of the server.
          - When creating a new application and specifying a server, if this parameter
            is not provided, the default of C(8000) will be used.
        type: str
        default: 8000
    type: list
  inbound_virtual:
    description:
      - Settings to configure the virtual which will receive the inbound connection.
    type: dict
    suboptions:
      address:
        description:
          - Specifies destination IP address information to which the virtual server
            sends traffic.
          - This parameter is required when creating a new application.
        type: str
        required: True
      netmask:
        description:
          - Specifies the netmask to associate with the given C(destination).
          - This parameter is required when creating a new application.
        type: str
        required: True
      port:
        description:
          - The port that the virtual listens for connections on.
          - When creating a new application, if this parameter is not specified, the
            default value of C(8080) will be used.
        type: str
        default: 8080
  service_environment:
    description:
      - Specifies the name of service environment that the application will be
        deployed to.
      - When creating a new application, this parameter is required.
      - The service environment type will be discovered by this module automatically.
        Therefore, it is crucial that you maintain unique names for items in the
        different service environment types.
      - SSGs are not supported for this type of application.
    type: str
  add_analytics:
    description:
      - Collects statistics of the BIG-IP that the application is deployed to.
      - This parameter is only relevant when specifying a C(service_environment) which
        is a BIG-IP; not an SSG.
    type: bool
    default: no
  state:
    description:
      - The state of the resource on the system.
      - When C(present), guarantees that the resource exists with the provided attributes.
      - When C(absent), removes the resource from the system.
    type: str
    choices:
      - absent
      - present
    default: present
  wait:
    description:
      - If the module should wait for the application to be created, deleted or updated.
    type: bool
    default: yes
extends_documentation_fragment: f5
notes:
  - This module does not support updating of your application (whether deployed or not).
    If you need to update the application, the recommended practice is to remove and
    re-create.
  - This module will not work on BIGIQ version 6.1.x or greater.
author:
  - Tim Rupp (@caphrim007)
s
- name: Load balance a TCP-based application with a FastL4 profile
  bigiq_application_fastl4_tcp:
    name: my-app
    description: My description
    service_environment: my-bigip-device
    servers:
      - address: 1.2.3.4
        port: 8080
      - address: 5.6.7.8
        port: 8080
    inbound_virtual:
      name: foo
      address: 2.2.2.2
      netmask: 255.255.255.255
      port: 443
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
    state: present
  delegate_to: localhost
sd
description:
  description: The new description of the application of the resource.
  returned: changed
  type: str
  sample: My application
service_environment:
  description: The environment which the service was deployed to.
  returned: changed
  type: str
  sample: my-ssg1
inbound_virtual_destination:
  description: The destination of the virtual that was created.
  returned: changed
  type: str
  sample: 6.7.8.9
inbound_virtual_netmask:
  description: The network mask of the provided inbound destination.
  returned: changed
  type: str
  sample: 255.255.255.0
inbound_virtual_port:
  description: The port the inbound virtual address listens on.
  returned: changed
  type: int
  sample: 80
servers:
  description: List of servers, and their ports, that make up the application.
  type: complex
  returned: changed
  contains:
    address:
      description: The IP address of the server.
      returned: changed
      type: str
      sample: 2.3.4.5
    port:
      description: The port that the server listens on.
      returned: changed
      type: int
      sample: 8080
  sample: hash/dictionary of values
N(tLooseVersion(t
AnsibleModule(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tf5_argument_spec(tis_valid_ip(t
bigiq_versiont
Parametersc	B`s�eZidd6dd6dd6dd6dd	6Zd
dddddd	gZd
ddddddd
dg	Zd
dddddddgZRS(ttemplate_referencettemplateReferencetsub_pathtsubPathtconfig_set_namet
configSetNametdefault_device_referencetdefaultDeviceReferencet
add_analyticstaddAnalyticst	resourcestdescriptiontserverstinbound_virtual(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�s
t
ApiParameterscB`seZRS((RR (((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR%�stModuleParameterscB`sSeZed��Zed��Zed��Zed��Zed��ZRS(cC`sdS(Ntprofile_http((tself((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pythttp_profile�scC`s|jS(N(tname(R(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�scC`s|jS(N(R*(R(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�scC`sd}dj|jjd|jjd|�}|jjj|�}y|j�}Wn%tk
r{}tt|���nX|j	dkr�|ddkr�td��nMd	|kr�|d	d
kr�d|kr�t|d��q�t|j
��ntd|d
dd�}|S(Ns+name+eq+'Default-f5-FastL4-TCP-lb-template'sMhttps://{0}:{1}/mgmt/cm/global/templates/?$filter={2}&$top=1&$select=selfLinktservertserver_porti�t
totalItemsis&No default HTTP LB template was found.tcodei�tmessagetlinktitemstselfLink(tformattclienttprovidertapitgettjsont
ValueErrorRtstrRt_contenttdict(R(tfilterturitresptresponsetextresult((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�s(

	cC`sRt|j�r$dj|j�}ndj|j�}dj|jjd|jjd|�}|jjj|�}y|j�}Wn%tk
r�}t	t
|���nX|jdkr�|ddkr�t	d	j|j���nMd
|kr3|d
dkr3d|kr!t	|d��q3t	|j��nt
d
|ddd�}|S(Nsaddress+eq+'{0}'shostname+eq+'{0}'szhttps://{0}:{1}/mgmt/shared/resolver/device-groups/cm-adccore-allbigipDevices/devices/?$filter={2}&$top=1&$select=selfLinkR+R,i�R-is2The specified service_environment '{0}' was found.R.i�R/R0R1R2(Rtservice_environmentR3R4R5R6R7R8R9RR:RR;R<(R(R=R>R?R@RARB((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRs,

	(RR tpropertyR)RRRR(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR&�s
tChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R#tgetattrt_filter_paramst	Exception(R(RBt
returnable((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyt	to_return:s
(RR RJ(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRE9st
UsableChangescB`s�eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
RS(cC`sMt�}|j|j�|j|j�|j|j�|j|j�|S(N(R<tupdatettcp_monitortvirtualtpooltnodes(R(RB((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRFs	c
C`sdt�}tdtddd|jdd|jdd|jjd	d
��d|j�g|d<|S(
Nt
parametersR*RNtdestinationAddresstaddresstmasktnetmasktdestinationPorttporti�tsubcollectionResourcessltm:virtual:20e0ce0ae107(R<RR7tprofiles(R(RB((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRNOs	

cC`s itdt��gd6}|S(NRQsprofiles:53f9b3028d90(R<(R(RB((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRY_scC`s5t�}tdtdd�d|j�g|d<|S(NRQR*tpool_0RXsltm:pool:9fa59a7bfc5c(R<tpool_members(R(RB((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyROjs		cC`s�t�}g|d<xu|jD]j}tdtd|jdd�dtddj|d�d	d
j|d����}|dj|�qW|S(Nsmembers:3e91bd30bbfbRQRWi@t
nodeReferenceR0s%#/resources/ltm:node:3e91bd30bbfb/{0}RStfullPaths# {0}(R<RR7R3tappend(R(RBtxtmember((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR[ws	
cC`s,t�}tdtdd��g|d<|S(NRQR*smonitor-tcpsltm:monitor:tcp:f864a2efffea(R<(R(RB((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRM�s
	c	C`sbt�}g|d<xH|jD]=}tdtd|dd|d��}|dj|�qW|S(Nsltm:node:3e91bd30bbfbRQR*RS(R<RR^(R(RBR_ttmp((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRP�s	

cC`s$g|jD]}|d^q
}|S(NRS(R(R(R_RB((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pytnode_addresses�s (RR RDRRNRYROR[RMRPRb(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRKEs	
tReportableChangescB`seZRS((RR (((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRc�st
DifferencecB`s&eZdd�Zd�Zd�ZRS(cC`s||_||_dS(N(twantthave(R(ReRf((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(RFtAttributeErrort_Difference__default(R(tparamRB((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RFReRfRh(R(Rjtattr1tattr2((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyt	__default�s
N(RR tNoneRgRkRi(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRd�s	t
ModuleManagercB`s�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�ZRS(cO`sm|jdd�|_t|jj�|_td|jj�|_|j|j_t�|_	t
�|_dS(Ntmoduletparams(R7RoRqR
RrR4R&ReR%RfRKtchanges(R(targstkwargs((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRg�scC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRr(RR#RFReRoRKRs(R(tchangedtkey((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.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(NRr(RdReRfRR$R<RkRot
isinstanceRLRKRstTruetFalse(R(tdiffR$Rvtktchange((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(RRzR{(R(RB((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyt
should_update�scC`s:t|j�}t|�td�kr6td��ndS(Ns6.1.0s2Module supports only BIGIQ version 6.0.x or lower.(RR4RR(R(tversion((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pytcheck_bigiq_version�scC`s�|j�t}t�}|jj}|dkr@|j�}n|dkr[|j�}ntd|jj	��}|j	�}|j
|�|j
td|��|j|�|S(NtpresenttabsentRrRv(R�R{R<RetstateR�R�RcRsRJRLt_announce_deprecations(R(RvRBR�t
reportableRs((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pytexec_module�s
	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgR�(tpopR4Rqt	deprecate(R(RBtwarningstwarning((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�s


cC`s|j�rtS|j�SdS(N(texistsR{tcreate(R(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�scC`s�dj|jjd|jjd|jj�}|jjj|�}y|j�}Wn%tk
r{}t	t
|���nX|jdkr�d|kr�d|dkr�|dddkr�tSt
S(Nsbhttps://{0}:{1}/mgmt/ap/query/v1/tenants/default/reports/AllApplicationsList?$filter=name+eq+'{2}'R+R,i�RBR-i(R3R4R5ReR*R6R7R8R9RR:RR{Rz(R(R>R?R@RA((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�s

?cC`sW|jjrtS|j�}|jjrS|j|�|j�rStd��qSntS(NsFailed to delete the resource.(	Rqt
check_modeRztremove_from_deviceRetwaittwait_for_apply_template_taskR�R(R(t	self_link((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pytremove!s
cC`s�|jjdkr!td��n|jjdkrBtd��n|jjdkrctd��n|j�|jjr}t	S|j
�}|jjr�|j|�|j
�s�td��q�nt	S(NsJA 'service_environment' must be specified when creating a new application.sFAt least one 'servers' item is needed when creating a new application.sGAn 'inbound_virtual' must be specified when creating a new application.sFailed to deploy application.(ReRCRoRRRRxRqR�Rztcreate_on_deviceR�R�R�(R(R�((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�+s&

cC`s�|jj�}d|d<dj|jjd|jjd�}|jjj|d|�}y|j�}Wn%tk
r�}t	t
|���nXd|kr�|ddkr�d	|kr�t	|d	��q�t	|j��n|d
S(NtCREATEtmodes3https://{0}:{1}/mgmt/cm/global/tasks/apply-templateR+R,R8R.i�R/R2(Rst
api_paramsR3R4R5R6tpostR8R9RR:R;(R(RrR>R?R@RA((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�Ds

cC`s|j�r|j�StS(N(R�R�R{(R(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�Zs
cC`s�td|jjdd�}dj|jjd|jjd�}|jjj|d|�}y|j�}Wn%t	k
r�}t
t|���nXd|kr�|dd	kr�d
|kr�t
|d
��q�t
|j��n|dS(NRR�tDELETEs3https://{0}:{1}/mgmt/cm/global/tasks/apply-templateR+R,R8R.i�R/R2(
R<ReR*R3R4R5R6R�R8R9RR:R;(R(RrR>R?R@RA((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�_s 	
cC`s�dj|jjd|jjd�}|jd|�}x�tr�|jjj|�}y|j�}Wn%tk
r�}t	t
|���nX|ddkr�|jdd�dkr�tSd	|kr�t	|d	��ntj
d
�q;WdS(Nshttps://{0}:{1}R+R,shttps://localhostRtFINISHEDtcurrentSteptDONEterrorMessagei(R3R4R5treplaceRzR6R7R8R9RR:Rottimetsleep(R(R�thostR>R?R@RA((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR�vs
	((RR RgRxRR�R�R�R�R�R�R�R�R�R�R�R�(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRp�s										
				tArgumentSpeccB`seZd�ZRS(cC`s t|_tdtdt�dt�dtdddtdtdt�d	td
d���dtdd
dtdtdt�dtdt�d	td
d���dt�dtddd
d�dtd
ddddg�dtddd
d��}i|_|jjt�|jj|�dS(NR*trequiredRRttypetlisttoptionsRSRWtdefaulti@RR<RUi�RCRtbooltnoR�R�tchoicesR�R�tyes(Rztsupports_check_modeR<t
argument_specRLR
(R(R�((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyRg�s0				(RR Rg(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyR��scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RqR�(
R�R	R�R�RpR�t	exit_jsonRt	fail_jsonR:(tspecRqtmmtresultsRA((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pytmain�s		t__main__(*t
__future__RRRR�t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR�tdistutils.versionRtansible.module_utils.basicR	t%library.module_utils.network.f5.bigiqR
t&library.module_utils.network.f5.commonRRR
t)library.module_utils.network.f5.ipaddressRt(library.module_utils.network.f5.icontrolRtImportErrort%ansible.module_utils.network.f5.bigiqt&ansible.module_utils.network.f5.commont)ansible.module_utils.network.f5.ipaddresst(ansible.module_utils.network.f5.icontrolRR%R&RERKRctobjectRdRpR�R�R(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigiq_application_fastl4_tcp.pyt<module>sH


i,
Kc�"	

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