# Path: sysdescrparser/sysdescrparser.py
# def sysdescrparser(sysdescr):
#     """SNMP sysDescr parsing.
# 
#     Args:
# 
#         :sysdescr(str): SNMP sysDescr raw string.
# 
#     Returns:
# 
#         :SysDescr sub-class instance: SysDescr is abstract super class.
#             Each vendor class extends Sysdescr class and following attributes.
# 
#             :vendor(str): Vendor name.
#             :model(str): Product Model name.
#             :os(str): OS name.
#             :version(str): OS version name.
# 
#     Example:
# 
#         .. code-block:: python
# 
#             >>> from sysdescrparser import sysdescrparser
#             >>> sysdescr = sysdescrparser('Juniper Networks, Inc. ...')
#             >>> sysdescr.vendor
#             'JUNIPER'
#             >>> sysdescr.model
#             'ex2200-48t-4g'
#             >>> sysdescr.os
#             'JUNOS'
#             >>> sysdescr.version
#             '10.2R1.8'
# 
#     Support:
# 
#          Currently supported Vendor and OS.
# 
#          https://github.com/mtoshi/sysdescrparser/blob/master/samples/sample_data.json
# 
#     See also:
# 
#          https://github.com/mtoshi/sysdescrparser/blob/master/README.rst
# 
#     """
#     #
#     # cisco nxos
#     #
#     obj = CiscoNXOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # cisco iosxr
#     #
#     obj = CiscoIOSXR(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # cisco ios
#     #
#     obj = CiscoIOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # juniper junos
#     #
#     obj = JuniperJunos(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # juniper screenos
#     #
#     obj = JuniperScreenOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # brocade ironware
#     #
#     obj = BrocadeIronWare(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # brocade serveriron
#     #
#     obj = BrocadeServerIron(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # brocade networkos
#     #
#     obj = BrocadeNetworkOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # foundry ironware
#     #
#     obj = FoundryIronWare(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # arista eos
#     #
#     obj = AristaEOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # extreme xos
#     #
#     obj = ExtremeXOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # hp procurve
#     #
#     obj = HPProCurve(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # paloalto panos
#     #
#     obj = PaloAltoPANOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # a10 acos
#     #
#     obj = A10ACOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # citrix netscaler
#     #
#     obj = CitrixNetscaler(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # linux
#     #
#     obj = Linux(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # sun sunos
#     #
#     obj = SunSUNOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # freebsd
#     #
#     obj = FreeBSD(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # iij seil
#     #
#     obj = IIJSeil(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # yamaha rtx
#     #
#     obj = YamahaRTX(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # Unknown
#     #
#     obj = Unknown(sysdescr)
#     if obj.parse():
#         return obj
# 
#     return None


import os
import json
from sysdescrparser import sysdescrparser
# -*- coding: utf-8 -*-

"""Sample code."""



def main():
    """Sample main."""
    here = os.path.dirname(os.path.abspath(__file__))
    path = os.path.join(here, 'sample_data.json')

    with open(path) as _file:
        descrs = json.load(_file)

    for descr in descrs:

# Path: sysdescrparser/sysdescrparser.py
# def sysdescrparser(sysdescr):
#     """SNMP sysDescr parsing.
# 
#     Args:
# 
#         :sysdescr(str): SNMP sysDescr raw string.
# 
#     Returns:
# 
#         :SysDescr sub-class instance: SysDescr is abstract super class.
#             Each vendor class extends Sysdescr class and following attributes.
# 
#             :vendor(str): Vendor name.
#             :model(str): Product Model name.
#             :os(str): OS name.
#             :version(str): OS version name.
# 
#     Example:
# 
#         .. code-block:: python
# 
#             >>> from sysdescrparser import sysdescrparser
#             >>> sysdescr = sysdescrparser('Juniper Networks, Inc. ...')
#             >>> sysdescr.vendor
#             'JUNIPER'
#             >>> sysdescr.model
#             'ex2200-48t-4g'
#             >>> sysdescr.os
#             'JUNOS'
#             >>> sysdescr.version
#             '10.2R1.8'
# 
#     Support:
# 
#          Currently supported Vendor and OS.
# 
#          https://github.com/mtoshi/sysdescrparser/blob/master/samples/sample_data.json
# 
#     See also:
# 
#          https://github.com/mtoshi/sysdescrparser/blob/master/README.rst
# 
#     """
#     #
#     # cisco nxos
#     #
#     obj = CiscoNXOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # cisco iosxr
#     #
#     obj = CiscoIOSXR(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # cisco ios
#     #
#     obj = CiscoIOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # juniper junos
#     #
#     obj = JuniperJunos(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # juniper screenos
#     #
#     obj = JuniperScreenOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # brocade ironware
#     #
#     obj = BrocadeIronWare(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # brocade serveriron
#     #
#     obj = BrocadeServerIron(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # brocade networkos
#     #
#     obj = BrocadeNetworkOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # foundry ironware
#     #
#     obj = FoundryIronWare(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # arista eos
#     #
#     obj = AristaEOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # extreme xos
#     #
#     obj = ExtremeXOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # hp procurve
#     #
#     obj = HPProCurve(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # paloalto panos
#     #
#     obj = PaloAltoPANOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # a10 acos
#     #
#     obj = A10ACOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # citrix netscaler
#     #
#     obj = CitrixNetscaler(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # linux
#     #
#     obj = Linux(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # sun sunos
#     #
#     obj = SunSUNOS(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # freebsd
#     #
#     obj = FreeBSD(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # iij seil
#     #
#     obj = IIJSeil(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # yamaha rtx
#     #
#     obj = YamahaRTX(sysdescr)
#     if obj.parse():
#         return obj
#     #
#     # Unknown
#     #
#     obj = Unknown(sysdescr)
#     if obj.parse():
#         return obj
# 
#     return None


# Path: samples/sample.py
import os
import json
from sysdescrparser import sysdescrparser

# -*- coding: utf-8 -*-

"""Sample code."""



def main():
    """Sample main."""
    here = os.path.dirname(os.path.abspath(__file__))
    path = os.path.join(here, 'sample_data.json')

    with open(path) as _file:
        descrs = json.load(_file)

    for descr in descrs:

        sysdescr = sysdescrparser(descr['raw'])