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

�
�Udac@`sddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddl
mZdd
l
mZy�ddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
r�ddlmZddl mZddl mZddl mZddl mZddl mZddl mZddl mZddl!mZddl!mZddl"mZnXdefd��YZ#de#fd��YZ$de#fd��YZ%de#fd ��YZ&d!e&fd"��YZ'd#e&fd$��YZ(d%e)fd&��YZ*d'e)fd(��YZ+d)e+fd*��YZ,d+e)fd,��YZ-d-e)fd.��YZ.d/�Z/e0d0kre/�nd1S(2i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_bys�
---
module: bigip_message_routing_route
short_description: Manages static routes for routing message protocol messages
description:
  - Manages static routes for routing message protocol messages.
version_added: 2.9
options:
  name:
    description:
      - Specifies the name of the static route.
    required: True
    type: str
  description:
    description:
      - The user defined description of the static route.
    type: str
  type:
    description:
      - Parameter used to specify the type of the route to manage.
      - Default setting is C(generic) with more options added in future.
    type: str
    choices:
      - generic
    default: generic
  src_address:
    description:
      - Specifies the source address of the route.
      - Setting the attribute to an empty string will create a wildcard matching all message source-addresses, which is
        the default when creating a new route.
    type: str
  dst_address:
    description:
      - Specifies the destination address of the route.
      - Setting the attribute to an empty string will create a wildcard matching all message destination-addresses,
        which is the default when creating a new route.
    type: str
  peer_selection_mode:
    description:
      - Specifies the method to use when selecting a peer from the provided list of C(peers).
    type: str
    choices:
      - ratio
      - sequential
  peers:
    description:
      - Specifies a list of ltm messagerouting-peer objects.
      - The specified peer must be on the same partition as the route.
    type: list
  partition:
    description:
      - Device partition to create route object on.
    type: str
    default: Common
  state:
    description:
      - When C(present), ensures that the route exists.
      - When C(absent), ensures the route is removed.
    type: str
    choices:
      - present
      - absent
    default: present
notes:
  - Requires BIG-IP >= 14.0.0
extends_documentation_fragment: f5
author:
  - Wojciech Wypior (@wojtek0806)
s�
- name: Create a simple generic route
  bigip_message_routing_route:
    name: foobar
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Modify a generic route
  bigip_message_routing_route:
    name: foobar
    peers:
      - peer1
      - peer2
    peer_selection_mode: ratio
    src_address: annoying_user
    dst_address: blackhole
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Remove a generic
  bigip_message_routing_route:
    name: foobar
    state: absent
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s{
description:
  description: The user defined description of the route.
  returned: changed
  type: str
  sample: Some description
src_address:
  description: The source address of the route.
  returned: changed
  type: str
  sample: annyoing_user
dst_address:
  description: The destination address of the route.
  returned: changed
  type: str
  sample: blackhole
peer_selection_mode:
  description: The method to use when selecting a peer.
  returned: changed
  type: str
  sample: ratio
peers:
  description: The list of ltm messagerouting-peer object.
  returned: changed
  type: list
  sample: ['/Common/peer1', '/Common/peer2']
(t
AnsibleModule(tenv_fallback(tLooseVersion(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tfq_name(tflatten_boolean(ttransform_name(tf5_argument_spec(t
is_empty_list(tcmp_str_with_none(tcmp_simple_list(ttmos_versiont
ParameterscB`sbeZidd6dd6dd6ZdddddgZdddddgZdddddgZRS(tpeer_selection_modetpeerSelectionModetsrc_addresst
sourceAddresstdst_addresstdestinationAddresstdescriptiontpeers(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR�s&
		t
ApiParameterscB`seZRS((RR (((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR%�stModuleParameterscB`seZed��ZRS(cC`s^|jddkrdSt|jd�r.dSg|jdD]}t|j|�^q<}|S(NRt(t_valuestNoneRRt	partition(tselftpeertresult((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR�s,(RR tpropertyR(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.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((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyt	to_return�s
(RR R4(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR/�st
UsableChangescB`seZRS((RR (((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR5�stReportableChangescB`seZRS((RR (((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR6�st
DifferencecB`sbeZdd�Zd�Zd�Zed��Zed��Zed��Z	ed��Z
RS(cC`s||_||_dS(N(twantthave(R+R8R9((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R0tAttributeErrort_Difference__default(R+tparamR-((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R0R8R9R;(R+R=tattr1tattr2((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyt	__defaults
cC`st|jj|jj�}|S(N(RR8RR9(R+R-((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRscC`st|jj|jj�}|S(N(RR8RR9(R+R-((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRscC`st|jj|jj�}|S(N(RR8RR9(R+R-((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRscC`st|jj|jj�}|S(N(RR8RR9(R+R-((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRsN(RR R)R:R>R<R.RRRR(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR7�s			tBaseManagercB`skeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�ZRS(cO`s^|jdd�|_t|jj�|_td|jj�|_t�|_	t
�|_dS(Ntmoduletparams(tgetR)RCRRDtclientR&R8R%R9R5tchanges(R+targstkwargs((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR:"s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRD(RR#R0R8R)R5RG(R+tchangedtkey((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.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(NRD(R7R8R9RR$tdictR>R)t
isinstancetupdateR5RGtTruetFalse(R+tdiffR$RJtktchange((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyt_update_changed_options1s		
cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRFRCt	deprecate(R+R-twarningstwarning((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyt_announce_deprecationsCs


cC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRDRJ(RQRMR8tstateR^R_R6RGR4ROR](R+RJR-R`t
reportableRG((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pytexec_moduleKs	

cC`s$|j�r|j�S|j�SdS(N(texistsROtcreate(R+((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR^\s
cC`s|j�r|j�StS(N(RctremoveRQ(R+((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR_bs
cC`s|j�}|rtStS(N(RURPRQ(R+R-((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyt
should_updategscC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR9RfRQRCt
check_modeRPtupdate_on_device(R+((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyROms
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(RCRhRPtremove_from_deviceRcR(R+((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRevs
cC`s(|j�|jjrtS|j�tS(N(RLRCRhRPtcreate_on_device(R+((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRd~s


(
RR R:RLRUR]RbR^R_RfROReRd(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRB!s											tGenericModuleManagercB`s5eZd�Zd�Zd�Zd�Zd�ZRS(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/message-routing/generic/route/{2}tservertserver_porti�tcode(tformatRFtproviderRR8R*tnametapiREtjsont
ValueErrorRQRRP(R+turitresptresponse((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRc�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��ntS(NRrR*s:https://{0}:{1}/mgmt/tm/ltm/message-routing/generic/route/RmRnRtRoi�i�tmessage(i�i�(RGt
api_paramsR8RrR*RpRFRqRstpostRtRuRtstrtcontentRP(R+RDRvRwRxtex((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRk�s 
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/ltm/message-routing/generic/route/{2}RmRnRtRoi�Ry(RGRzRpRFRqRR8R*RrRstpatchRtRuRR|R}(R+RDRvRwRxR~((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRi�s

cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns=https://{0}:{1}/mgmt/tm/ltm/message-routing/generic/route/{2}RmRni�(
RpRFRqRR8R*RrRstdeleteRRPRR}(R+RvRx((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRj�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(Ns=https://{0}:{1}/mgmt/tm/ltm/message-routing/generic/route/{2}RmRnRoi�RyRD(RpRFRqRR8R*RrRsRERtRuRR|R}R%(R+RvRwRxR~((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRg�s

(RR RcRkRiRjRg(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRl�s
				t
ModuleManagercB`s,eZd�Zd�Zd�Zd�ZRS(cO`s7|jdd�|_t|jj�|_||_dS(NRC(RER)RCRRDRFRI(R+RHRI((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR:�scC`s/t|j�}t|�td�kr+tStS(Ns14.0.0(RRFR
RPRQ(R+RX((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pytversion_less_than_14�scC`sY|j�rtd��n|jjddkrC|jd�}ntd��|j�S(Ns;Message routing is not supported on TMOS version below 14.xttypetgenericsUnknown type specified.(R�RRCRDtget_managerRb(R+tmanager((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyRb�s	cC`s|dkrt|j�SdS(NR�(RlRI(R+R�((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR��s(RR R:R�RbR�(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR��s			tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdt�dt�dt�dt�dtddd	g�d
tdd�dtdd
gdd
�dtdddtdgf�dtdddddg��	}i|_|jjt�|jj|�dS(NRrtrequiredRRRRtchoicestratiot
sequentialRR�tlistR�tdefaultR*tCommontfallbacktF5_PARTITIONR`R^R_(RPtsupports_check_modeRMR	t
argument_specROR(R+R�((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR:�s,								(RR R:(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyR��scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�RCRW(
R�RR�R�R�Rbt	exit_jsonRt	fail_jsonR|(tspecRCtmmtresultsR~((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pytmains		t__main__N(1t
__future__RRRR�t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRR	tdistutils.versionR
t%library.module_utils.network.f5.bigipRt&library.module_utils.network.f5.commonRR
RRRRRt'library.module_utils.network.f5.compareRRt(library.module_utils.network.f5.icontrolRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont'ansible.module_utils.network.f5.comparet(ansible.module_utils.network.f5.icontrolRR%R&R/R5R6tobjectR7RBRlR�R�R�R(((sZ/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_message_routing_route.pyt<module>s`


F$
!*eW!	

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