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

�
�Udac@`sSddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
ytdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZWn�ek
ridd
lmZddlmZddlmZddlmZddlmZddlmZddlmZnXdefd��YZdefd��YZdefd��YZdefd��YZdefd��YZ defd��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_versiontstableinterfacetstatust	certifiedtsupported_bysY
---
module: bigip_snmp
short_description: Manipulate general SNMP settings on a BIG-IP
description:
  - Manipulate general SNMP settings on a BIG-IP.
version_added: 2.4
options:
  allowed_addresses:
    description:
      - Configures the IP addresses of the SNMP clients from which the snmpd
        daemon accepts requests.
      - This value can be hostnames, IP addresses, or IP networks.
      - You may specify a single list item of C(default) to set the value back
        to the system's default of C(127.0.0.0/8).
      - You can remove all allowed addresses by either providing the word C(none), or
        by providing the empty string C("").
    type: raw
    version_added: 2.6
  contact:
    description:
      - Specifies the name of the person who administers the SNMP
        service for this system.
    type: str
  agent_status_traps:
    description:
      - When C(enabled), ensures that the system sends a trap whenever the
        SNMP agent starts running or stops running. This is usually enabled
        by default on a BIG-IP.
    type: str
    choices:
      - enabled
      - disabled
  agent_authentication_traps:
    description:
      - When C(enabled), ensures that the system sends authentication warning
        traps to the trap destinations. This is usually disabled by default on
        a BIG-IP.
    type: str
    choices:
      - enabled
      - disabled
  device_warning_traps:
    description:
      - When C(enabled), ensures that the system sends device warning traps
        to the trap destinations. This is usually enabled by default on a
        BIG-IP.
    type: str
    choices:
      - enabled
      - disabled
  location:
    description:
      - Specifies the description of this system's physical location.
    type: str
extends_documentation_fragment: f5
author:
  - Tim Rupp (@caphrim007)
  - Wojciech Wypior (@wojtek0806)
s[
- name: Set snmp contact
  bigip_snmp:
    contact: Joe User
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost

- name: Set snmp location
  bigip_snmp:
    location: US West 1
    provider:
      password: secret
      server: lb.mydomain.com
      user: admin
  delegate_to: localhost
s]
agent_status_traps:
  description: Value that the agent status traps was set to.
  returned: changed
  type: str
  sample: enabled
agent_authentication_traps:
  description: Value that the authentication status traps was set to.
  returned: changed
  type: str
  sample: enabled
device_warning_traps:
  description: Value that the warning status traps was set to.
  returned: changed
  type: str
  sample: enabled
contact:
  description: The new value for the person who administers SNMP on the device.
  returned: changed
  type: str
  sample: Joe User
location:
  description: The new value for the system's physical location.
  returned: changed
  type: str
  sample: US West 1a
allowed_addresses:
  description: The new allowed addresses for SNMP client connections.
  returned: changed
  type: list
  sample: ['127.0.0.0/8', 'foo.bar.com', '10.10.10.10']
(t
AnsibleModule(tstring_types(tF5RestClient(t
F5ModuleError(tAnsibleF5Parameters(tf5_argument_spec(ttransform_name(t
ip_network(tis_valid_hostnamet
ParameterscB`s�eZidd6dd6dd6dd6dd	6d
d6Zdddddd
gZdddddd
gZddddd	dgZRS(tagent_status_trapst	agentTraptagent_authentication_trapstauthTraptdevice_warning_trapst
bigipTrapstlocationtsysLocationtcontactt
sysContacttallowed_addressestallowedAddresses(t__name__t
__module__tapi_mapt
updatablestreturnablestapi_attributes(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyR�s0
		t
ApiParameterscB`seZed��ZRS(cC`s>|jddkrdStt|jd��}|j�|S(NR(t_valuestNonetlisttsettsort(tselftresult((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyR�s

(RRtpropertyR(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyR$�stModuleParameterscB`seZed��ZRS(cC`s(|jddkrdSg}|jd}t|t�rU|d
krIgS|g}nt|�dkr�|ddkr�dg}|Sx�|D]y}y%tdt|��|j|�Wq�tk
rt	|�r�|jt|��q�nt
d	j|���q�Xq�Wtt
|��}|j�|S(NRttnoneiitdefaults127.0.0.0/8u%ssFThe provided 'allowed_address' value {0} is not a valid IP or hostname(R.R/(sdefaultR.(R%R&t
isinstanceR	tlenRtstrtappendt
ValueErrorRRtformatR'R(R)(R*R+t	addressestaddress((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyR�s0
"	


(RRR,R(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.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((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyt	to_return�s
(RRR>(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyR9�st
UsableChangescB`seZRS((RR(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyR?�stReportableChangescB`seZRS((RR(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyR@�st
DifferencecB`s5eZdd�Zd�Zd�Zed��ZRS(cC`s||_||_dS(N(twantthave(R*RBRC((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyt__init__�s	cC`s9yt||�}|SWntk
r4|j|�SXdS(N(R:tAttributeErrort_Difference__default(R*tparamR+((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pytcompare�s

cC`sQt|j|�}y&t|j|�}||kr7|SWntk
rL|SXdS(N(R:RBRCRE(R*RGtattr1tattr2((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyt	__defaults
cC`s�|jjdkrdS|jjdkrB|jjr>|jjSdSt|jj�}t|jj�}||kr�t|�}|j�|SdS(N(RBRR&RCR(R'R)(R*RBRCR+((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyRs

N(RRR&RDRHRFR,R(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyRA�s			t
ModuleManagercB`sPeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	RS(cO`s^|jdd�|_t|jj�|_t�|_td|jj�|_	t
�|_dS(Ntmoduletparams(tgetR&RMR
RNtclientR$RCR-RBR?tchanges(R*targstkwargs((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyRD 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(NRN(RARBRCRR!tdictRHR&R1tupdateR?RQtTruetFalse(R*tdiffR!tchangedtktchange((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyt_update_changed_options's		
cC`smt�}|j�}td|jj��}|j�}|j|�|jtd|��|j|�|S(NRNRY(RTRUR@RQR>t_announce_deprecations(R*R+RYt
reportableRQ((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pytexec_module9s	

cC`sH|jdg�}x/|D]'}|jjd|dd|d�qWdS(Nt
__warningstmsgtversion(tpopRMt	deprecate(R*R+twarningstwarning((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyR]Es


cC`s|j�}|rtStS(N(R\RVRW(R*R+((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyt
should_updateMscC`s=|j�|_|j�stS|jjr/tS|j�tS(N(tread_current_from_deviceRCRgRWRMt
check_modeRVtupdate_on_device(R*((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyRUSs
cC`s�dj|jjd|jjd�}|jjj|�}y|j�}Wn%tk
rr}tt|���nXd|kr�|ddkr�d|kr�t|d��q�t|j	��nt
d|�S(Ns!https://{0}:{1}/mgmt/tm/sys/snmp/tservertserver_porttcodei�tmessageRN(R6RPtprovidertapiROtjsonR5RR3tcontentR$(R*turitresptresponsetex((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyRh\s
cC`s�|jj�}dj|jjd|jjd�}|jjj|d|�}y|j�}Wn%tk
r�}t	t
|���nXd|kr�|ddkr�d|kr�t	|d��q�t	|j��ndS(Ns!https://{0}:{1}/mgmt/tm/sys/snmp/RkRlRqRmi�Rn(RQt
api_paramsR6RPRoRptpatchRqR5RR3Rr(R*RNRsRtRuRv((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyRjns
(
RRRDR\R_R]RgRURhRj(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyRLs								tArgumentSpeccB`seZd�ZRS(cC`s�t|_ddg|_tdt�dtd|j�dtd|j�dtd|j�dt�d	td
d��}i|_|jjt�|jj|�dS(NtenabledtdisabledRRtchoicesRRRRttypetraw(RVtsupports_check_modeR|RTt
argument_specRUR
(R*R�((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyRD�s				(RRRD(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyRy�scC`s�t�}td|jd|j�}y,td|�}|j�}|j|�Wn)tk
r{}|jdt	|��nXdS(NR�RRMRa(
RyRR�RRLR_t	exit_jsonRt	fail_jsonR3(tspecRMtmmtresultsRv((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pytmain�s		t__main__N((t
__future__RRRR}t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtansible.module_utils.sixR	t%library.module_utils.network.f5.bigipR
t&library.module_utils.network.f5.commonRRR
Rt%library.module_utils.compat.ipaddressRRtImportErrort%ansible.module_utils.network.f5.bigipt&ansible.module_utils.network.f5.commont%ansible.module_utils.compat.ipaddressRR$R-R9R?R@tobjectRARLRyR�R(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/f5/bigip_snmp.pyt<module>sJ


=!
%
!%b	

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