Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/netvisor/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_admin_syslog.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZdd
lmZd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys)
---
module: pn_admin_syslog
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to create/modify/delete admin-syslog
description:
  - This module can be used to create the scope and other parameters of syslog event collection.
  - This module can be used to modify parameters of syslog event collection.
  - This module can be used to delete the scope and other parameters of syslog event collection.
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 admin-syslog and
        C(absent) to delete admin-syslog C(update) to modify the admin-syslog.
    required: True
    type: str
    choices: ['present', 'absent', 'update']
  pn_scope:
    description:
      - Scope of the system log.
    required: False
    type: str
    choices: ['local', 'fabric']
  pn_host:
    description:
      - Hostname to log system events.
    required: False
    type: str
  pn_port:
    description:
      - Host port.
    required: False
    type: str
  pn_transport:
    description:
      - Transport for log events - tcp/tls or udp.
    required: False
    type: str
    choices: ['tcp-tls', 'udp']
    default: 'udp'
  pn_message_format:
    description:
      - message-format for log events - structured or legacy.
    required: False
    choices: ['structured', 'legacy']
    type: str
  pn_name:
    description:
      - name of the system log.
    required: False
    type: str
s�
- name: admin-syslog functionality
  pn_admin_syslog:
    pn_cliswitch: "sw01"
    state: "absent"
    pn_name: "foo"
    pn_scope: "local"

- name: admin-syslog functionality
  pn_admin_syslog:
    pn_cliswitch: "sw01"
    state: "present"
    pn_name: "foo"
    pn_scope: "local"
    pn_host: "166.68.224.46"
    pn_message_format: "structured"

- name: admin-syslog functionality
  pn_admin_syslog:
    pn_cliswitch: "sw01"
    state: "update"
    pn_name: "foo"
    pn_host: "166.68.224.10"
s�
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stdout:
  description: set of responses from the admin-syslog command.
  returned: always
  type: list
stderr:
  description: set of error responses from the admin-syslog command.
  returned: on error
  type: list
changed:
  description: indicates whether the CLI caused changes on the target.
  returned: always
  type: bool
(t
AnsibleModule(tpn_clitrun_cli(trun_commandscC`sJ|jd}|d7}t||�d}|j�}||krFtStS(s�
    This method checks for idempotency using the admin-syslog-show command.
    If a user with given name exists, return as True else False.
    :param module: The Ansible module to fetch input parameters
    :param cli: The CLI string
    tpn_names. admin-syslog-show format name no-show-headersi(tparamsRtsplittTruetFalse(tmoduletclitnametout((sT/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_admin_syslog.pyt	check_clizs


c
C`sMtdddddd�}tdtdtd	td
d�dtd	td
dd
|j��dtd	td
dd
ddg�dtd	td
d�dtd	td
d�dtd	td
dd
ddgdd�dtd	td
dd
ddg�dtd	td
d��ddddddggdddggdddggfddddddgg�}|jd}|jd}|jd}|jd}|jd}|jd}|jd}|jd}	||}
t||�}t||�}|d|
|	f7}|
dkr8|tkr8|jdtdd |	�q8n|
dkrp|tkrp|j	d!tdd |	�qpn|
dkr�|tkr�|j	d!tdd"|	�q�n|
dkr�|r�|d#|7}q�n|
dkr9|r�|d$|7}n|r|d%|7}n|r|d&|7}n|r9|d'|7}q9nt
|||�d(S()s' This section is for arguments parsing tpresentsadmin-syslog-createtabsentsadmin-syslog-deletetupdatesadmin-syslog-modifyt
argument_spectpn_cliswitchtrequiredttypetstrtstatetchoicestpn_scopetlocaltfabrictpn_hosttpn_porttpn_transportstcp-tlstudptdefaulttpn_message_formatt
structuredtlegacyRtrequired_iftrequired_one_ofs %s name %s tfailedtmsgs(admin syslog with name %s does not existtskippeds-admin syslog user with name %s already existss scope s host s port s transport s message-format N(tdictRRRtkeysR
R	Rt	fail_jsont	exit_jsonR
(
t	state_mapRt	cliswitchRtscopethosttportt	transporttmessage_formatRtcommandRt
SYSLOG_EXISTS((sT/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_admin_syslog.pytmain�s~	








			t__main__N(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt-ansible.module_utils.network.netvisor.pn_nvosR	R
t.ansible.module_utils.network.netvisor.netvisorRRR=t__name__(((sT/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_admin_syslog.pyt<module>s


<		Y

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