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_log_publisher.pyo

�
�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_log_publisher
short_description: Manages log publishers on a BIG-IP
description:
  - Manages log publishers on a BIG-IP.
version_added: 2.6
options:
  name:
    description:
      - Specifies the name of the log publisher.
    type: str
    required: True
  description:
    description:
      - Specifies a description for the log publisher.
    type: str
  destinations:
    description:
      - Specifies log destinations for this log publisher to use.
    type: list
  partition:
    description:
      - Device partition to manage resources on.
    type: str
    default: Common
  state:
    description:
      - When C(present), ensures that the resource exists.
      - When C(absent), ensures the resource is removed.
    type: str
    choices:
      - present
      - absent
    default: present
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s/
- name: Create a log publisher for use in high speed loggins
  bigip_log_publisher:
    name: publisher1
    destinations:
      - hsl1
      - security-log-servers-logging
    state: present
    provider:
      user: admin
      password: secret
      server: lb.mydomain.com
  delegate_to: localhost
s-
description:
  description: The new description of the resource.
  returned: changed
  type: str
  sample: "Security log publisher"
destinations:
  description: The new list of destinations for the resource.
  returned: changed
  type: list
  sample: ['/Common/destination1', '/Common/destination2']
(t
AnsibleModule(tenv_fallback(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(ttransform_name(tfq_name(tf5_argument_spec(tcmp_simple_listt
ParameterscB`s2eZiZddgZddgZddgZRS(tdestinationstdescription(t__name__t
__module__tapi_maptapi_attributestreturnablest
updatables(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRis		t
ApiParameterscB`seZed��ZRS(cC`sg|jddkrdSg}x9|jdD]*}t|d|d�}|j|�q+W|j�|S(NRt	partitiontname(t_valuestNoneRtappendtsort(tselftresultstdestinationtresult((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRs
(RRtpropertyR(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR~stModuleParameterscB`seZed��ZRS(cC`s�|jddkrdSt|jd�dkrK|jdddkrKdSg|jdD]}t|j|�^qY}tt|��}|j�|S(NRiit(RRtlenRRtlisttsetR (R!txR$((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR�s0,
(RRR%R(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR&�stChangescB`seZd�ZRS(cC`sXi}y:x$|jD]}t||�||<qW|j|�}Wntk
rSnX|S(N(Rtgetattrt_filter_paramst	Exception(R!R$t
returnable((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyt	to_return�s
(RRR1(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR,�st
UsableChangescB`seZRS((RR(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR2�stReportableChangescB`seZRS((RR(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR3�st
DifferencecB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(twantthave(R!R5R6((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R-tAttributeErrort_Difference__default(R!tparamR$((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R-R5R6R8(R!R:tattr1tattr2((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyt	__default�s
cC`st|jj|jj�}|S(N(RR5RR6(R!R$((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR�sN(RRRR7R;R9R%R(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR4�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(tgetRR@R
RAtclientR&R5RR6R2tchanges(R!targstkwargs((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR7�s
cC`sji}xBtjD]7}t|j|�dk	rt|j|�||<qqW|rftd|�|_ndS(NRA(RRR-R5RR2RD(R!tchangedtkey((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.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(NRA(R4R5R6RRtdictR;Rt
isinstancetupdateR2RDtTruetFalse(R!tdiffRRGtktchange((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyt_update_changed_options�s		
cC`s|j�}|rtStS(N(RRRMRN(R!R$((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyt
should_update�scC`s�t}t�}|jj}|dkr6|j�}n|dkrQ|j�}ntd|jj��}|j�}|j	|�|j	td|��|j
|�|S(NtpresenttabsentRARG(RNRJR5tstateRTRUR3RDR1RLt_announce_deprecations(R!RGR$RVt
reportableRD((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pytexec_module�s	

cC`sK|jdg�}x2|D]*}|jjjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRCR@t	deprecate(R!R$twarningstwarning((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRWs


cC`s$|j�r|j�S|j�SdS(N(texistsRLtcreate(R!((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRTs
cC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceR6RSRNR@t
check_modeRMtupdate_on_device(R!((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRLs
cC`s9|jjrtS|j�|j�r5td��ntS(NsFailed to delete the resource.(R@RdRMtremove_from_deviceRaR(R!((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pytremoves
cC`s(|j�|jjrtS|j�tS(N(RIR@RdRMtcreate_on_device(R!((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRbs


cC`s|j�r|j�StS(N(RaRgRN(R!((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRU&s
cC`s�dj|jjd|jjdt|jj|jj��}|jjj|�}y|j	�}Wnt
k
rwtSX|jdks�d|kr�|ddkr�tSt
S(Ns4https://{0}:{1}/mgmt/tm/sys/log-config/publisher/{2}tservertserver_porti�tcode(tformatRCtproviderR
R5RRtapiRBtjsont
ValueErrorRNRRM(R!turitresptresponse((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRa+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(Ns4https://{0}:{1}/mgmt/tm/sys/log-config/publisher/{2}RiRjRoRki�tmessage(RDt
api_paramsRlRCRmR
R5RRRntpatchRoRpRtstrtcontent(R!RARqRrRstex((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRe: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(Ns4https://{0}:{1}/mgmt/tm/sys/log-config/publisher/{2}RiRjRki�RtRA(RlRCRmR
R5RRRnRBRoRpRRwRxR(R!RqRrRsRy((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRcMs

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|dS(
NRRs1https://{0}:{1}/mgmt/tm/sys/log-config/publisher/RiRjRoRki�i�RttselfLink(i�i�(RDRuR5RRRlRCRmRntpostRoRpRRwRx(R!RARqRrRsRy((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRhbs 
cC`sydj|jjd|jjdt|jj|jj��}|jjj|�}|j	dkrft
St|j��dS(Ns4https://{0}:{1}/mgmt/tm/sys/log-config/publisher/{2}RiRji�(
RlRCRmR
R5RRRntdeleteRRMRRx(R!RqRs((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyRfws

(RRR7RIRRRSRYRWRTRLRgRbRURaReRcRhRf(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR?�s 																tArgumentSpeccB`seZd�ZRS(cC`s�t|_tdtdt�dt�dtdd�dtdd	d
d	dg�dtdd
dtdgf��}i|_|jjt�|jj|�dS(NRtrequiredRRttypeR)RVtdefaultRTtchoicesRURtCommontfallbacktF5_PARTITION(RMtsupports_check_modeRJR	t
argument_specRLR(R!R�((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR7�s			(RRR7(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyR}�scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�R�R@R[(
R}RR�R�R?RYt	exit_jsonRt	fail_jsonRw(tspecR@tmmR"Ry((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pytmain�s		t__main__N('t
__future__RRRRt
__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.compareRRR&R,R2R3tobjectR4R?R}R�R(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_log_publisher.pyt<module>sJ


)



�	

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