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_vrouter_bgp_network.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_vrouter_bgp_network
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to add/remove vrouter-bgp-network
description:
  - This module can be used to add Border Gateway Protocol network to a vRouter
    and remove Border Gateway Protocol network from a vRouter.
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 add bgp network and
        C(absent) to remove bgp network.
    required: true
    type: str
    choices: ['present', 'absent']
  pn_netmask:
    description:
      - BGP network mask.
    required: false
    type: str
  pn_network:
    description:
      - IP address for BGP network.
    required: false
    type: str
  pn_vrouter_name:
    description:
      - name of service config.
    required: false
    type: str
se
- name:  Add network to bgp
  pn_vrouter_bgp_network:
    pn_cliswitch: "sw01"
    state: "present"
    pn_vrouter_name: "foo-vrouter"
    pn_network: '10.10.10.10'
    pn_netmask: '31'

- name:  Remove network from bgp
  pn_vrouter_bgp_network:
    pn_cliswitch: "sw01"
    state: "absent"
    pn_vrouter_name: "foo-vrouter"
    pn_network: '10.10.10.10'
s�
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stdout:
  description: set of responses from the vrouter-bgp-network command.
  returned: always
  type: list
stderr:
  description: set of error responses from the vrouter-bgp-network 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_commandsc
C`s�|jd}|jd}|}|d|7}t||�\}}}|rRdnd}|}|d||f7}t||�d}|j�}||dkr�tnt}	|	|fS(	s�
    This method checks for pim ssm config using the vrouter-show command.
    If a user already exists on the given switch, return True else False.
    :param module: The Ansible module to fetch input parameters
    :param cli: The CLI string
    tpn_vrouter_namet
pn_networks1 vrouter-show name %s format name no-show-headerstsS vrouter-bgp-network-show vrouter-name %s network %s format network no-show-headersii����N(tparamsRtNonetsplittTruetFalse(
tmoduletclitnametnetworktshowtrctoutterrtVROUTER_EXISTStNETWORK_EXISTS((s[/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vrouter_bgp_network.pyt	check_cli_s

cC`s'tdddd�}tdtdtdtdd	�d
tdtdd	d|j��dtdtdd	�d
tdtdd	�dtdtdd	��dd
dddd
ggd
ddd
ggf�}|jd
}|jd}|jd}|jd
}|jd}||}t||�}t||�\}	}
|
dkra|j	dtdd|�n|dkr�|	tkr�|j
dtdd|�q�n|dkr�|	tkr�|j
dtdd|�q�n|d||f7}|r�|d|7}n|r|d|7}nt|||�dS(s' This section is for arguments parsing tpresentsvrouter-bgp-network-addtabsentsvrouter-bgp-network-removet
argument_spectpn_cliswitchtrequiredttypetstrtstatetchoicest
pn_netmaskR
Rtrequired_iftfailedtmsgsvRouter %s does not existstskippedsNetwork %s already added to bgpsNetwork %s does not existss %s vrouter-name %s s	 netmask s	 network N(tdictRRRtkeysRR	RRt	fail_jsont	exit_jsonR
(t	state_mapRR&t	cliswitchtnetmaskRtvrouter_nametcommandRRR((s[/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vrouter_bgp_network.pytmainwsR	





			t__main__N(t
__future__RRRR$t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt-ansible.module_utils.network.netvisor.pn_nvosR	R
t.ansible.module_utils.network.netvisor.netvisorRRR6t__name__(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vrouter_bgp_network.pyt<module>s


(		C

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