�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
m Z d d
l m Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys�
---
module: pn_snmp_trap_sink
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to create/delete snmp-trap-sink
description:
- This module can be used to create a SNMP trap sink and delete a SNMP trap sink.
options:
pn_cliswitch:
description:
- Target switch to run the CLI on.
required: false
type: str
state:
description:
- State the action to perform. Use C(present) to create snmp-trap-sink and
C(absent) to delete snmp-trap-sink.
required: true
type: str
choices: ['present', 'absent']
pn_dest_host:
description:
- destination host.
type: str
pn_community:
description:
- community type.
type: str
pn_dest_port:
description:
- destination port.
type: str
default: '162'
pn_type:
description:
- trap type.
type: str
choices: ['TRAP_TYPE_V1_TRAP', 'TRAP_TYPE_V2C_TRAP', 'TRAP_TYPE_V2_INFORM']
default: 'TRAP_TYPE_V2C_TRAP'
s�
- name: snmp trap sink functionality
pn_snmp_trap_sink:
pn_cliswitch: "sw01"
state: "present"
pn_community: "foo"
pn_type: "TRAP_TYPE_V2_INFORM"
pn_dest_host: "192.168.67.8"
- name: snmp trap sink functionality
pn_snmp_trap_sink:
pn_cliswitch: "sw01"
state: "absent"
pn_community: "foo"
pn_type: "TRAP_TYPE_V2_INFORM"
pn_dest_host: "192.168.67.8"
s�
command:
description: the CLI command run on the target node.
returned: always
type: str
stdout:
description: set of responses from the snmp-trap-sink command.
returned: always
type: list
stderr:
description: set of error responses from the snmp-trap-sink command.
returned: on error
type: list
changed:
description: indicates whether the CLI caused changes on the target.
returned: always
type: bool
( t
AnsibleModule( t pn_clit run_cli( t run_commandsc C` s� | j d } | j d } | } | d 7} t | | � \ } } } | rW | j � } n | | k r� | } | d | 7} t | | � \ } } } | r� | j � } n | | k r� t St Sd Sd S( s�
This method checks for idempotency using the snmp-trap-sink-show command.
If a trap with given name exists, return True else False.
:param module: The Ansible module to fetch input parameters
:param cli: The CLI string
t pn_communityt pn_dest_hosts<