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.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZmZdd
lmZd�Zd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: pn_vrouter_bgp
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.9"
short_description: CLI command to add/modify/remove vrouter-bgp
description:
  - This module can be used to add Border Gateway Protocol neighbor to a vRouter
    modify Border Gateway Protocol neighbor to a vRouter and remove Border Gateway Protocol
    neighbor from a vRouter.
options:
  pn_cliswitch:
    description:
      - Target switch to run the CLI on.
    required: false
    type: str
  state:
    description:
      - vrouter-bgp configuration command.
    required: false
    type: str
    choices: ['present', 'absent', 'update']
    default: 'present'
  pn_neighbor:
    description:
      - IP address for BGP neighbor.
    required: true
    type: str
  pn_vrouter_name:
    description:
      - name of service config.
    required: true
    type: str
  pn_send_community:
    description:
      - send any community attribute to neighbor.
    required: false
    type: bool
  pn_weight:
    description:
      - default weight value between 0 and 65535 for the neighbor's routes.
    required: false
  pn_multi_protocol:
    description:
      - Multi-protocol features.
    required: false
    choices: ['ipv4-unicast', 'ipv6-unicast']
  pn_prefix_list_in:
    description:
      - prefixes used for filtering.
    required: false
    type: str
  pn_route_reflector_client:
    description:
      - set as route reflector client.
    required: false
    type: bool
  pn_default_originate:
    description:
      - announce default routes to the neighbor or not.
    required: false
    type: bool
  pn_neighbor_holdtime:
    description:
      - BGP Holdtime (seconds).
    required: false
    type: str
  pn_connect_retry_interval:
    description:
      - BGP Connect retry interval (seconds).
    required: false
    type: str
  pn_advertisement_interval:
    description:
      - Minimum interval between sending BGP routing updates.
    required: false
    type: str
  pn_route_map_out:
    description:
      - route map out for nbr.
    required: false
    type: str
  pn_update_source:
    description:
      - IP address of BGP packets required for peering over loopback interface.
    required: false
    type: str
  pn_bfd:
    description:
      - BFD protocol support for fault detection.
    required: false
    type: bool
    default: False
  pn_next_hop_self:
    description:
      - BGP next hop is self or not.
    required: false
    type: bool
  pn_allowas_in:
    description:
      - Allow/reject routes with local AS in AS_PATH.
    required: false
    type: bool
  pn_neighbor_keepalive_interval:
    description:
      - BGP Keepalive interval (seconds).
    required: false
    type: str
  pn_max_prefix:
    description:
      - maximum number of prefixes.
    required: false
    type: str
  pn_bfd_multihop:
    description:
      - always use BFD multi-hop port for fault detection.
    required: false
    type: bool
  pn_interface:
    description:
      - Interface to reach the neighbor.
    required: false
    type: str
  pn_password:
    description:
      - password for MD5 BGP.
    required: false
    type: str
  pn_route_map_in:
    description:
      - route map in for nbr.
    required: false
    type: str
  pn_soft_reconfig_inbound:
    description:
      - soft reset to reconfigure inbound traffic.
    required: false
    type: bool
  pn_override_capability:
    description:
      - override capability.
    required: false
    type: bool
  pn_max_prefix_warn_only:
    description:
      - warn if the maximum number of prefixes is exceeded.
    required: false
    type: bool
  pn_ebgp_multihop:
    description:
      - value for external BGP from 1 to 255.
    required: false
    type: str
  pn_remote_as:
    description:
      - BGP remote AS from 1 to 4294967295.
    required: false
    type: str
  pn_prefix_list_out:
    description:
      - prefixes used for filtering outgoing packets.
    required: false
    type: str
  pn_no_route_map_out:
    description:
      - Remove egress route-map from BGP neighbor.
    required: false
    type: str
  pn_no_route_map_in:
    description:
      - Remove ingress route-map from BGP neighbor.
    required: false
    type: str
s

- name: "Add BGP to vRouter"
  pn_vrouter_bgp:
    state: 'present'
    pn_vrouter_name: 'sw01-vrouter'
    pn_neighbor: '105.104.104.1'
    pn_remote_as: 65000
    pn_bfd: true

- name: "Remove BGP to vRouter"
  pn_vrouter_bgp:
    state: 'absent'
    pn_vrouter_name: 'sw01-vrouter'
    pn_neighbor: '105.104.104.1'

- name: "Modify BGP to vRouter"
  pn_vrouter_bgp:
    state: 'update'
    pn_vrouter_name: 'sw01-vrouter'
    pn_neighbor: '105.104.104.1'
    pn_remote_as: 65000
    pn_bfd: false
    pn_allowas_in: true
s�
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stdout:
  description: set of responses from the vrouter-bgp command.
  returned: always
  type: list
stderr:
  description: set of error responses from the vrouter-bgp 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_clitbooleanArgs(trun_commandsc	C`sNt|�|ks$t|�|krJ|jdtdd|||f�ndS(NtfailedtmsgsValid %s range is %s to %s(tintt	fail_jsontTrue(tmodulet
param_namet	param_valtmin_valtmax_val((sS/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vrouter_bgp.pytis_valid�s$	c	C`s�|jd}|jd}|d}t||�d}|rL|j�}n||kr^tnt}|r�|d|}|d7}t||�d}|r�||j�kr�t}q�t}n||fS(s�
    This method checks if vRouter exists on the target node.
    This method also checks for idempotency using the vrouter-bgp-show command.
    If the given vRouter exists, return VROUTER_EXISTS as True else False.
    If the given neighbor exists on the given vRouter, return NEIGHBOR_EXISTS as True else False.
    :param module: The Ansible module to fetch input parameters
    :param cli: The CLI string
    :return Booleans: VROUTER_EXISTS, NEIGHBOR_EXISTS
    tpn_vrouter_nametpn_neighbors) vrouter-show format name no-show-headersis" vrouter-bgp-show vrouter-name %s sformat neighbor no-show-headers(tparamsRtsplitRtFalse(	Rtclitvrouter_nametneighbort
check_vroutertouttVROUTER_EXISTStshowtNEIGHBOR_EXISTS((sS/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vrouter_bgp.pyt	check_cli�s




		c'EC`s�	tdddddd�}tdtdtd	d
�dtdtd	d
d|j�d
d�dtdtd	d
�dtdtd	d
�dtdtd	d�dtdtd	d
�dtdtd	d
dddg�dtdtd	d
�dtdtd	d�dtdtd	d�dtdtd	d
�dtdtd	d
�dtdtd	d
�dtdtd	d
�dtdtd	d
�dtdtd	dd
t�dtdtd	d�d tdtd	d�d!tdtd	d
�d"tdtd	d
�d#tdtd	d�d$tdtd	d
�d%tdtd	d
d&t�d'tdtd	d
�d(tdtd	d�d)tdtd	d�d*tdtd	d�d+tdtd	d
�d,tdtd	d
�d-tdtd	d
�d.tdtd	d
�d/tdtd	d
�� }td0|d1ddddd,ggddddggddddggfd2dddddddddddddd d!d"d#d$d%d'd(d)d*d+d,d-d.d/gg�}|jd}|jd}|jd}|jd}|jd}|jd}|jd}	|jd}
|jd}|jd}|jd}
|jd}|jd}|jd}|jd}|jd}|jd}|jd }|jd!}|jd"}|jd#}|jd$}|jd%}|jd'}|jd(}|jd)}|jd*}|jd+}|jd,}|jd-} |jd.}!|jd/}"||}#|r�|d3kr�t|�d4ksyt|�d5kr�|jd6td7d8�q�nt||�}$t	||$�\}%}&|r�|%tkr�|j
d9td7d:|�q�n|#dks|#dkr5|&tkr5|j
d9td7d;||f�q5n|#dkrs|&tkrs|j
d9td7d<||f�qsn|$d=|#||f7}$|#dks�|#dkr_	|r�|$d>|7}$n|	r�|$d?|	7}$n|
r�|$d@|
7}$n|
rt|dA|
dBdC�|$dD|
7}$n|rAt|dE|dBdC�|$dF|7}$n|rnt|dG|dBdC�|$dH|7}$n|r�|$dI|7}$n|r�|$dJ|7}$n|r�t|dK|dBdC�|$dL|7}$n|r�|$dM|7}$n|r�|$dN|7}$n|r|$dO|7}$n|r%|$dP|7}$n|rRt|dQ|dRdS�|$dT|7}$n|ri|$dU|7}$n| r�|$dV| 7}$n|$t|dWdX�7}$|$t|dYdZ�7}$|$t|d[d\�7}$|$t|d]d^�7}$|$t|d_d`�7}$|$t|dadb�7}$|$t|dcdd�7}$|$t|dedf�7}$|$t|dgdh�7}$|$t|didj�7}$n|#dkr�	|!r�	|$dk|!7}$n|"r�	|$dl|"7}$q�	nt
||$|�dmS(ns' This section is for arguments parsing tpresentsvrouter-bgp-addtabsentsvrouter-bgp-removetupdatesvrouter-bgp-modifytpn_cliswitchtrequiredttypetstrtstatetchoicestdefaultRRtpn_send_communitytboolt	pn_weighttpn_multi_protocolsipv4-unicastsipv6-unicasttpn_prefix_list_intpn_route_reflector_clienttpn_default_originatetpn_neighbor_holdtimetpn_connect_retry_intervaltpn_advertisement_intervaltpn_route_map_outtpn_update_sourcetpn_bfdtpn_next_hop_selft
pn_allowas_intpn_neighbor_keepalive_intervalt
pn_max_prefixtpn_bfd_multihoptpn_interfacetpn_passwordtno_logtpn_route_map_intpn_soft_reconfig_inboundtpn_override_capabilitytpn_max_prefix_warn_onlytpn_ebgp_multihoptpn_remote_astpn_prefix_list_outtpn_no_route_map_outtpn_no_route_map_int
argument_spectrequired_iftrequired_one_oftnoneii��R
Rs Valid weight range is 1 to 65535tskippedsvRouter %s does not exists,BGP neighbor with IP %s does not exist on %ss,BGP neighbor with IP %s already exists on %ss  %s vrouter-name %s neighbor %s s weight s multi-protocol s prefix-list-in sneighbor holdtimet0t65535s neighbor-holdtime sconnect retry intervals connect-retry-interval sadvertisement intervals advertisement-interval s route-map-out s update-source sneighbor keepalive intervals neighbor-keepalive-interval s max-prefix s interface s
 password s route-map-in t
ebgp_multihopt1t255s ebgp-multihop s remote-as s prefix-list-out ssend-communitysno-send-communitysroute-reflector-clientsno-route-reflector-clientsdefault-originatesno-default-originatetbfdsno-bfds
next-hop-selfsno-next-hop-selfs
allowas-ins
no-allowas-insbfd-multihopsno-bfd-multihopssoft-reconfig-inboundsno-soft-reconfig-inboundsoverride-capabilitysno-override-capabilitysmax-prefix-warn-onlysno-max-prefix-warn-onlys no-route-map-out s no-route-map-in N(tdictRtkeysRRRRRR	R%t	exit_jsonRRR
('t	state_mapRNRt	cliswitchR-RRtsend_communitytweighttmulti_protocoltprefix_list_introute_reflector_clienttdefault_originatetneighbor_holdtimetconnect_retry_intervaltadvertisement_intervalt
route_map_outt
update_sourceRXt
next_hop_selft
allowas_intneighbor_keepalive_intervalt
max_prefixtbfd_multihopt	interfacetpasswordtroute_map_intsoft_reconfig_inboundtoverride_capabilitytmax_prefix_warn_onlyRUt	remote_astprefix_list_outtno_route_map_outtno_route_map_intcommandRR"R$((sS/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vrouter_bgp.pytmainsD	'!									
































$	
			t__main__N(t
__future__RRRR+t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt-ansible.module_utils.network.netvisor.pn_nvosR	R
Rt.ansible.module_utils.network.netvisor.netvisorRRR%Ryt__name__(((sS/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vrouter_bgp.pyt<module>s


�		#	�

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