pynos.versions.ver_7.ver_7_0_0 package

Submodules

pynos.versions.ver_7.ver_7_0_0.bgp module

Copyright 2015 Brocade Communications Systems, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class pynos.versions.ver_7.ver_7_0_0.bgp.BGP(callback)[source]

Bases: pynos.versions.ver_6.ver_6_0_1.bgp.BGP

Holds all relevent methods and attributes for the BGP on NOS devices.

None
af_ip_allowas_in(**kwargs)[source]

Set BGP allowas-in for IPV4 and IPV6

Parameters:
  • vrf (str) – The VRF for this BGP process.
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • allowas_in (str) – Values for allowas_in (default: 5).
  • afi (str) – Address family to configure. (ipv4, ipv6)
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.l

Raises:

AttributeError: When afi is not one of [‘ipv4’, ‘ipv6’]

Examples

>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.bgp.local_asn(local_as='65535',
...     rbridge_id='225')
...     output = dev.bgp.neighbor(ip_addr='10.10.10.10',
...     remote_as='65535', rbridge_id='225')
...     output = dev.bgp.af_ip_allowas_in(rbridge_id='225',
...     ip_addr='10.10.10.10')
...     output = dev.bgp.af_ip_allowas_in(rbridge_id='225',
...     ip_addr='10.10.10.10', get=True)
...     output = dev.bgp.af_ip_allowas_in(rbridge_id='225',
...     ip_addr='10.10.10.10', delete=True)
...     output = dev.bgp.neighbor(remote_as='65535',
...     rbridge_id='225',
...     ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1')
...     output = dev.bgp.af_ip_allowas_in(rbridge_id='225',
...     ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1', afi='ipv6')
...     output = dev.bgp.af_ip_allowas_in(rbridge_id='225',
...     ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1', get=True,
...     afi='ipv6')
...     output = dev.bgp.af_ip_allowas_in(rbridge_id='225',
...     ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1', delete=True,
...     afi='ipv6')
bfd(**kwargs)[source]

Configure BFD for BGP globally.

Parameters:
  • rbridge_id (str) – Rbridge to configure. (1, 225, etc)
  • tx (str) – BFD transmit interval in milliseconds (300, 500, etc)
  • rx (str) – BFD receive interval in milliseconds (300, 500, etc)
  • multiplier (str) – BFD multiplier. (3, 7, 5, etc)
  • delete (bool) – True if BFD configuration should be deleted. Default value will be False if not specified.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

KeyError – if tx, rx, or multiplier is not passed.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.230']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...    conn = (switch, '22')
...    with pynos.device.Device(conn=conn, auth=auth) as dev:
...        output = dev.bgp.bfd(rx='300', tx='300', multiplier='3',
...        rbridge_id='230')
...        output = dev.bgp.bfd(rx='300', tx='300', multiplier='3',
...        rbridge_id='230', get=True)
...        output = dev.bgp.bfd(rx='300', tx='300', multiplier='3',
...        rbridge_id='230', delete=True)
default_vrf_max_paths(**kwargs)[source]

Set BGP max paths property on default VRF address family.

Parameters:
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • paths (str) – Number of paths for BGP ECMP (default: 8).
  • afi (str) – Address family to configure. (ipv4, ipv6)
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

AttributeError: When afi is not one of [‘ipv4’, ‘ipv6’]

Examples

>>> import pynos.device
>>> conn = ('10.24.39.211', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.bgp.default_vrf_max_paths(paths='8',
...     rbridge_id='225')
...     output = dev.bgp.default_vrf_max_paths(
...     rbridge_id='225', get=True)
...     output = dev.bgp.default_vrf_max_paths(paths='8',
...     rbridge_id='225', delete=True)
...     output = dev.bgp.default_vrf_max_paths(paths='8',
...              afi='ipv6', rbridge_id='225')
...     output = dev.bgp.default_vrf_max_paths(
...              afi='ipv6', rbridge_id='225', get=True)
...     output = dev.bgp.default_vrf_max_paths(paths='8',
...              afi='ipv6', rbridge_id='225', delete=True)
...     output = dev.bgp.default_vrf_max_paths(paths='8',
...              afi='ipv5', rbridge_id='225')
Traceback (most recent call last):
AttributeError
default_vrf_redistribute_connected(**kwargs)[source]

Enable redistribute connected on default vrf address family.

Parameters:
  • afi (str) – Address family to configure. (ipv4, ipv6)
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • delete (bool) – Deletes the redistribute connected under default vrf if delete is True.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if `afi’ is not expected
  • AttributeError – if ‘afi’ is not in ipv4,ipv6. Default = ipv4

Examples

>>> import pynos.device
>>> conn = ('10.24.39.211', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     device.bgp.default.vrf_redistribute_connected(
...     rbridge_id='4')
...     device.bgp.default.vrf_redistribute_connected(
...     get=True, rbridge_id='4')
...     device.bgp.default.vrf_redistribute_connected(
...     delete=True, rbridge_id='4')
default_vrf_unicast_address_family(**kwargs)[source]

Create default address family (ipv4/ipv6) under router bgp.

Parameters:
  • afi (str) – Address family to configure. (ipv4, ipv6)
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • delete (bool) – Deletes the redistribute connected under default vrf if delete is True.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if `afi’ is not expected
  • AttributeError – if ‘afi’ is not in ipv4,ipv6.

Examples

>>> import pynos.device
>>> conn = ('10.24.39.211', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     device.bgp.default_vrf_unicast_address_family(delete=True,
...     rbridge_id='4')
...     device.bgp.default_vrf_unicast_address_family(get=True,
...     rbridge_id='4')
...     device.bgp.default_vrf_unicast_address_family(
...     rbridge_id='4', afi='ipv6')
enable_peer_bfd(**kwargs)[source]

BFD enable for each specified peer.

Parameters:
  • rbridge_id (str) – Rbridge to configure. (1, 225, etc)
  • peer_ip (str) – Peer IPv4 address for BFD setting.
  • delete (bool) – True if BFD configuration should be deleted. Default value will be False if not specified.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

XML to be passed to the switch.

Raises:

None

Examples

>>> import pynos.device
>>> switches = ['10.24.39.230']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...    conn = (switch, '22')
...    with pynos.device.Device(conn=conn, auth=auth) as dev:
...        output = dev.bgp.neighbor(ip_addr='10.10.10.20',
...        remote_as='65535', rbridge_id='230')
...        output = dev.bgp.enable_peer_bfd(peer_ip='10.10.10.20',
...        rbridge_id='230')
...        output = dev.bgp.enable_peer_bfd(peer_ip='10.10.10.20',
...        rbridge_id='230',get=True)
...        output = dev.bgp.enable_peer_bfd(peer_ip='10.10.10.20',
...        rbridge_id='230', delete=True)
...        output = dev.bgp.neighbor(ip_addr='10.10.10.20',
...        delete=True, rbridge_id='230', remote_as='65535')
evpn_afi(**kwargs)[source]

EVPN AFI. This method just enables/disables or gets the EVPN AFI.

Parameters:
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • delete (bool) – Deletes the neighbor if delete is True.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

None

Examples

>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.bgp.local_asn(local_as='65535',
...     rbridge_id='225')
...     output = dev.bgp.evpn_afi(rbridge_id='225')
...     output = dev.bgp.evpn_afi(rbridge_id='225', get=True)
...     output = dev.bgp.evpn_afi(rbridge_id='225',
...     delete=True)
evpn_afi_peer_activate(**kwargs)[source]

Activate EVPN AFI for a peer.

Parameters:
  • ip_addr (str) – IP Address of BGP neighbor.
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • delete (bool) – Deletes the neighbor if delete is True. Deactivate
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

None

Examples

>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.bgp.local_asn(local_as='65535',
...     rbridge_id='225')
...     output = dev.bgp.evpn_afi(rbridge_id='225')
...     output = dev.bgp.neighbor(ip_addr='10.10.10.11',
...     remote_as='65535', rbridge_id='225')
...     output = dev.bgp.evpn_afi_peer_activate(rbridge_id='225',
...     peer_ip='10.10.10.11')
...     output = dev.bgp.evpn_afi_peer_activate(rbridge_id='225',
...     peer_ip='10.10.10.11', get=True)
...     output = dev.bgp.evpn_afi_peer_activate(rbridge_id='225',
...     peer_ip='10.10.10.11', delete=True)
...     output = dev.bgp.evpn_afi(rbridge_id='225',
...     delete=True)
...     output = dev.bgp.remove_bgp(rbridge_id='225')
evpn_allowas_in(**kwargs)[source]

Configure allowas_in for an EVPN neighbor.

You probably don’t want this method. You probably want to configure an EVPN neighbor using BGP.neighbor. That will configure next-hop unchanged automatically.

Parameters:
  • ip_addr (str) – IP Address of BGP neighbor.
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • delete (bool) – Deletes the neighbor if delete is True.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

None

Examples

>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.bgp.local_asn(local_as='65535',
...     rbridge_id='225')
...     output = dev.bgp.neighbor(ip_addr='10.10.10.10',
...     remote_as='65535', rbridge_id='225')
...     output = dev.bgp.evpn_allowas_in(rbridge_id='225',
...     ip_addr='10.10.10.10')
...     output = dev.bgp.evpn_allowas_in(rbridge_id='225',
...     ip_addr='10.10.10.10', get=True)
...     output = dev.bgp.evpn_allowas_in(rbridge_id='225',
...     ip_addr='10.10.10.10', delete=True)
evpn_next_hop_unchanged(**kwargs)[source]

Configure next hop unchanged for an EVPN neighbor.

You probably don’t want this method. You probably want to configure an EVPN neighbor using BGP.neighbor. That will configure next-hop unchanged automatically.

Parameters:
  • ip_addr (str) – IP Address of BGP neighbor.
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • delete (bool) – Deletes the neighbor if delete is True.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

None

Examples

>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.bgp.local_asn(local_as='65535',
...     rbridge_id='225')
...     output = dev.bgp.neighbor(ip_addr='10.10.10.10',
...     remote_as='65535', rbridge_id='225')
...     output = dev.bgp.evpn_next_hop_unchanged(rbridge_id='225',
...     ip_addr='10.10.10.10')
...     output = dev.bgp.evpn_next_hop_unchanged(rbridge_id='225',
...     ip_addr='10.10.10.10', get=True)
...     output = dev.bgp.evpn_next_hop_unchanged(rbridge_id='225',
...     ip_addr='10.10.10.10', delete=True)
graceful_restart(**kwargs)[source]

Set BGP graceful restart

Parameters:
  • vrf (str) – The VRF for this BGP process.
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • afi (str) – Address family to configure. (ipv4, ipv6, evpn)
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:
  • AttributeError: When afi is not one of [‘ipv4’, ‘ipv6’,
  • evpn]

Examples

>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.bgp.local_asn(local_as='65535',
...     rbridge_id='225')
...     output = dev.bgp.graceful_restart(rbridge_id='225')
...     output = dev.bgp.graceful_restart(rbridge_id='225',
...     get=True)
...     output = dev.bgp.graceful_restart(rbridge_id='225',
...     delete=True)
...     output = dev.bgp.graceful_restart(rbridge_id='225',
...     afi='ipv6')
...     output = dev.bgp.graceful_restart(rbridge_id='225',
...     afi='ipv6', get=True)
...     output = dev.bgp.graceful_restart(rbridge_id='225',
...     afi='ipv6', delete=True)
neighbor(**kwargs)[source]

Experimental neighbor method.

Parameters:
  • ip_addr (str) – IP Address of BGP neighbor.
  • remote_as (str) – Remote ASN of BGP neighbor.
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • afis (list) – A list of AFIs to configure. Do not include IPv4 or IPv6 unicast as these are inferred from the ip_addr parameter.
  • delete (bool) – Deletes the neighbor if delete is True.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

KeyError – if remote_as or ip_addr is not specified.

Examples

>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.bgp.local_asn(local_as='65535',
...     rbridge_id='225')
...     output = dev.bgp.neighbor(ip_addr='10.10.10.10',
...     remote_as='65535', rbridge_id='225')
...     output = dev.bgp.neighbor(remote_as='65535',
...     rbridge_id='225',
...     ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1')
...     output = dev.bgp.neighbor(ip_addr='10.10.10.10',
...     delete=True, rbridge_id='225', remote_as='65535')
...     output = dev.bgp.neighbor(remote_as='65535',
...     rbridge_id='225', delete=True,
...     ip_addr='2001:4818:f000:1ab:cafe:beef:1000:1')
peer_bfd_timers(**kwargs)[source]

Configure BFD for BGP globally.

Parameters:
  • rbridge_id (str) – Rbridge to configure. (1, 225, etc)
  • peer_ip (str) – Peer IPv4 address for BFD setting.
  • tx (str) – BFD transmit interval in milliseconds (300, 500, etc)
  • rx (str) – BFD receive interval in milliseconds (300, 500, etc)
  • multiplier (str) – BFD multiplier. (3, 7, 5, etc)
  • delete (bool) – True if BFD configuration should be deleted. Default value will be False if not specified.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

KeyError – if tx, rx, or multiplier is not passed.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.230']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...    conn = (switch, '22')
...    with pynos.device.Device(conn=conn, auth=auth) as dev:
...        output = dev.bgp.neighbor(ip_addr='10.10.10.20',
...        remote_as='65535', rbridge_id='230')
...        output = dev.bgp.peer_bfd_timers(peer_ip='10.10.10.20',
...        rx='300', tx='300', multiplier='3', rbridge_id='230')
...        output = dev.bgp.peer_bfd_timers(peer_ip='10.10.10.20',
...        rx='300', tx='300', multiplier='3', rbridge_id='230',
...        get=True)
...        output = dev.bgp.peer_bfd_timers(peer_ip='10.10.10.20',
...        rx='300', tx='300', multiplier='3',
...        rbridge_id='230', delete=True)
...        output = dev.bgp.neighbor(ip_addr='10.10.10.20',
...        delete=True, rbridge_id='230', remote_as='65535')
retain_rt_all(**kwargs)[source]

Retain route targets.

Parameters:
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • delete (bool) – Deletes the neighbor if delete is True.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

None

Examples

>>> import pynos.device
>>> conn = ('10.24.39.203', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.bgp.local_asn(local_as='65535',
...     rbridge_id='225')
...     output = dev.bgp.retain_rt_all(rbridge_id='225')
...     output = dev.bgp.retain_rt_all(rbridge_id='225', get=True)
...     output = dev.bgp.retain_rt_all(rbridge_id='225',
...     delete=True)
vni_add(**kwargs)[source]

Add VNIs to the EVPN Instance :param rbridge_id: rbridge-id for device. :type rbridge_id: str :param evpn_instance: Name of the evpn instance. :type evpn_instance: str :param vni: vnis to the evpn instance :type vni: str :param get: Get config instead of editing config. (True, False) :type get: bool :param delete: True, delete the vni configuration :type delete: bool :param callback: A function executed upon completion of the

method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if rbridge_id,`evpn_instance`, ‘vni’ is not passed.
  • ValueError – if rbridge_id, evpn_instance, ‘vni’ is invalid.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output = dev.bgp.vni_add(rbridge_id='2',
...         evpn_instance="leaf1", vni='10')
...         output = dev.bgp.vni_add(rbridge_id='2',
...         evpn_instance="leaf1", vni='10', delete=True)
...         output = dev.bgp.vni_add(rbridge_id='2',
...         evpn_instance="leaf1", vni='10', delete=True)
...         output = dev.bgp.vni_add(rbridge_id='2',
...         get=True)
vrf_max_paths(**kwargs)[source]

Set BGP max paths property on VRF address family.

Parameters:
  • vrf (str) – The VRF for this BGP process.
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • paths (str) – Number of paths for BGP ECMP (default: 8).
  • afi (str) – Address family to configure. (ipv4, ipv6)
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

AttributeError: When afi is not one of [‘ipv4’, ‘ipv6’]

Examples

>>> import pynos.device
>>> conn = ('10.24.39.211', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.bgp.vrf_max_paths(paths='8',
...     rbridge_id='225')
...     output = dev.bgp.vrf_max_paths(
...     rbridge_id='225', get=True)
...     output = dev.bgp.vrf_max_paths(paths='8',
...     rbridge_id='225', delete=True)
...     output = dev.bgp.vrf_max_paths(paths='8', afi='ipv6',
...     rbridge_id='225')
...     output = dev.bgp.vrf_max_paths(afi='ipv6',
...     rbridge_id='225', get=True)
...     output = dev.bgp.vrf_max_paths(paths='8', afi='ipv6',
...     rbridge_id='225', delete=True)
...     output = dev.bgp.vrf_max_paths(paths='8', afi='ipv5',
...     rbridge_id='225') 
Traceback (most recent call last):
AttributeError
vrf_redistribute_connected(**kwargs)[source]

Enable redistribute connected on vrf address family.

Parameters:
  • afi (str) – Address family to configure. (ipv4, ipv6)
  • vrf (str) – The VRF for this BGP process.
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • delete (bool) – Deletes the redistribute connected if delete is True.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if `vrf’ is not expected
  • AttributeError – if ‘afi’ is not in ipv4,ipv6. Default = ipv4

Examples

>>> import pynos.device
>>> conn = ('10.24.39.211', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     device.bgp.vrf_redistribute_connected(vrf='vrf101',
...     rbridge_id='4')
...     device.bgp.vrf_redistribute_connected(vrf='vrf101',
...     get=True, rbridge_id='4')
...     device.bgp.vrf_redistribute_connected(vrf='vrf101',
...     delete=True, rbridge_id='4')
vrf_unicast_address_family(**kwargs)[source]

Add BGP v4/v6 address family.

Parameters:
  • afi (str) – Address family to configure. (ipv4, ipv6)
  • vrf (str) – The VRF for this BGP process.
  • rbridge_id (str) – The rbridge ID of the device on which BGP will be configured in a VCS fabric.
  • delete (bool) – Deletes the redistribute connected if delete is True.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if `vrf’ is not expected
  • AttributeError – if ‘afi’ is not in ipv4,ipv6. Default = ipv4

Examples

>>> import pynos.device
>>> conn = ('10.24.39.211', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     device.bgp.vrf_unicast_address_family(delete=True,
...     vrf='vrf101', rbridge_id='4')
...     device.bgp.vrf_unicast_address_family(get=True,
...     vrf='vrf101', rbridge_id='4')
...     device.bgp.vrf_unicast_address_family(vrf='vrf101',
...     rbridge_id='4')

pynos.versions.ver_7.ver_7_0_0.firmware module

Copyright 2015 Brocade Communications Systems, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class pynos.versions.ver_7.ver_7_0_0.firmware.Firmware(callback)[source]

Bases: pynos.versions.base.firmware.Firmware

System class containing all system level methods and attributes.

pynos.versions.ver_7.ver_7_0_0.interface module

Copyright 2015 Brocade Communications Systems, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class pynos.versions.ver_7.ver_7_0_0.interface.Interface(callback)[source]

Bases: pynos.versions.base.interface.Interface

The Interface class holds all the actions assocaiated with the Interfaces of a NOS device.

None
anycast_mac(**kwargs)[source]

Configure an anycast MAC address.

Parameters:
  • int_type (str) –
    Type of interface. (gigabitethernet,
    tengigabitethernet etc).
    mac (str): MAC address to configure
    (example: ‘0011.2233.4455’).
  • delete (bool) – True is the IP address is added and False if its to be deleted (True, False). Default value will be False if not specified.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

KeyError – if mac is not passed.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.230']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...    conn = (switch, '22')
...    with pynos.device.Device(conn=conn, auth=auth) as dev:
...        output = dev.services.vrrp(ip_version='6',
...        enabled=True, rbridge_id='230')
...        output = dev.services.vrrp(enabled=True,
...        rbridge_id='230')
...        output = dev.services.vrrp(ip_version='6',
...        enabled=False, rbridge_id='230')
...        output = dev.services.vrrp(enabled=False,
...        rbridge_id='230')
...        output = dev.interface.anycast_mac(rbridge_id='230',
...        mac='0011.2233.4455')
...        output = dev.interface.anycast_mac(rbridge_id='230',
...        mac='0011.2233.4455', get=True)
...        output = dev.interface.anycast_mac(rbridge_id='230',
...        mac='0011.2233.4455', delete=True)
...        output = dev.services.vrrp(ip_version='6', enabled=True,
...        rbridge_id='230')
...        output = dev.services.vrrp(enabled=True,
...        rbridge_id='230')
arp_suppression(**kwargs)[source]

Enable Arp Suppression on a Vlan.

Parameters:
  • name – Vlan name on which the Arp suppression needs to be enabled.
  • enable (bool) – If arp suppression should be enabled or disabled.Default:True.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) –

    A function executed upon completion of the method. The only parameter passed to callback will be the

    ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if name is not passed.
    • ValueError – if name is invalid.

output2 = dev.interface.arp_suppression(name=‘89’)

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output = dev.interface.arp_suppression(
...         name='89')
...         output = dev.interface.arp_suppression(
...         get=True,name='89')
...         output = dev.interface.arp_suppression(
...         enable=False,name='89')
...         
Traceback (most recent call last):
KeyError
bfd(**kwargs)[source]

Configure BFD for Interface.

Parameters:
  • name (str) – name of the interface to configure (230/0/1 etc)
  • int_type (str) – interface type (gigabitethernet etc)
  • tx (str) – BFD transmit interval in milliseconds (300, 500, etc)
  • rx (str) – BFD receive interval in milliseconds (300, 500, etc)
  • multiplier (str) – BFD multiplier. (3, 7, 5, etc)
  • delete (bool) – True if BFD configuration should be deleted. Default value will be False if not specified.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

KeyError – if tx, rx, or multiplier is not passed.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.230']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...    conn = (switch, '22')
...    with pynos.device.Device(conn=conn, auth=auth) as dev:
...        output = dev.interface.bfd(name='230/0/4', rx='300',
...        tx='300', multiplier='3', int_type='tengigabitethernet')
...        output = dev.interface.bfd(name='230/0/4', rx='300',
...        tx='300', multiplier='3',
...        int_type='tengigabitethernet', get=True)
...        output = dev.interface.bfd(name='230/0/4', rx='300',
...        tx='300', multiplier='3',
...        int_type='tengigabitethernet', delete=True)
conversational_arp(**kwargs)[source]

Enable conversational arp learning on VDX switches

Parameters:
  • rbridge_id (str) – rbridge-id for device.
  • get (bool) – Get config instead of editing config. (True, False)
  • delete (bool) – True, delete the conversation arp learning. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if rbridge_id is not passed.
  • ValueError – if rbridge_id is invalid.

Examples

>>> import pynos.device
>>> conn = ('10.24.39.211', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.interface.conversational_arp(rbridge_id="1")
...     output = dev.interface.conversational_arp(rbridge_id="1",
                 get=True)
...     output = dev.interface.conversational_arp(rbridge_id="1",
                 delete=True)
create_evpn_instance(**kwargs)[source]

Add evpn instance.

Parameters:
  • evpn_instance_name – Instance name for evpn
  • enable (bool) – If evpn instance needs to be configured or disabled.Default:True.
  • get (bool) – Get config instead of editing config. (True, False)
  • rbridge_id (str) – rbridge-id for device. Only required when type is ve.
  • callback (function) –

    A function executed upon completion of the method. The only parameter passed to callback will be the

    ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if ‘evpn_instance_name’ is not passed.
  • ValueError – if ‘evpn_instance_name’ is invalid.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output = dev.interface.create_evpn_instance(
...         evpn_instance_name='100',
...         rbridge_id='1')
...         output = dev.interface.create_evpn_instance(
...         get=True,
...         evpn_instance_name='100',
...         rbridge_id='1')
...         output = dev.interface.create_evpn_instance(
...         enable=False,
...         evpn_instance_name='101',
...         rbridge_id='1')
...         output = dev.interface.create_evpn_instance(
...         get=True,
...         rbridge_id='1')
...         
Traceback (most recent call last):
KeyError
evpn_instance_duplicate_mac_timer(**kwargs)[source]

Add “Duplicate MAC timer value” under evpn instance.

Parameters:
  • evpn_instance_name – Instance name for evpn
  • duplicate_mac_timer_value – Duplicate MAC timer value.
  • enable (bool) – If target community needs to be enabled or disabled.Default:True.
  • get (bool) – Get config instead of editing config. (True, False)
  • rbridge_id (str) – rbridge-id for device. Only required when type is ve.
  • callback (function) –

    A function executed upon completion of the method. The only parameter passed to callback will be the

    ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if ‘evpn_instance_name’ is not passed.
  • ValueError – if ‘evpn_instance_name’ is invalid.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output=dev.interface.evpn_instance_duplicate_mac_timer(
...         evpn_instance_name='100',
...         duplicate_mac_timer_value='10'
...         rbridge_id='1')
...         output=dev.interface.evpn_instance_duplicate_mac_timer(
...         get=True,
...         evpn_instance_name='100',
...         duplicate_mac_timer_value='10'
...         rbridge_id='1')
...         output=dev.interface.evpn_instance_duplicate_mac_timer(
...         enable=False,
...         evpn_instance_name='101',
...         duplicate_mac_timer_value='10'
...         rbridge_id='1')
...         output=dev.interface.evpn_instance_duplicate_mac_timer(
...         get=True,
...         evpn_instance_name='101',
...         rbridge_id='1')
...         
Traceback (most recent call last):
KeyError
evpn_instance_mac_timer_max_count(**kwargs)[source]

Add “Duplicate MAC max count” under evpn instance.

Parameters:
  • evpn_instance_name – Instance name for evpn
  • max_count – Duplicate MAC max count.
  • enable (bool) – If target community needs to be enabled or disabled.Default:True.
  • get (bool) – Get config instead of editing config. (True, False)
  • rbridge_id (str) – rbridge-id for device. Only required when type is ve.
  • callback (function) –

    A function executed upon completion of the method. The only parameter passed to callback will be the

    ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if ‘evpn_instance_name’ is not passed.
  • ValueError – if ‘evpn_instance_name’ is invalid.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output=dev.interface.evpn_instance_mac_timer_max_count(
...         evpn_instance_name='100',
...         max_count='10'
...         rbridge_id='1')
...         output=dev.interface.evpn_instance_mac_timer_max_count(
...         get=True,
...         evpn_instance_name='100',
...         max_count='10'
...         rbridge_id='1')
...         output=dev.interface.evpn_instance_mac_timer_max_count(
...         enable=False,
...         evpn_instance_name='101',
...         max_count='10'
...         rbridge_id='1')
...         output=dev.interface.evpn_instance_mac_timer_max_count(
...         get=True,
...         evpn_instance_name='101',
...         rbridge_id='1')
...         
Traceback (most recent call last):
KeyError
evpn_instance_rd_auto(**kwargs)[source]

Add RD auto under EVPN instance.

Parameters:
  • rbridge_id – Rbrdige id .
  • instance_name – EVPN instance name.
Returns:

True if command completes successfully or False if not.

Raises:

None

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output=dev.interface.evpn_instance_rd_auto(
...         evpn_instance_name='100',
...         rbridge_id='1')
evpn_instance_rt_both_ignore_as(**kwargs)[source]

Add evpn instance route target ignore AS.

Parameters:
  • evpn_instance_name – Instance name for evpn
  • enable (bool) – If target community needs to be enabled or disabled.Default:True.
  • get (bool) – Get config instead of editing config. (True, False)
  • rbridge_id (str) – rbridge-id for device. Only required when type is ve.
  • callback (function) –

    A function executed upon completion of the method. The only parameter passed to callback will be the

    ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if ‘evpn_instance_name’ is not passed.
  • ValueError – if ‘evpn_instance_name’ is invalid.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...conn = (switch, '22')
...with pynos.device.Device(conn=conn, auth=auth) as dev:
... output=dev.interface.evpn_instance_rt_both_ignore_as(
... evpn_instance_name='100',
... rbridge_id='1')
... output=dev.interface.evpn_instance_rt_both_ignore_as(
... get=True,
... evpn_instance_name='100',
... rbridge_id='1')
... output=dev.interface.evpn_instance_rt_both_ignore_as(
... enable=False,
... evpn_instance_name='101',
... rbridge_id='1')
... output=dev.interface.evpn_instance_rt_both_ignore_as(
... get=True,
... rbridge_id='1')
...   
Traceback (most recent call last):
KeyError
ip_anycast_gateway(**kwargs)[source]

Add anycast gateway under interface ve.

Parameters:
  • int_type – L3 interface type on which the anycast ip needs to be configured.
  • name – L3 interface name on which the anycast ip needs to be configured.
  • anycast_ip – Anycast ip which the L3 interface needs to be associated.
  • enable (bool) – If ip anycast gateway should be enabled or disabled.Default:True.
  • get (bool) – Get config instead of editing config. (True, False)
  • rbridge_id (str) – rbridge-id for device. Only required when type is ve.
  • callback (function) –

    A function executed upon completion of the method. The only parameter passed to callback will be the

    ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if int_type, name, anycast_ip is not passed.
  • ValueError – if int_type, name, anycast_ip is invalid.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output = dev.interface.ip_anycast_gateway(
...         int_type='ve',
...         name='89',
...         anycast_ip='10.20.1.1/24',
...         rbridge_id='1')
...         output = dev.interface.ip_anycast_gateway(
...         get=True,int_type='ve',
...         name='89',
...         anycast_ip='10.20.1.1/24',
...         rbridge_id='1')
...         output = dev.interface.ip_anycast_gateway(
...         enable=False,int_type='ve',
...         name='89',
...         anycast_ip='10.20.1.1/24',
...         rbridge_id='1')
...         
Traceback (most recent call last):
KeyError
ip_unnumbered(**kwargs)[source]

Configure an unnumbered interface.

Parameters:
  • int_type (str) – Type of interface. (gigabitethernet, tengigabitethernet etc).
  • name (str) – Name of interface id. (For interface: 1/0/5, 1/0/10 etc).
  • delete (bool) – True is the IP address is added and False if its to be deleted (True, False). Default value will be False if not specified.
  • donor_type (str) – Interface type of the donor interface.
  • donor_name (str) – Interface name of the donor interface.
  • get (bool) – Get config instead of editing config. (True, False)
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if int_type, name, donor_type, or donor_name is not passed.
  • ValueError – if int_type, name, donor_type, or donor_name are invalid.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.230']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...    conn = (switch, '22')
...    with pynos.device.Device(conn=conn, auth=auth) as dev:
...        output = dev.interface.ip_address(int_type='loopback',
...        name='1', ip_addr='4.4.4.4/32', rbridge_id='230')
...        int_type = 'tengigabitethernet'
...        name = '230/0/20'
...        donor_type = 'loopback'
...        donor_name = '1'
...        output = dev.interface.disable_switchport(inter_type=
...        int_type, inter=name)
...        output = dev.interface.ip_unnumbered(int_type=int_type,
...        name=name, donor_type=donor_type, donor_name=donor_name)
...        output = dev.interface.ip_unnumbered(int_type=int_type,
...        name=name, donor_type=donor_type, donor_name=donor_name,
...        get=True)
...        output = dev.interface.ip_unnumbered(int_type=int_type,
...        name=name, donor_type=donor_type, donor_name=donor_name,
...        delete=True)
...        output = dev.interface.ip_address(int_type='loopback',
...        name='1', ip_addr='4.4.4.4/32', rbridge_id='230',
...        delete=True)
...        output = dev.interface.ip_unnumbered(int_type='hodor',
...        donor_name=donor_name, donor_type=donor_type, name=name)
...        
Traceback (most recent call last):
ValueError
mac_move_detect_enable(**kwargs)[source]

Enable mac move detect enable on vdx switches :param get: Get config instead of editing config. (True, False) :type get: bool :param delete: True, delete the mac-move-detect-enable.

(True, False)
Parameters:callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:Return value of callback.
Raises:None

Examples

>>> import pynos.device
>>> conn = ('10.24.39.211', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.interface.mac_move_detect_enable()
...     output = dev.interface.mac_move_detect_enable(get=True)
...     output = dev.interface.mac_move_detect_enable(delete=True)
mac_move_limit(**kwargs)[source]

Configure mac move limit on vdx switches :param mac_move_limit: set the limit of mac move limit :param get: Get config instead of editing config. (True, False) :type get: bool :param delete: True, delete the mac move limit.(True, False) :type delete: bool :param callback: A function executed upon completion of the

method. The only parameter passed to callback will be the ElementTree config.
Returns:Return value of callback.
Raises:None

Examples

>>> import pynos.device
>>> conn = ('10.24.39.211', '22')
>>> auth = ('admin', 'password')
>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     output = dev.interface.mac_move_limit()
...     output = dev.interface.mac_move_limit(get=True)
...     output = dev.interface.mac_move_limit(delete=True)
vrf(**kwargs)[source]

Create a vrf. :param vrf_name: Name of the vrf (vrf101, vrf-1 etc). :type vrf_name: str :param get: Get config instead of editing config. (True, False) :type get: bool :param delete: False, the vrf is created and True if its to

be deleted (True, False). Default value will be False if not specified.
Parameters:
  • rbridge_id (str) – rbridge-id for device.
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if rbridge_id,`vrf_name` is not passed.
  • ValueError – if rbridge_id, vrf_name is invalid.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output = dev.interface.vrf(vrf_name=vrf1,
...         rbridge_id='225')
...         output = dev.interface.vrf(rbridge_id='225',
...         get=True)
...         output = dev.interface.vrf(vrf_name=vrf1,
...         rbridge_id='225',delete=True)
vrf_afi_rt_evpn(**kwargs)[source]

Configure Target VPN Extended Communities :param rbridge_id: rbridge-id for device. :type rbridge_id: str :param vrf_name: Name of the vrf (vrf101, vrf-1 etc). :type vrf_name: str :param rt: Route Target(import/export/both). :type rt: str :param rt_value: Route Target Value ASN:nn Target

VPN Extended Community.
Parameters:
  • afi (str) – Address family (ip/ipv6).
  • get (bool) – Get config instead of editing config. List all the details of all afi under all vrf(True, False)
  • delete_rt (bool) – True to delete the route-target under address family (True, False). Default value will be False if not specified.
  • delete_afi (bool) – True to delet the ip/ipv6 address family Default value will be False if not specified.
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:
  • KeyError – if rbridge_id,`vrf_name`, ‘afi’, ‘rt’, ‘rt_value’ is not passed.
  • ValueError – if rbridge_id, vrf_name, ‘afi’, ‘rt’, rt_value is invalid.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output = dev.interface.vrf_vni(rbridge_id="1",
...         afi="ip", rt='import', rt_value='101:101',
...         vrf_name="vrf1")
...         output = dev.interface.vrf_vni(rbridge_id="1",
...         afi="ip", rt='import', rt_value='101:101',
...         vrf_name="vrf1",delete_rt=True)
...         output = dev.interface.vrf_vni(rbridge_id="1",
...         afi="ip", rt='import', rt_value='101:101',
...         vrf_name="vrf1",delete_afi=True)
...         output = dev.interface.vrf_vni(rbridge_id="1",
...         afi="ip", get=True)
...         output = dev.interface.vrf_vni(rbridge_id="1",
...         afi="ip", vrf_name="vrf2", get=True)
vrf_l3vni(**kwargs)[source]

Configure Layer3 vni under vrf. :param rbridge_id: rbridge-id for device. :type rbridge_id: str :param vrf_name: Name of the vrf (vrf101, vrf-1 etc). :type vrf_name: str :param l3vni: <NUMBER:1-16777215> Layer 3 VNI. :type l3vni: str :param get: Get config instead of editing config. (True, False) :type get: bool :param delete: False the L3 vni is configured and True if its to

be deleted (True, False). Default value will be False if not specified.
Parameters:

callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.

Returns:

Return value of callback.

Raises:
  • KeyError – if rbridge_id,`vrf_name`, ‘l3vni’ is not passed.
  • ValueError – if rbridge_id, vrf_name, ‘l3vni’ is invalid.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output = dev.interface.vrf_vni(
...         vrf_name=vrf1, rbridge_id='2', l3vni ='7201')
...         output = dev.interface.vrf_vni(rbridge_id='2',
...         get=True)
...         output = dev.interface.vrf_vni(rbridge_id='2',
...         , vrf_name='vrf2' get=True)
...         output = dev.interface.vrf_vni(vrf_name=vrf1,
...         rbridge_id='2', l3vni ='7201', delete=True)
vrf_route_distiniguisher(**kwargs)[source]

Configure Route distiniguisher. :param rbridge_id: rbridge-id for device. :type rbridge_id: str :param vrf_name: Name of the vrf (vrf101, vrf-1 etc). :type vrf_name: str :param rd: Route distiniguisher <ASN:nn or IP-address:nn> :type rd: str :param get: Get config instead of editing config. (True, False) :type get: bool :param delete: False, the vrf rd is configured and True if its to

be deleted (True, False). Default value will be False if not specified.
Parameters:

callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.

Returns:

Return value of callback.

Raises:
  • KeyError – if rbridge_id,`vrf_name`, ‘rd’ is not passed.
  • ValueError – if rbridge_id, vrf_name, ‘rd’ is invalid.

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output = dev.interface.vrf_route_distiniguisher(
...         vrf_name=vrf1, rbridge_id='2', rd='10.0.1.1:101')
...         output = dev.interface.vrf_route_distiniguisher(
...         vrf_name=vrf1, rbridge_id='2', rd='100:101')
...         output = dev.interface.vrf_route_distiniguisher(
...         rbridge_id='2', get=True)
...         output = dev.interface.vrf_route_distiniguisher(
...         rbridge_id='2', vrf_name='vrf2', get=True)
...         output = dev.interface.vrf_route_distiniguisher(
...         vrf_name=vrf1, rbridge_id='2', rd='100:101',
...         delete=True)

pynos.versions.ver_7.ver_7_0_0.lldp module

Copyright 2015 Brocade Communications Systems, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class pynos.versions.ver_7.ver_7_0_0.lldp.LLDP(callback)[source]

Bases: pynos.versions.base.lldp.LLDP

LLDP class containing LLDP methods and attributes.

static get_lldp_neighbors_request(last_ifindex, rbridge_id)[source]

Creates a new Netconf request based on the last received or if rbridge_id is specifed ifindex when the hasMore flag is true

neighbors(**kwargs)[source]

list[dict]: A list of dictionary items describing the operational state of LLDP.

pynos.versions.ver_7.ver_7_0_0.services module

Copyright 2015 Brocade Communications Systems, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

class pynos.versions.ver_7.ver_7_0_0.services.Services(callback)[source]

Bases: object

The Services class holds all relevent methods and attributes for enabling and disabling NOS services, such as VRRP.

None
vrrp(**kwargs)[source]

Enable or Disable VRRP.

Parameters:
  • ip_version (str) – The IP version (‘4’ or ‘6’) for which VRRP should be enabled/disabled. Default: 4.
  • enabled (bool) – If VRRP should be enabled or disabled. Default: True.
  • rbridge_id (str) – The rbridge ID of the device on which VRRP will be enabled/disabled. Default: 1.
  • callback (function) – A function executed upon completion of the method. The only parameter passed to callback will be the ElementTree config.
Returns:

Return value of callback.

Raises:

None

Examples

>>> import pynos.device
>>> switches = ['10.24.39.211', '10.24.39.203']
>>> auth = ('admin', 'password')
>>> for switch in switches:
...     conn = (switch, '22')
...     with pynos.device.Device(conn=conn, auth=auth) as dev:
...         output = dev.bgp.local_asn(rbridge_id='225')
...         output = dev.bgp.local_asn(rbridge_id='225',
...         enabled=False)
...         output = dev.bgp.local_asn(rbridge_id='225',
...         ip_version='6')
...         output = dev.bgp.local_asn(rbridge_id='225',
...         enabled=False, ip_version='6')
...         dev.services.vrrp() 
Traceback (most recent call last):
KeyError

Module contents

Copyright 2015 Brocade Communications Systems, Inc.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.