Merge pull request #11 from fooelisa/cleaning_code
Removed unnecessary stuff
This commit is contained in:
commit
4e41d0a6b2
7 files changed
-123
No files matched your search
@@ -1,20 +0,0 @@
|
||||
---
|
||||
|
||||
# bgp neighbor table
|
||||
bgp_neigh_tbl:
|
||||
rpc: get-bgp-neighbor-information
|
||||
item: bgp-peer
|
||||
key: peer-address
|
||||
view: _bgp_neigh_tbl_view
|
||||
|
||||
_bgp_neigh_tbl_view:
|
||||
fields:
|
||||
peer_state: peer-state
|
||||
local_address: local-address
|
||||
peer_address: peer-address
|
||||
peer_asn: peer-as
|
||||
description: description
|
||||
peer_prefixes_received: bgp-rib/received-prefix-count
|
||||
peer_prefixes_accepted: bgp-rib/accepted-prefix-count
|
||||
peer_prefixes_active: bgp-rib/active-prefix-count
|
||||
|
||||
Whitespace-only changes.
@@ -1,39 +0,0 @@
|
||||
class BGPInstance:
|
||||
def __init__(self, vrf, asn, router_id, bgp_neighbors):
|
||||
"""
|
||||
|
||||
:param vrf: (str) VRF to which the BGP instance belongs to
|
||||
:param asn: (int) The ASN of the BGP instance
|
||||
:param router_id: (str) The router ID
|
||||
:param bgp_neighbors: (list of BGPNeighbor) A list of bgp peers
|
||||
:return:
|
||||
"""
|
||||
self.vrf = vrf
|
||||
self.asn = asn
|
||||
self.router_id = router_id
|
||||
self.bgp_neighbors = bgp_neighbors
|
||||
|
||||
def __str__(self):
|
||||
return 'BGP Instance: vrf=%s, asn=%s, router_id=%s' % (self.vrf, self.asn, self.router_id)
|
||||
|
||||
|
||||
class BGPNeighbor:
|
||||
def __init__(self, ip, remote_as, state, time, prefixes_accepted):
|
||||
"""
|
||||
|
||||
:param ip: (str) IP of the BGP neighbor
|
||||
:param remote_as: (str) Remote AS of the BGP neighbor
|
||||
:param state: (str) State of the BGP neighbor relationship. Make sure you use the standard values as: Idle,
|
||||
Connect, Active, OpenSent, OpenConfirm, Established
|
||||
:param time: (int) For how long the device has been on the up/down state
|
||||
:param prefixes_accepted: (int) Number of prefixes accepted
|
||||
:return:
|
||||
"""
|
||||
self.ip = ip
|
||||
self.remote_as = remote_as
|
||||
self.state = state
|
||||
self.time = time
|
||||
self.prefixes_accepted = prefixes_accepted
|
||||
|
||||
def __str__(self):
|
||||
return "BGP Neighbor: ip=%s, asn=%s, state=%s" % (self.ip, self.remote_as, self.state)
|
||||
@@ -1,8 +0,0 @@
|
||||
class SyntacticError(Exception):
|
||||
pass
|
||||
|
||||
class SemanticError(Exception):
|
||||
pass
|
||||
|
||||
class UnknownConfigurationError(Exception):
|
||||
pass
|
||||
@@ -1,16 +0,0 @@
|
||||
class Facts:
|
||||
def __init__(self, vendor, hostname, fqdn, hardware_model, serial_number, os_version, interfaces):
|
||||
"""
|
||||
:param vendor: (str) Vendor of the device.
|
||||
:param hardware_model: (str) Specific hardware model of the device
|
||||
:param serial_number: (str) Serial number of the device
|
||||
:param os_version: (str) OS Version running the device
|
||||
:param interfaces: (list of str) List of interface names available on the device
|
||||
"""
|
||||
self.vendor = vendor
|
||||
self.hostname = hostname
|
||||
self.fqdn = fqdn
|
||||
self.hardware_model = hardware_model
|
||||
self.serial_number = serial_number
|
||||
self.os_version = os_version
|
||||
self.interfaces = interfaces
|
||||
@@ -1,21 +0,0 @@
|
||||
class InterfaceStatus:
|
||||
UP = 1
|
||||
OPER_DOWN = -1
|
||||
ADMIN_DOWN = -2
|
||||
|
||||
class Interface:
|
||||
def __init__(self, name, speed, status):
|
||||
"""
|
||||
Represents an interface on a switch.
|
||||
|
||||
:param name: (str) Name of the interface
|
||||
:param speed: (int) Speed of the interface in Gbps.
|
||||
:param status: (Status) Status of an interface. Make sure you use the values on the class Status.
|
||||
:return:
|
||||
"""
|
||||
self.name = name
|
||||
self.speed = speed
|
||||
self.status = status
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
@@ -1,19 +0,0 @@
|
||||
class LLDPNeighbor:
|
||||
def __init__(self, hostname, local_port, remote_port):
|
||||
"""
|
||||
Represents and LLDP neighbor.
|
||||
|
||||
:param hostname: (str) hostname of the LLDP Neighbor
|
||||
:param local_port: (str) Local port where the LLDP Neighbor is connected to.
|
||||
:param remote_port: (str) Remote port where the LLDP Neighbor is connected to.
|
||||
:return:
|
||||
"""
|
||||
self.hostname = hostname
|
||||
self.local_port = local_port
|
||||
self.remote_port = remote_port
|
||||
|
||||
def __str__(self):
|
||||
return self.hostname
|
||||
|
||||
def __repr__(self):
|
||||
return 'LLDPNeighbor: %s' % self.__str__()
|
||||
Reference in new issue
Block a user