Skip to content

Commit

Permalink
Releasing beta package v19.8.1b3
Browse files Browse the repository at this point in the history
  • Loading branch information
karmoham committed Sep 17, 2019
1 parent 76e1900 commit 6d0c850
Show file tree
Hide file tree
Showing 27 changed files with 1,899 additions and 264 deletions.
66 changes: 63 additions & 3 deletions changelog/undistributed.rst
Expand Up @@ -60,6 +60,8 @@
* Added ShowSegmentRoutingMplsMappingServer for:
'show segment-routing mpls mapping-server ipv4'
'show segment-routing mpls mapping-server ipv6'
* Added ShowSegmentRoutingMplsLbAssignedSids for:
'show segment-routing mpls lb assigned-sids'

--------------------------------------------------------------------------------
ISSU
Expand All @@ -82,6 +84,8 @@
* Updated ShowBgpL2vpnEvpn for:
added a schema and unittest, and updated based on the schema
* Updated ShowBgpInstanceAllAll for address family regex issue
* Updated ShowBgpL2vpnEvpn:
* updated schema to support more output
* IOS
* Added ShowBgpSummary for:
* show bgp summary
Expand Down Expand Up @@ -140,26 +144,33 @@
* Added ShowIpMsdpPeer for commands:
* show ip msdp peer
* show ip msdp vrf {vrf} peer
* IOSXE
* Update ShowMplsLdpNeighborDetail:
* fix cli wrong command parser error
* Update ShowMplsForwardingTable:
* update regex to support more output pattern

--------------------------------------------------------------------------------
vlan
--------------------------------------------------------------------------------
* IOSXE
* Fixed regex in ShowVlan
--------------------------------------------------------------------------------
FLOW MONITOR
FLOW
--------------------------------------------------------------------------------
* IOSXE
* Added ShowFlowMonitor for:
* show flow monitor {name} cache format table
* Added ShowFlowExporterStatistics for:
* show flow exporter statistics
* show flow exporter {exporter} statistics

--------------------------------------------------------------------------------
ROUTING
--------------------------------------------------------------------------------
* IOSXE
* Update ShowIpCef
* update regex to support outgoing_label_backup and outgoing_label_info

* IOSXR
* Updated ShowRouteIpv4:
* Matching more routes
Expand All @@ -181,7 +192,7 @@
* changed some fields in schema to Optional
* Updated ShowSpanningTreeDetail to:
* updated regex to accommodate more formats
* add support for rstp
* add support for rstp
* chnaged some fields in schema to Optional

--------------------------------------------------------------------------------
Expand All @@ -197,3 +208,52 @@
--------------------------------------------------------------------------------
* IOSXR
* Updated ShowArpTrafficDetail to parse drop_adj key from output


--------------------------------------------------------------------------------
VTP
--------------------------------------------------------------------------------
* IOSXE:
* Updated ShowVtpStatusSchema to:
* Changed schema keywords to Optional

--------------------------------------------------------------------------------
IPV6
--------------------------------------------------------------------------------
* NXOS
* Updated ShowIpv6NdInterfaceVrfAll to parse more varied output

--------------------------------------------------------------------------------
MLD
--------------------------------------------------------------------------------
* IOSXR

* Updated ShowMldGroupsDetail to support empty output
* Updated ShowMldGroupsDetail to support empty output

--------------------------------------------------------------------------------
lldp
--------------------------------------------------------------------------------
* IOS
* Updated ShowLlpdEntry to:
* Updated regex to accommodate more formats

--------------------------------------------------------------------------------
platform vm
--------------------------------------------------------------------------------
* IOSXR
* Updated ShowPlatformVm to:
* Updated regex to accommodate different formats from the outputs

--------------------------------------------------------------------------------
RPL
--------------------------------------------------------------------------------
* IOSXR
* Updated ShowRplRoutePolicy:
* Updated passing command in device.parse()

--------------------------------------------------------------------------------
VXLAN
--------------------------------------------------------------------------------
* NXOS
* Updated ShowRunningConfigNvOverlay for more varied output
2 changes: 1 addition & 1 deletion sdk_generator/outputs/bitbucket_parser.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk_generator/outputs/github_parser.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/genie/libs/parser/__init__.py
Expand Up @@ -8,7 +8,7 @@
'''

# metadata
__version__ = '19.8.1b2'
__version__ = '19.8.1b3'
__author__ = 'Cisco Systems Inc.'
__contact__ = ['pyats-support@cisco.com', 'pyats-support-ext@cisco.com']
__copyright__ = 'Copyright (c) 2018, Cisco Systems Inc.'
Expand Down
178 changes: 176 additions & 2 deletions src/genie/libs/parser/iosxe/show_flow.py
Expand Up @@ -2,7 +2,8 @@
IOSXE parsers for the following show commands:
* show flow monitor {name} cache format table
* show flow exporter statistics
* show flow exporter {exporter} statistics
'''

# Python
Expand Down Expand Up @@ -160,4 +161,177 @@ def cli(self, name, output=None):

continue

return ret_dict
return ret_dict


class ShowFlowExporterStatisticsSchema(MetaParser):
""" Schema for:
* show flow exporter statistics
* show flow exporter {exporter} statistics
"""
schema = {
'flow_exporter': {
Any(): {
'pkt_send_stats': {
'last_cleared': str,
Optional(Any()): int
},
'client_send_stats': {
Any(): {
'records_added': {
'total': int,
Optional('sent'): int,
Optional('failed'): int
},
'bytes_added': {
'total': int,
Optional('sent'): int,
Optional('failed'): int
}
}
}
}
}
}


class ShowFlowExporterStatistics(ShowFlowExporterStatisticsSchema):
""" Parser for:
* show flow exporter statistics
* show flow exporter {exporter} statistics
"""

cli_command = ["show flow exporter statistics",
"show flow exporter {exporter} statistics"]

def cli(self, exporter=None, output=None):

if not output:
if not exporter:
output = self.device.execute(self.cli_command[0])
else:
output = self.device.execute(self.cli_command[1].format(exporter=exporter))

# Flow Exporter test
p1 = re.compile(r"^Flow +Exporter +(?P<exporter>\w+):$")

# Packet send statistics (last cleared 00:10:10 ago):
p2 = re.compile(r"^Packet +send +statistics +\(last +cleared +(?P<last_cleared>[\d:]+) +ago\):$")

# Successfully sent: 10 (1000 bytes)
# No FIB: 10 (1000 bytes)
# Adjacency failure: 10 (1000 bytes)
# Enqueued to process level: 10 (1000 bytes)
# Enqueueing failed: 10 (1000 bytes)
# IPC failed: 10 (1000 bytes)
# Output failed: 10 (1000 bytes)
# Fragmentation failed: 10 (1000 bytes)
# Encap fixup failed: 10 (1000 bytes)
# CEF not enabled: 10 (1000 bytes)
# Reason not given: 10 (1000 bytes)
# Rate limited: 10 (1000 bytes)
# No destination address: 10 (1000 bytes)
p3 = re.compile(r"^(?P<statistic>[\w\s]+): +(?P<pkts>\d+) +\((?P<bytes>\d+) +bytes\)$")

# Client: client_name
p4 = re.compile(r"^Client: +(?P<client>[\S\s]+)$")

# Records added: 10
p5 = re.compile(r"^Records +added: +(?P<total>\d+)$")

# Bytes added: 10
p6 = re.compile(r"^Bytes +added: +(?P<total>\d+)$")

# - sent: 20
p7 = re.compile(r"^- +sent: +(?P<sent>\d+)$")

# - failed to send: 30
p8 = re.compile(r"^- +failed +to +send: +(?P<failed>\d+)$")

records_flag = False
bytes_flag = False
ret_dict = {}

for line in output.splitlines():
line = line.strip()

# Flow Exporter test
m = p1.match(line)
if m:
exporter_dict = ret_dict.setdefault('flow_exporter', {})\
.setdefault(m.groupdict()['exporter'], {})
continue

# Packet send statistics (last cleared 00:10:10 ago):
m = p2.match(line)
if m:
pkt_stats_dict = exporter_dict.setdefault('pkt_send_stats', {})
pkt_stats_dict.update({'last_cleared': m.groupdict()['last_cleared']})
continue

# Successfully sent: 10 (1000 bytes)
# No FIB: 10 (1000 bytes)
# Adjacency failure: 10 (1000 bytes)
# Enqueued to process level: 10 (1000 bytes)
# Enqueueing failed: 10 (1000 bytes)
# IPC failed: 10 (1000 bytes)
# Output failed: 10 (1000 bytes)
# Fragmentation failed: 10 (1000 bytes)
# Encap fixup failed: 10 (1000 bytes)
# CEF not enabled: 10 (1000 bytes)
# Reason not given: 10 (1000 bytes)
# Rate limited: 10 (1000 bytes)
# No destination address: 10 (1000 bytes)
m = p3.match(line)
if m:
key = re.sub(' ', '_', m.groupdict()['statistic']).lower()
bytes_key = '{key}_bytes'.format(key=key)
pkt_stats_dict.update({key: int(m.groupdict()['pkts'])})
pkt_stats_dict.update({bytes_key: int(m.groupdict()['bytes'])})
continue

# Client: client_name
m = p4.match(line)
if m:
client_dict = exporter_dict.setdefault('client_send_stats', {})\
.setdefault(m.groupdict()['client'], {})
continue

# Records added: 10
m = p5.match(line)
if m:
records_flag = True
bytes_flag = False

records_dict = client_dict.setdefault('records_added', {})
records_dict.update({'total': int(m.groupdict()['total'])})
continue

# Bytes added: 10
m = p6.match(line)
if m:
records_flag = False
bytes_flag = True

bytes_dict = client_dict.setdefault('bytes_added', {})
bytes_dict.update({'total': int(m.groupdict()['total'])})
continue

# - sent: 20
m = p7.match(line)
if m:
if records_flag:
records_dict.update({'sent': int(m.groupdict()['sent'])})
elif bytes_flag:
bytes_dict.update({'sent': int(m.groupdict()['sent'])})
continue

# - failed to send: 30
m = p8.match(line)
if m:
if records_flag:
records_dict.update({'failed': int(m.groupdict()['failed'])})
elif bytes_flag:
bytes_dict.update({'failed': int(m.groupdict()['failed'])})

return ret_dict
3 changes: 2 additions & 1 deletion src/genie/libs/parser/iosxe/show_lldp.py
Expand Up @@ -155,7 +155,7 @@ def cli(self, entry='',output=None):

p3 = re.compile(r'^Port +Description: +(?P<desc>[\w\/\.\-]+)$')

p4 = re.compile(r'^System +Name: +(?P<name>\S+)$')
p4 = re.compile(r'^System +Name(?: +-|:) +(?P<name>[\S ]+)$')

p5 = re.compile(r'^System +Description:.*$')
p5_1 = re.compile(r'^(?P<msg>Cisco +IOS +Software.*)$')
Expand Down Expand Up @@ -218,6 +218,7 @@ def cli(self, entry='',output=None):
continue

# System Name: R5
# System Name - not advertised
m = p4.match(line)
if m:
name = m.groupdict()['name']
Expand Down

0 comments on commit 6d0c850

Please sign in to comment.