diff --git a/sa/profiles/BDCOM/IOS/get_inventory.py b/sa/profiles/BDCOM/IOS/get_inventory.py index 22f7d3e5bad44e82c23f3ba1bdfaf3c65acbe3ad..1d6a21d1c7b0da81beb9f999bc8ad16f789cb3ba 100644 --- a/sa/profiles/BDCOM/IOS/get_inventory.py +++ b/sa/profiles/BDCOM/IOS/get_inventory.py @@ -7,22 +7,10 @@ # --------------------------------------------------------------------- # NOC modules -from noc.core.script.base import BaseScript +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript from noc.sa.interfaces.igetinventory import IGetInventory class Script(BaseScript): name = "BDCOM.IOS.get_inventory" interface = IGetInventory - - def execute_cli(self): - v = self.scripts.get_version() - return [ - { - "type": "CHASSIS", - "vendor": "BDCOM", - "part_no": [v["platform"]], - "revision": v["attributes"]["HW version"], - "serial": v["attributes"]["Serial Number"], - } - ] diff --git a/sa/profiles/Cambium/ePMP/get_inventory.py b/sa/profiles/Cambium/ePMP/get_inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..0f1ff51971390613560a5f62e193993fa0e522fd --- /dev/null +++ b/sa/profiles/Cambium/ePMP/get_inventory.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# --------------------------------------------------------------------- +# Cambium.ePMP.get_inventory +# --------------------------------------------------------------------- +# Copyright (C) 2007-2019 The NOC Project +# See LICENSE for details +# --------------------------------------------------------------------- + +# NOC modules +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript +from noc.sa.interfaces.igetinventory import IGetInventory + + +class Script(BaseScript): + name = "Cambium.ePMP.get_inventory" + interface = IGetInventory diff --git a/sa/profiles/Carelink/SWG/get_inventory.py b/sa/profiles/Carelink/SWG/get_inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..e04e0008f7ed0cb5cae53074706a14f19a96375c --- /dev/null +++ b/sa/profiles/Carelink/SWG/get_inventory.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# --------------------------------------------------------------------- +# Carelink.SWG.get_inventory +# --------------------------------------------------------------------- +# Copyright (C) 2007-2019 The NOC Project +# See LICENSE for details +# --------------------------------------------------------------------- + +# NOC modules +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript +from noc.sa.interfaces.igetinventory import IGetInventory + + +class Script(BaseScript): + name = "Carelink.SWG.get_inventory" + interface = IGetInventory diff --git a/sa/profiles/Eltex/DSLAM/get_inventory.py b/sa/profiles/Eltex/DSLAM/get_inventory.py index bd2be84dfd921e4f37402aedb752833117e33751..eb68613a354d550b3f4592216bd2475f76b7b51b 100644 --- a/sa/profiles/Eltex/DSLAM/get_inventory.py +++ b/sa/profiles/Eltex/DSLAM/get_inventory.py @@ -7,14 +7,10 @@ # --------------------------------------------------------------------- # NOC modules -from noc.core.script.base import BaseScript +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript from noc.sa.interfaces.igetinventory import IGetInventory class Script(BaseScript): name = "Eltex.DSLAM.get_inventory" interface = IGetInventory - - def execute_cli(self, **kwargs): - v = self.scripts.get_version() - return [{"type": "CHASSIS", "vendor": "ELTEX", "part_no": v["platform"]}] diff --git a/sa/profiles/H3C/VRP/get_inventory.py b/sa/profiles/H3C/VRP/get_inventory.py index ffe137fa5e9f2ca24454df1ce97c3e3e42c81db0..01903068ebb9aeaeec0f12a420069c410bacb734 100644 --- a/sa/profiles/H3C/VRP/get_inventory.py +++ b/sa/profiles/H3C/VRP/get_inventory.py @@ -7,19 +7,10 @@ # --------------------------------------------------------------------- # NOC modules -from noc.core.script.base import BaseScript +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript from noc.sa.interfaces.igetinventory import IGetInventory class Script(BaseScript): name = "H3C.VRP.get_inventory" interface = IGetInventory - - def execute(self): - objects = [] - v = self.scripts.get_version() - inv = {"type": "CHASSIS", "vendor": "H3C", "part_no": [v["platform"]]} - if "attributes" in v and "Serial Number" in v["attributes"]: - inv["serial"] = v["attributes"]["Serial Number"] - objects += [inv] - return objects diff --git a/sa/profiles/Linksys/SPS2xx/get_inventory.py b/sa/profiles/Linksys/SPS2xx/get_inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..3c86c85a357fd144790e5d55897f2b05928ed31e --- /dev/null +++ b/sa/profiles/Linksys/SPS2xx/get_inventory.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# --------------------------------------------------------------------- +# Linksys.SPS2xx.get_inventory +# --------------------------------------------------------------------- +# Copyright (C) 2007-2019 The NOC Project +# See LICENSE for details +# --------------------------------------------------------------------- + +# NOC modules +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript +from noc.sa.interfaces.igetinventory import IGetInventory + + +class Script(BaseScript): + name = "Linksys.SPS2xx.get_inventory" + interface = IGetInventory diff --git a/sa/profiles/Linksys/SRW/get_inventory.py b/sa/profiles/Linksys/SRW/get_inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..df6ee63baf216567c7975b1c3416a6ebbb8ac23b --- /dev/null +++ b/sa/profiles/Linksys/SRW/get_inventory.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# --------------------------------------------------------------------- +# Linksys.SRW.get_inventory +# --------------------------------------------------------------------- +# Copyright (C) 2007-2019 The NOC Project +# See LICENSE for details +# --------------------------------------------------------------------- + +# NOC modules +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript +from noc.sa.interfaces.igetinventory import IGetInventory + + +class Script(BaseScript): + name = "Linksys.SRW.get_inventory" + interface = IGetInventory diff --git a/sa/profiles/NSCComm/LPOS/get_inventory.py b/sa/profiles/NSCComm/LPOS/get_inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..f67adadab8b8b7a685a1c2b89479be46a0af741e --- /dev/null +++ b/sa/profiles/NSCComm/LPOS/get_inventory.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# --------------------------------------------------------------------- +# NSCComm.LPOS.get_inventory +# --------------------------------------------------------------------- +# Copyright (C) 2007-2019 The NOC Project +# See LICENSE for details +# --------------------------------------------------------------------- + +# NOC modules +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript +from noc.sa.interfaces.igetinventory import IGetInventory + + +class Script(BaseScript): + name = "NSCComm.LPOS.get_inventory" + interface = IGetInventory diff --git a/sa/profiles/Nateks/FlexGainACE16/get_inventory.py b/sa/profiles/Nateks/FlexGainACE16/get_inventory.py index eb9aae1d995741bc2a0dcf3bfdbdecc16b4de887..42efb3c915cb040b9d584f67ce4102eecd21cf2f 100644 --- a/sa/profiles/Nateks/FlexGainACE16/get_inventory.py +++ b/sa/profiles/Nateks/FlexGainACE16/get_inventory.py @@ -7,21 +7,10 @@ # --------------------------------------------------------------------- # NOC modules -from noc.core.script.base import BaseScript +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript from noc.sa.interfaces.igetinventory import IGetInventory class Script(BaseScript): name = "Nateks.FlexGainACE16.get_inventory" interface = IGetInventory - - def execute(self): - v = self.scripts.get_version() - return [ - { - "type": "CHASSIS", - "vendor": "Nateks", - "part_no": [v["platform"]], - "serial": v["attributes"]["Serial Number"], - } - ] diff --git a/sa/profiles/Nateks/FlexGainACE24/get_inventory.py b/sa/profiles/Nateks/FlexGainACE24/get_inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..d264e4b6ba5bb305eb830570dc66984844b1d6c4 --- /dev/null +++ b/sa/profiles/Nateks/FlexGainACE24/get_inventory.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# --------------------------------------------------------------------- +# Nateks.FlexGainACE24.get_inventory +# --------------------------------------------------------------------- +# Copyright (C) 2007-2019 The NOC Project +# See LICENSE for details +# --------------------------------------------------------------------- + +# NOC modules +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript +from noc.sa.interfaces.igetinventory import IGetInventory + + +class Script(BaseScript): + name = "Nateks.FlexGainACE24.get_inventory" + interface = IGetInventory diff --git a/sa/profiles/Nateks/NetXpert/get_inventory.py b/sa/profiles/Nateks/NetXpert/get_inventory.py index 288785e718fe2f42f3b140ca1897214b141df3de..7852455368dafc48e4e2f6a56f52b37529ead44e 100644 --- a/sa/profiles/Nateks/NetXpert/get_inventory.py +++ b/sa/profiles/Nateks/NetXpert/get_inventory.py @@ -7,21 +7,10 @@ # --------------------------------------------------------------------- # NOC modules -from noc.core.script.base import BaseScript +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript from noc.sa.interfaces.igetinventory import IGetInventory class Script(BaseScript): name = "Nateks.NetXpert.get_inventory" interface = IGetInventory - - def execute(self): - v = self.scripts.get_version() - return [ - { - "type": "CHASSIS", - "vendor": "Nateks", - "part_no": [v["platform"]], - "serial": v["attributes"]["Serial Number"], - } - ] diff --git a/sa/profiles/Nateks/NetXpert/get_version.py b/sa/profiles/Nateks/NetXpert/get_version.py index eeb135b2baae6a6b367bc6d4fc235a66d628c98c..6e3a0ed28f098a3124e9a35e8c475bad3a5607c6 100644 --- a/sa/profiles/Nateks/NetXpert/get_version.py +++ b/sa/profiles/Nateks/NetXpert/get_version.py @@ -1,12 +1,11 @@ # -*- coding: utf-8 -*- # --------------------------------------------------------------------- -# Nateks.flexgain.get_version +# Nateks.NetXpert.get_version # --------------------------------------------------------------------- # Copyright (C) 2007-2016 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- -""" -""" + # Python modules import re diff --git a/sa/profiles/Orion/NOS/get_inventory.py b/sa/profiles/Orion/NOS/get_inventory.py index 2cfa32d13765c8fefd8ff79b00fd9584a242ad61..595853dfecef4aeaecefcda8908de610d5d3e2c8 100644 --- a/sa/profiles/Orion/NOS/get_inventory.py +++ b/sa/profiles/Orion/NOS/get_inventory.py @@ -2,28 +2,15 @@ # --------------------------------------------------------------------- # Orion.NOS.get_inventory # --------------------------------------------------------------------- -# Copyright (C) 2007-2018 The NOC Project +# Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # --------------------------------------------------------------------- -""" -""" + # NOC modules -from noc.core.script.base import BaseScript +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript from noc.sa.interfaces.igetinventory import IGetInventory class Script(BaseScript): name = "Orion.NOS.get_inventory" interface = IGetInventory - - def execute_cli(self): - v = self.profile.get_version(self) - return [ - { - "type": "CHASSIS", - "vendor": "Orion", - "part_no": v["platform"], - "revision": v["hardware"], - "serial": v["serial"], - } - ] diff --git a/sa/profiles/Planet/WGSD/get_inventory.py b/sa/profiles/Planet/WGSD/get_inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..f843dd03813af46d6d09ccf14aa0d1f18197685c --- /dev/null +++ b/sa/profiles/Planet/WGSD/get_inventory.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# --------------------------------------------------------------------- +# Planet.WGSD.get_inventory +# --------------------------------------------------------------------- +# Copyright (C) 2007-2019 The NOC Project +# See LICENSE for details +# --------------------------------------------------------------------- + +# NOC modules +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript +from noc.sa.interfaces.igetinventory import IGetInventory + + +class Script(BaseScript): + name = "Planet.WGSD.get_inventory" + interface = IGetInventory diff --git a/sa/profiles/Proscend/SHDSL/get_inventory.py b/sa/profiles/Proscend/SHDSL/get_inventory.py index ed8681b4e96a32bd9e443ed4650634ae6dcc3de2..afcdb77bf85260f7ae9daf2a088656bd8cf94932 100644 --- a/sa/profiles/Proscend/SHDSL/get_inventory.py +++ b/sa/profiles/Proscend/SHDSL/get_inventory.py @@ -7,21 +7,10 @@ # --------------------------------------------------------------------- # NOC modules -from noc.core.script.base import BaseScript +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript from noc.sa.interfaces.igetinventory import IGetInventory class Script(BaseScript): name = "Proscend.SHDSL.get_inventory" interface = IGetInventory - - def execute(self): - v = self.scripts.get_version() - return [ - { - "type": "CHASSIS", - "vendor": "Proscend", - "part_no": [v["platform"]], - "serial": v["attributes"]["Serial Number"], - } - ] diff --git a/sa/profiles/Qtech/QSW2500/get_inventory.py b/sa/profiles/Qtech/QSW2500/get_inventory.py index 79eb881ef798f852fdcd8bd5111d06553316177f..aaa92f0c6111b5a2f6e7eb14afb148b6046dd46a 100644 --- a/sa/profiles/Qtech/QSW2500/get_inventory.py +++ b/sa/profiles/Qtech/QSW2500/get_inventory.py @@ -7,21 +7,10 @@ # --------------------------------------------------------------------- # NOC modules -from noc.core.script.base import BaseScript +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript from noc.sa.interfaces.igetinventory import IGetInventory class Script(BaseScript): name = "Qtech.QSW2500.get_inventory" interface = IGetInventory - - def execute(self): - v = self.scripts.get_version() - return [ - { - "type": "CHASSIS", - "vendor": "Qtech", - "part_no": [v["platform"]], - "serial": v["attributes"]["Serial Number"], - } - ] diff --git a/sa/profiles/Rubytech/l2ms/get_inventory.py b/sa/profiles/Rubytech/l2ms/get_inventory.py index 5e37754c09ff970abb5eebe6217cb349f4cc64e3..c2c8c1eebfaeabd3b2f39ea325a72cd6ea7e1d4f 100644 --- a/sa/profiles/Rubytech/l2ms/get_inventory.py +++ b/sa/profiles/Rubytech/l2ms/get_inventory.py @@ -7,21 +7,10 @@ # --------------------------------------------------------------------- # NOC modules -from noc.core.script.base import BaseScript +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript from noc.sa.interfaces.igetinventory import IGetInventory class Script(BaseScript): name = "Rubytech.l2ms.get_inventory" interface = IGetInventory - - def execute(self): - v = self.scripts.get_version() - return [ - { - "type": "CHASSIS", - "vendor": "Rubytech", - "part_no": [v["platform"]], - "serial": v["attributes"]["Serial Number"], - } - ] diff --git a/sa/profiles/TFortis/PSW/get_inventory.py b/sa/profiles/TFortis/PSW/get_inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..8f5358b794563e5dc61148a91b89893abfb2834f --- /dev/null +++ b/sa/profiles/TFortis/PSW/get_inventory.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# --------------------------------------------------------------------- +# TFortis.PSW.get_inventory +# --------------------------------------------------------------------- +# Copyright (C) 2007-2019 The NOC Project +# See LICENSE for details +# --------------------------------------------------------------------- + +# NOC modules +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript +from noc.sa.interfaces.igetinventory import IGetInventory + + +class Script(BaseScript): + name = "TFortis.PSW.get_inventory" + interface = IGetInventory diff --git a/sa/profiles/Ubiquiti/AirOS/get_inventory.py b/sa/profiles/Ubiquiti/AirOS/get_inventory.py index 669bd99d6df2d42cefbc1d8882bc21b94a6f6d4e..5df0355e81e7c01bb564287f9b1f61025ae39828 100644 --- a/sa/profiles/Ubiquiti/AirOS/get_inventory.py +++ b/sa/profiles/Ubiquiti/AirOS/get_inventory.py @@ -7,14 +7,10 @@ # --------------------------------------------------------------------- # NOC modules -from noc.core.script.base import BaseScript +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript from noc.sa.interfaces.igetinventory import IGetInventory class Script(BaseScript): name = "Ubiquiti.AirOS.get_inventory" interface = IGetInventory - - def execute(self): - v = self.scripts.get_version() - return [{"type": "CHASSIS", "vendor": "UBIQUITI", "part_no": [v["platform"]]}] diff --git a/sa/profiles/Vitesse/VSC/get_inventory.py b/sa/profiles/Vitesse/VSC/get_inventory.py index 5648d47b213717680e060493cd24987015aa647a..f1628476b44f21fe9c71c5812427803cfa23cbfb 100644 --- a/sa/profiles/Vitesse/VSC/get_inventory.py +++ b/sa/profiles/Vitesse/VSC/get_inventory.py @@ -7,14 +7,10 @@ # --------------------------------------------------------------------- # NOC modules -from noc.core.script.base import BaseScript +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript from noc.sa.interfaces.igetinventory import IGetInventory class Script(BaseScript): name = "Vitesse.VSC.get_inventory" interface = IGetInventory - - def execute_cli(self): - v = self.scripts.get_version() - return [{"type": "CHASSIS", "vendor": "VITESSE", "part_no": [v["platform"]]}] diff --git a/sa/profiles/ZTE/ZXDSL98xx/get_inventory.py b/sa/profiles/ZTE/ZXDSL98xx/get_inventory.py new file mode 100644 index 0000000000000000000000000000000000000000..5ccd81ad5fa5deacabc3318556cac4a0c892578e --- /dev/null +++ b/sa/profiles/ZTE/ZXDSL98xx/get_inventory.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# --------------------------------------------------------------------- +# ZTE.ZXDSL98xx.get_inventory +# --------------------------------------------------------------------- +# Copyright (C) 2007-2019 The NOC Project +# See LICENSE for details +# --------------------------------------------------------------------- + +# NOC modules +from noc.sa.profiles.Generic.get_inventory import Script as BaseScript +from noc.sa.interfaces.igetinventory import IGetInventory + + +class Script(BaseScript): + name = "ZTE.ZXDSL98xx.get_inventory" + interface = IGetInventory