Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/nxos/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_snmp_traps.pyc

�
�Udac@s�idd6dgd6dd6ZdZdZdZd	d
lmZmZd	dlmZmZd	dlm	Z	d	d
l
mZd�Zd�Z
d�Zd�Zd�Zd�Zedkr�e�ndS(s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bysc
---
module: nxos_snmp_traps
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Manages SNMP traps.
description:
    - Manages SNMP traps configurations.
author:
    - Jason Edelman (@jedelman8)
notes:
    - Tested against NXOSv 7.3.(0)D1(1) on VIRL
    - This module works at the group level for traps.  If you need to only
      enable/disable 1 specific trap within a group, use the M(nxos_command)
      module.
    - Be aware that you can set a trap only for an enabled feature.
options:
    group:
        description:
            - Case sensitive group.
        required: true
        choices: ['aaa', 'bfd', 'bgp', 'bridge', 'callhome', 'cfs', 'config',
          'eigrp', 'entity', 'feature-control', 'generic', 'hsrp', 'license',
          'link', 'lldp', 'mmode', 'ospf', 'pim', 'rf', 'rmon', 'snmp',
          'storm-control', 'stpx', 'switchfabric', 'syslog', 'sysmgr', 'system',
          'upgrade', 'vtp', 'all']
    state:
        description:
            - Manage the state of the resource.
        required: false
        default: enabled
        choices: ['enabled','disabled']
s�
# ensure lldp trap configured
- nxos_snmp_traps:
    group: lldp
    state: enabled

# ensure lldp trap is not configured
- nxos_snmp_traps:
    group: lldp
    state: disabled
s�
commands:
    description: command sent to the device
    returned: always
    type: list
    sample: "snmp-server enable traps lldp ;"
i����(tload_configtrun_commands(tnxos_argument_spect
check_args(tget_capabilities(t
AnsibleModulecCs(t|�jdi�}|jdd�S(Ntdevice_infotnetwork_os_platformt(R	tget(tmoduletinfo((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_snmp_traps.pytget_platform_idUscCs!i|d6dd6}t||�S(Ntcommandttexttoutput(R(RR((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_snmp_traps.pytexecute_show_commandZs
cCsGg}x:|D]2}t|t�r2|j|�q
|j|�q
W|S(N(t
isinstancetlisttextendtappend(t
command_liststflat_command_listR((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_snmp_traps.pytflatten_listcs
c	Cs�td|�djd�}i}dddddd	d
ddd
ddddddddddddddddddd g}d!|kr�d"t|�kr�|jd#�|jd�nx�|D]|}xs|D]k}|dkr�d$|kr9t||<Pq9q�d%j|�|kr�d&|kr,t||<Pq9t||<q�q�Wq�Wx[|D]S}|j|�dkrHtd'|�d}d(j|�|kr�t||<q�qHqHW|j|d�}|d!j
�kr�|S|dk	r�i||6}|SiSdS()Nsshow run snmp allis
taaatbfdtbgptbridgetcallhometcfstconfigteigrptentitysfeature-controltgenericthsrptlicensetlinktlldptmmodetospftpimtrftrmontsnmps
storm-controltstpxtswitchfabrictsyslogtsysmgrtsystemtupgradetvtptallsN3K-C35sIPlatform does not support bfd traps; bfd ignored for 'group: all' requestssnmp-server enable traps ospfsenable traps {0}sno sshow run | inc featuresfeature {0}(RtsplitRtwarntremovetTruetformattFalseRtNonetlower(	tgroupRtbodytresourcetfeature_listteachtlinetfindt
trap_resource((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_snmp_traps.pytget_snmp_trapsmsD	






c	CsZg}t}t}|dkr�|dkrgx�|D]/}||r1dj|�}|j|�q1q1WqV|dkrVx@|D]5}||tkrzdj|�}|j|�qzqzWqVn�||kr=||r�t}nt}|dkr|r|jdj|�g�qV|dkrV|rV|jdj|�g�qVn|jddj|��|S(NR8tdisabledsno snmp-server enable traps {0}tenabledssnmp-server enable traps {0}tmsgs'{0} is not a currently enabled feature.(R>R=RR<t	fail_json(	RAtstatetexistingRtcommandsRKRJtfeaturettrap_command((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_snmp_traps.pytget_trap_commands�s2



	
c	$Cs�tdtdddgdd�dtdddd	d
ddd
ddddddddddddddddddd d!d"d#d$gd%t��}|jt�td&|d't�}t�}t||�itd(6gd)6|d*6}|jdj	�}|jd}t
||�}t||||�}t|�}|r�t|d(<|j
s_t||�nd+|kr{|jd,�n||d)<n|j|�dS(-NRNtchoicesRKRJtdefaultRARRRR R!R"R#R$R%sfeature-controlR&R'R(R)R*R+R,R-R.R/R0s
storm-controlR1R2R3R4R5R6R7R8trequiredt
argument_spectsupports_check_modetchangedRPtwarningst	configurei(tdictR<tupdateRR
RRR>tparamsR@RIRSRt
check_modeRtpopt	exit_json(	RWRRZtresultsRARNRORPtcmds((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_snmp_traps.pytmain�s6
	


	
t__main__N(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNt&ansible.module_utils.network.nxos.nxosRRRRR	tansible.module_utils.basicR
RRRRIRSRdt__name__(((sP/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_snmp_traps.pyt<module>s"


#				
	3	$	'

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