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

�
�Udac@`sSddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZytdd
l
mZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
ridd
lmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZdefd��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_bys�

---
module: bigip_routedomain
short_description: Manage route domains on a BIG-IP
description:
  - Manage route domains on a BIG-IP.
version_added: 2.2
options:
  name:
    description:
      - The name of the route domain.
    type: str
    version_added: 2.5
  bwc_policy:
    description:
      - The bandwidth controller for the route domain.
    type: str
  connection_limit:
    description:
      - The maximum number of concurrent connections allowed for the
        route domain. Setting this to C(0) turns off connection limits.
    type: int
  description:
    description:
      - Specifies descriptive text that identifies the route domain.
    type: str
  flow_eviction_policy:
    description:
      - The eviction policy to use with this route domain. Apply an eviction
        policy to provide customized responses to flow overflows and slow
        flows on the route domain.
    type: str
  id:
    description:
      - The unique identifying integer representing the route domain.
      - This field is required when creating a new route domain.
      - In version 2.5, this value is no longer used to reference a route domain when
        making modifications to it (for instance during update and delete operations).
        Instead, the C(name) parameter is used. In version 2.6, the C(name) value will
        become a required parameter.
    type: int
  parent:
    description:
      - Specifies the route domain the system searches when it cannot
        find a route in the configured domain.
    type: str
  partition:
    description:
      - Partition to create the route domain on. Partitions cannot be updated
        once they are created.
    type: str
    default: Common
    version_added: 2.5
  routing_protocol:
    description:
      - Dynamic routing protocols for the system to use in the route domain.
    type: list
    choices:
      - none
      - BFD
      - BGP
      - IS-IS
      - OSPFv2
      - OSPFv3
      - PIM
      - RIP
      - RIPng
  service_policy:
    description:
      - Service policy to associate with the route domain.
    type: str
  state:
    description:
      - Whether the route domain should exist or not.
    type: str
    choices:
      - present
      - absent
    default: present
  strict:
    description:
      - Specifies whether the system enforces cross-routing restrictions or not.
    type: bool
  vlans:
    description:
      - VLANs for the system to use in the route domain.
    type: list
  fw_enforced_policy:
    description:
      - Specifies AFM policy to be attached to route domain.
    type: str
    version_added: 2.8
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s�
- name: Create a route domain
  bigip_routedomain:
    name: foo
    id: 1234
    state: present
    provider:
      user: admin
      password: secret
      server: lb.mydomain.com
  delegate_to: localhost

- name: Set VLANs on the route domain
  bigip_routedomain:
    name: bar
    state: present
    vlans:
      - net1
      - foo
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s�
id:
  description: The ID of the route domain that was changed.
  returned: changed
  type: int
  sample: 2
description:
  description: The description of the route domain.
  returned: changed
  type: str
  sample: route domain foo
strict:
  description: The new strict isolation setting.
  returned: changed
  type: str
  sample: enabled
parent:
  description: The new parent route domain.
  returned: changed
  type: int
  sample: 0
vlans:
  description: List of new VLANs the route domain is applied to.
  returned: changed
  type: list
  sample: ['/Common/http-tunnel', '/Common/socks-tunnel']
routing_protocol:
  description: List of routing protocols applied to the route domain.
  returned: changed
  type: list
  sample: ['bfd', 'bgp']
bwc_policy:
  description: The new bandwidth controller.
  returned: changed
  type: str
  sample: /Common/foo
connection_limit:
  description: The new connection limit for the route domain.
  returned: changed
  type: int
  sample: 100
flow_eviction_policy:
  description: The new eviction policy to use with this route domain.
  returned: changed
  type: str
  sample: /Common/default-eviction-policy
service_policy:
  description: The new service policy to use with this route domain.
  returned: changed
  type: str
  sample: /Common-my-service-policy
fw_enforced_policy:
  description: Specfies AFM policy to be attached to route domain.
  returned: changed
  type: str
  sample: /Common/afm-blocking-policy
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(ttransform_name(tf5_argument_spec(tcmp_simple_listt
ParameterscB`s�eZidd6dd6dd6dd6dd	6d
d6dd
6Zdddddddd	dddd
gZddddddddddg
Zddddddddddd
dgZed��Zed��ZRS(tconnection_limittconnectionLimittservice_policyt
servicePolicyt
bwc_policyt	bwcPolicytflow_eviction_policytflowEvictionPolicytrouting_protocoltroutingProtocoltfw_enforced_policytfwEnforcedPolicytfw_policy_linktfwEnforcedPolicyReferencetdescriptiontstricttparenttvlanstidcC`s(|jddkrdSt|jd�S(NR(t_valuestNonetint(tself((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRscC`s(|jddkrdSt|jd�S(NR$(R%R&R'(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR$s(	t__name__t
__module__tapi_maptapi_attributestreturnablest
updatablestpropertyRR$(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR�sX
			t
ApiParameterscB`s/eZed��Zed��Zd�ZRS(cC`s2|jddkrdS|jddkr.tStS(NR!tenabled(R%R&tTruetFalse(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR!s
cC`s1|j�}g|dD]}|d^q}|S(NtitemstfullPath(tread_domains_from_device(R(tdomainstxtresult((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR7&s!cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��n|S(Ns)https://{0}:{1}/mgmt/tm/net/route-domain/tservertserver_porttcodei�tmessage(
tformattclienttprovidertapitgettjsont
ValueErrorRtstrtcontent(R(turitresptresponsetex((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR6,s
(R)R*R/R!R7R6(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR0stModuleParameterscB`s�eZed��Zed��Zed��Zed��Zed��Zed��Zed��Z	ed��Z
ed��ZRS(	cC`s.|jddkrdSt|j|jd�S(NR(R%R&R
t	partition(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR@scC`s.|jddkrdSt|j|jd�S(NR(R%R&R
RL(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRFscC`s.|jddkrdSt|j|jd�S(NR(R%R&R
RL(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRLscC`s4|jddkrdSt|j|jd�}|S(NR"(R%R&R
RL(R(R9((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR"RscC`su|jddkrdSt|jd�dkrK|jdddkrKdSg|jdD]}t|j|�^qYS(NR#iit(R%R&tlenR
RL(R(R8((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR#Ys
0cC`s+|jddkr t|j�S|jdS(Ntname(R%R&RER$(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyROas
cC`sV|jddkrdSt|jd�dkrK|jdddkrKdS|jdS(NRiiRMtnone(RMRP(R%R&RN(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRgs
0cC`sK|jddkrdS|jddkr.dS|jd}t|j|�S(NRRPRM(snoneRM(R%R&R
RL(R(RO((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRos
cC`sO|j}|dkrdS|jd�}tddj|d|d��}|S(Nt/tlinks;https://localhost/mgmt/tm/security/firewall/policy/~{0}~{1}ii(RR&tsplittdictR>(R(tpolicyttmpRR((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRxs	#(R)R*R/RRRR"R#RORRR(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRK?s	tChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(R-tgetattrt_filter_paramst	Exception(R(R9t
returnable((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyt	to_return�s
(R)R*R\(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRW�st
UsableChangescB`seZed��ZRS(cC`s,|jddkrdS|jdr(dSdS(NR!R1tdisabled(R%R&(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR!�s

(R)R*R/R!(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR]�stReportableChangescB`seZed��ZRS(cC`s2|jddkrdS|jddkr.dSdS(NR!R1tyestno(R%R&(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR!�s
(R)R*R/R!(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR_�st
DifferencecB`sSeZdd�Zd�Zd�Zed��Zed��Zed��Z	RS(cC`s||_||_dS(N(twantthave(R(RcRd((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(RXtAttributeErrort_Difference__default(R(tparamR9((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(RXRcRdRf(R(Rhtattr1tattr2((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyt	__default�s
cC`st|jj|jj�S(N(RRcRRd(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR�scC`st|jj|jj�S(N(RRcR#Rd(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR#�scC`sX|jjdkrdS|jj|jjkr2dS|jj|jjkrT|jjSdS(N(RcRR&RdR(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR�sN(
R)R*R&ReRiRgR/RR#R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRb�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`sp|jdd�|_t|jj�|_td|jjd|j�|_td|j�|_	t
�|_dS(NtmoduletparamsR?(RBR&RnR
RoR?RKRcR0RdR]tchanges(R(targstkwargs((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRe�s
!cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRo(RR-RXRcR&R]Rp(R(tchangedtkey((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.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(NRo(RbRcRdRR.RTRiR&t
isinstancetupdateR]RpR2R3(R(tdiffR.Rstktchange((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(R{R2R3(R(R9((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyt
should_update�scC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRoRs(R3RTRctstateR}R~R_RpR\Rwt_announce_deprecations(R(RsR9Rt
reportableRp((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pytexec_module�s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopR?Rnt	deprecate(R(R9twarningstwarning((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR�s


cC`s$|j�r|j�S|j�SdS(N(texistsRwtcreate(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR}
s
cC`s|j�r|j�StS(N(R�tremoveR3(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR~s
cC`sp|j�|_|j�stS|jjrR|jj|jjkrRtd��n|jj	rbt
S|j�t
S(Ns&The parent route domain was not found.(tread_current_from_deviceRdR|R3RcR"R7RRnt
check_modeR2tupdate_on_device(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRws$
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RnR�R2tremove_from_deviceR�R(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR�"s
cC`s||jjdkr!td��n|jjrT|jj|jjkrTtd��n|j�|jj	rnt
S|j�t
S(Ns?The 'id' parameter is required when creating new route domains.s&The parent route domain was not found.(RcR$R&RR"RdR7RuRnR�R2tcreate_on_device(R(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR�*s$

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/net/route-domain/{2}R:R;i�R<(R>R?R@RRcRLRORARBRCRDR3RR2(R(RGRHRI((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR�9s


+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��n|jjrtd|jjd|jj�}d
j|jjd|jjdt|jj|jj��}|jjj|d|�}y|j
�}Wn%tk
r�}tt
|���nXd|kr|ddkrd
|kr�t|d
��qt|j��qntS(NRORLs)https://{0}:{1}/mgmt/tm/net/route-domain/R:R;RCR<i�i�R=RRs,https://{0}:{1}/mgmt/tm/net/route-domain/{2}(i�i�(i�i�(Rpt
api_paramsRcRORLR>R?R@RAtpostRCRDRRERFRRTRRtpatchR2(R(RoRGRHRIRJtpayload((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR�HsB


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(Ns,https://{0}:{1}/mgmt/tm/net/route-domain/{2}R:R;RCR<i�R=(RpR�R>R?R@RRcRLRORAR�RCRDRRERF(R(RoRGRHRIRJ((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR�ss

cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns,https://{0}:{1}/mgmt/tm/net/route-domain/{2}R:R;i�(
R>R?R@RRcRLRORAtdeleteRR2RRF(R(RGRI((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR��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|d|j�S(	Ns,https://{0}:{1}/mgmt/tm/net/route-domain/{2}R:R;R<i�R=RoR?(R>R?R@RRcRLRORARBRCRDRRERFR0(R(RGRHRIRJ((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR��s

(R)R*ReRuR{R|R�R�R}R~RwR�R�R�R�R�R�R�(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRm�s 									
				+		tArgumentSpeccB`seZd�ZRS(c"C`s5t|_tdt�dtdd�dt�dtdd�dt�d	tdd
�dtdd
dd
ddddddddg	�dt�dtdd�dt�dt�dt�dtdddtdgf�d tdd!dd!d"g��}i|_|jjt�|jj|�ddgg|_dS(#NROR$ttypeR'R R!tboolR"R#tlistRtchoicestBFDtBGPsIS-IStOSPFv2tOSPFv3tPIMtRIPtRIPngRPRRRRRRLtdefaulttCommontfallbacktF5_PARTITIONRR}R~(R2tsupports_check_modeRTR	t
argument_specRwRtrequired_one_of(R(R�((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyRe�s4				$					(R)R*Re(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyR��scC`s�t�}td|jd|jd|j�}y,td|�}|j�}|j|�Wn)tk
r�}|j	dt
|��nXdS(NR�R�R�RnR�(R�RR�R�R�RmR�t	exit_jsonRt	fail_jsonRE(tspecRntmmtresultsRJ((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.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.compareRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont'ansible.module_utils.network.f5.compareRR0RKRWR]R_tobjectRbRmR�R�R)(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_routedomain.pyt<module>sJ


b:
C"C

'�$	

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