Anons79 Mini Shell

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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZmZdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bysQ
---
module: onyx_wjh
version_added: "2.9"
author: "Anas Shami (@anass)"
short_description: Configure what-just-happend module
description:
  - This module provides declarative management of wjh
    on Mellanox ONYX network devices.
notes:
options:
    group:
        description:
         - Name of wjh group.
        choices: ['all', 'forwarding', 'acl']
        type: str
    enabled:
        description:
          - wjh group status
        type: bool
    auto_export:
        description:
          - wjh group auto export pcap file status
        type: bool
    export_group:
        description:
          - wjh group auto export group
        choices: ['all', 'forwarding', 'acl']
        type: str
    clear_group:
        description:
          - clear pcap file by group
        choices: ['all', 'user', 'auto-export']
        type: str
s�
- name: enable wjh
  onyx_wjh:
      group: forwarding
      enabled: True

- name: disable wjh
  onyx_wjh:
      group: forwarding
      enabled: False

- name: enable auto-export
  onyx_wjh:
        auto_export: True
        export_group: forwarding
- name: disable auto-export
  onyx_wjh:
        auto_export: False
        export_group: forwarding
- name: clear pcap file
  onyx_wjh:
        clear_group: auto-export
s
commands:
  description: The list of configuration mode commands to send to the device.
  returned: always
  type: list
  sample:
    - what-just-happend forwarding enable
    - what-just-happend auto-export forwarding enable
    - clear what-just-happend pcap-file user
N(t
AnsibleModule(tBaseOnyxModuletshow_cmdt
OnyxWJHModulecB`s�eZejd�Zejd�ZdZdZdZdddgZ	ddd	gZ
d
�Zd�Zd�Z
d
�Zd�Zdd�Zd�ZRS(s(^no what-just-happened ([a-z]+) enable.*s4^no what-just-happened auto-export ([a-z]+) enable.*s {0}what-just-happened {1} enables,{0}what-just-happened auto-export {1} enables'clear what-just-happened pcap-files {0}tallt
forwardingtacltusersauto-exportc
C`s�tdtd|j�dtdd�dtdd�dtd|j�dtd|j��}t�}|j|�td	|d
tdddgddgg�|_dS(
s'
        module initialization
        tgrouptchoicestenabledttypetbooltauto_exporttexport_grouptclear_groupt
argument_spectsupports_check_modetrequired_togetherN(tdictt
WJH_GROUPStCLEAR_GROUPStupdateRtTruet_module(tselftelement_specR((sI/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_wjh.pytinit_moduleds	
	cC`s�t�|_|jj}|jd�}|jd�}|jd�}t�}|r�|jd�}|ji|d6|d6�n|r�|jd�}|ji|d6|d6�n|r�|ji|d6�n|j|�||_dS(NRRRRR(Rt_required_configR tparamstgetRtvalidate_param_values(R!t
module_paramsRRRR%RR((sI/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_wjh.pytget_required_configxs*				
cC`st|jddtdt�S(Ns4show running-config | include .*what-just-happened.*tjson_fmtt
fail_on_error(R
R tFalse(R!((sI/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_wjh.pyt_get_wjh_config�scC`s�|s
dS|j}|jd�}x�|D]�}|jd�rDq)n|jj|�}|rx|jd�}t||<n|jj|�}|r)|jd�d}t||<q)q)WdS(Ns
t#it_export(t_current_configtsplitt
startswithtWJH_DISABLED_REGXtmatchRR,tWJH_DISABLED_AUTO_EXPORT_REGX(R!tconfigtcurrent_configtlinestlineR4RR((sI/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_wjh.pyt_set_current_config�s	

cC`s2t�|_|j�}|r.|j|�ndS(N(RR0R-R:(R!tconfig_lines((sI/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_wjh.pytload_current_config�stcC`sjt}|dkrBtg|jD]}|||k^q�}n$|||kr`|||nt}|S(NR(R,RRR(R!R7tgroup_valuetsuffixtcurrent_enabledR((sI/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_wjh.pytwjh_group_status�s-$cC`s*|j|j}}|jd�}|jd�}|jd�}|r�|j||�}|d|kr�|jj|jj|dr�dnd|��q�n|r|j||dd�}|d|kr|jj|jj|dr�dnd|��qn|r&|jj|j	j|��ndS(	NRRRRR=sno R/R(
R0R$R&RAt	_commandstappendtWJH_CMD_FMTtformattWJH_EXPORT_CMD_FMTtWJH_CLEAR_CMD_FMT(R!R7trequired_configRRRR@((sI/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_wjh.pytgenerate_commands�s ##(t__name__t
__module__tretcompileR3R5RDRFRGRRR#R)R-R:R<RARI(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_wjh.pyRYs					cC`stj�dS(s+ main entry point for module execution
    N(Rtmain(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_wjh.pyRN�st__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRLtansible.module_utils.basicRt&ansible.module_utils.network.onyx.onyxR	R
RRNRJ(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_wjh.pyt<module>s


$�	

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