Anons79 Mini Shell

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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddlmZddlmZddlmZddlmZddlmZmZddlmZmZmZddlmZmZmZmZyddl m!Z!m"Z"Wn'e#k
rUddl$m!Z!m"Z"nXe%Z&d�Z'dd�Z)d�Z*e+dkr�e*�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiont
deprecatedtstatustnetworktsupported_bys�
---
module: junos_interface
version_added: "2.4"
author: "Ganesh Nalawade (@ganeshrn)"
short_description: Manage Interface on Juniper JUNOS network devices
description:
  - This module provides declarative management of Interfaces
    on Juniper JUNOS network devices.
deprecated:
  removed_in: "2.13"
  why: Updated modules released with more functionality
  alternative: Use M(junos_interfaces) instead.
options:
  name:
    description:
      - Name of the Interface.
    required: true
  description:
    description:
      - Description of Interface.
  enabled:
    description:
      - Configure interface link status.
    type: bool
  speed:
    description:
      - Interface link speed.
  mtu:
    description:
      - Maximum size of transmit packet.
  duplex:
    description:
      - Interface link status.
    default: auto
    choices: ['full', 'half', 'auto']
  tx_rate:
    description:
      - Transmit rate in bits per second (bps).
      - This is state check parameter only.
      - Supports conditionals, see L(Conditionals in Networking Modules,../network/user_guide/network_working_with_command_output.html)
  rx_rate:
    description:
      - Receiver rate in bits per second (bps).
      - This is state check parameter only.
      - Supports conditionals, see L(Conditionals in Networking Modules,../network/user_guide/network_working_with_command_output.html)
  neighbors:
    description:
      - Check the operational state of given interface C(name) for LLDP neighbor.
      - The following suboptions are available.
    suboptions:
        host:
          description:
            - "LLDP neighbor host for given interface C(name)."
        port:
          description:
            - "LLDP neighbor port to which given interface C(name) is connected."
  delay:
    description:
      - Time in seconds to wait before checking for the operational state on remote
        device. This wait is applicable for operational state argument which are
        I(state) with values C(up)/C(down), I(tx_rate) and I(rx_rate).
    default: 10
  aggregate:
    description: List of Interfaces definitions.
  state:
    description:
      - State of the Interface configuration, C(up) indicates present and
        operationally up and C(down) indicates present and operationally C(down)
    default: present
    choices: ['present', 'absent', 'up', 'down']
  active:
    description:
      - Specifies whether or not the configuration is active or deactivated
    default: True
    type: bool
requirements:
  - ncclient (>=v0.5.2)
notes:
  - This module requires the netconf system service be enabled on
    the remote device being managed.
  - Tested against vSRX JUNOS version 15.1X49-D15.4, vqfx-10000 JUNOS Version 15.1X53-D60.4.
  - Recommended connection is C(netconf). See L(the Junos OS Platform Options,../network/user_guide/platform_junos.html).
  - This module also works with C(local) connections for legacy playbooks.
extends_documentation_fragment: junos
s�
- name: configure interface
  junos_interface:
    name: ge-0/0/1
    description: test-interface

- name: remove interface
  junos_interface:
    name: ge-0/0/1
    state: absent

- name: make interface down
  junos_interface:
    name: ge-0/0/1
    enabled: False

- name: make interface up
  junos_interface:
    name: ge-0/0/1
    enabled: True

- name: Deactivate interface config
  junos_interface:
    name: ge-0/0/1
    state: present
    active: False

- name: Activate interface config
  net_interface:
    name: ge-0/0/1
    state: present
    active: True

- name: Configure interface speed, mtu, duplex
  junos_interface:
    name: ge-0/0/1
    state: present
    speed: 1g
    mtu: 256
    duplex: full

- name: Create interface using aggregate
  junos_interface:
    aggregate:
      - name: ge-0/0/1
        description: test-interface-1
      - name: ge-0/0/2
        description: test-interface-2
    speed: 1g
    duplex: full
    mtu: 512

- name: Delete interface using aggregate
  junos_interface:
    aggregate:
      - name: ge-0/0/1
      - name: ge-0/0/2
    state: absent

- name: Check intent arguments
  junos_interface:
    name: "{{ name }}"
    state: up
    tx_rate: ge(0)
    rx_rate: le(0)

- name: Check neighbor intent
  junos_interface:
    name: xe-0/1/1
    neighbors:
    - port: Ethernet1/0/1
      host: netdev

- name: Config + intent
  junos_interface:
    name: "{{ name }}"
    enabled: False
    state: down
s#
diff.prepared:
  description: Configuration difference before and after applying change.
  returned: when configuration is changed and diff option is enabled.
  type: str
  sample: >
        [edit interfaces]
        +   ge-0/0/1 {
        +       description test-interface;
        +   }
N(tdeepcopy(tsleep(t
AnsibleModule(texec_rpc(tremove_default_spec(tconditional(tjunos_argument_specttostring(tload_configtmap_params_to_objtmap_obj_to_ele(tcommit_configurationtdiscard_changest
locked_configt
to_param_list(tElementt
SubElementcC`s:|r6d|kodknr6|jdd�ndS(Nii�#tmsgs mtu must be between 256 and 9192(t	fail_json(tvaluetmodule((sR/usr/lib/python2.7/site-packages/ansible/modules/network/junos/_junos_interface.pytvalidate_mtu�s#cC`sb|s|j}nxI|D]A}t�jd|�}t|�r||j|�|�qqWdS(Nsvalidate_%s(tparamstglobalstgettcallable(Rtobjtparamtkeyt	validator((sR/usr/lib/python2.7/site-packages/ansible/modules/network/junos/_junos_interface.pytvalidate_param_values�s
c'C`s4tdt�dt��}tdt�dt�dtdtdd�d	t�d
tdd�dtd
dddg�dt�dt�dtddddd|�dtdddd�dtddd
ddddg�dtdtdd��}t|�}td t�|d<t|�td!tddddd|��}|j|�|jt�dd!gg}dd!gg}td"|d#|d$|d%t�}t�}itd&6}|r�||d'<nd(}	t	j
�}
|
jdidd)6td*6fdMdNdOdPd,id,d)6td-6fg�iid.d6d/d6d0d6d+6}t|�}t�}
x�|D]�}x7|D]/}|j|�d7krf|j|||<qfqfW|j�}|jd�}|jd�s�tnt|d,<|dQkr�d|d<nt||
d1|�t||
d1|�}|
jt|||	d2|d1|��qYWd7}t|���x,|
D]$}t|t|�|d3d4�}qWW|j}|r�|r�t|�n
t|�t|d&<|jr�i|d56|d6<q�nWd7QXg}d7}x|D]}|jd�}|jd�}|jd�}|jd�}|dRkrg|d7krg|d7krg|d7krgq�ntd8�}t|d9�}|jd�|_|d&r�t|jd��nt|t|�d:t�}|dSkr)|j d;�}|st!||d<jj"��r)|jd=d>|�q)n|r|j d?�}|sht!||d<jj"�d@t#�r|jdA|�qn|r�|j dB�} | s�t!|| d<jj"�d@t#�r�|jdC|�q�n|r�|d7kr|tdD�}t|dE�}|jd�|_t|t|�d:t�}g|j dF�D]}|j^q?}!g|j dG�D]}|j^qd}"nx{|D]p}#|#jd�}$|#jd�}%|$r�|$|!kr�|jdH|$�n|%r�|%|"kr�|jdI|%�q�q�Wq�q�W|r#dJ}&|j$dK|&dL|�n|j%|�d7S(Ts+ main entry point for module execution
    thosttporttnametdescriptiontenabledtdefaultttypetbooltspeedtmtutinttduplextchoicestfullthalftautottx_ratetrx_ratet	neighborstlisttelementstdicttoptionstdelayi
tstatetpresenttabsenttuptdowntactivetrequiredt	aggregatet
argument_spectrequired_one_oftmutually_exclusivetsupports_check_modetchangedtwarningssinterfaces/interfacetxpathtis_keys	link-modetdisablettag_onlysfull-duplexshalf-duplext	automaticR#t	value_maptactiontmergetpreparedtdiffNsget-interface-informationsinterface-nametignore_warnings5interface-information/physical-interface/admin-statusisstate seq(%s)sFinterface-information/physical-interface/traffic-statistics/output-bpstcaststx_rate sEinterface-information/physical-interface/traffic-statistics/input-bpssrx_rate sget-lldp-interface-neighborssinterface-devicesLlldp-neighbors-information/lldp-neighbor-information/lldp-remote-system-namesHlldp-neighbors-information/lldp-neighbor-information/lldp-remote-port-idshost sport s:One or more conditional statements have not been satisfiedRtfailed_conditions(R*R*(R/R/(R0R0(R2s	link-mode(R@RBRC(RBRC(RBRC(&R<tTrueRRtupdateRR
R:tFalsetcollectionstOrderedDictRR tNoneRtcopyR&RtappendRRRRt
check_modeRRt_diffRRttextR	RRMR
tstripR1Rt	exit_json('tneighbors_spectelement_spectaggregate_specRGRHRIRRLtresultttoptparam_to_xpath_maptchoice_to_value_mapRtrequestsR#R$titemR?twantRVtreqtcommitRYR9R7R8twant_neighborstelementt	intf_nametreplytadmin_statust
output_bpst	input_bpst	have_hostt	have_porttneighborR'R(R((sR/usr/lib/python2.7/site-packages/ansible/modules/network/junos/_junos_interface.pytmain�s�						!


		

	


)

"



	
0
$**%(
t__main__(,t
__future__RRRR-t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR]R`RttimeR	tansible.module_utils.basicR
t+ansible.module_utils.network.common.netconfRt)ansible.module_utils.network.common.utilsRR
t(ansible.module_utils.network.junos.junosRRRRRRRRRt
lxml.etreeRRtImportErrortxml.etree.ElementTreeRZtUSE_PERSISTENT_CONNECTIONRR_R&R}t__name__(((sR/usr/lib/python2.7/site-packages/ansible/modules/network/junos/_junos_interface.pyt<module>s6


XP"
	
	�

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