def load_plugins(): """ Loads and registers externally installed Portal plugins. """ ## example entry points for setup.py file: # entry_points={ # 'portal.plugins': [ # 'portal_fancy_report = portal_fancy_report.plugins:FancyReportPlugin' # ], # }, for ep in pkg_resources.iter_entry_points('portal.plugins'): try: plugin = ep.load() except Exception: import traceback msg = "Failed to load plugin %r:\n%s" % (ep.name, traceback.format_exc()) print >> sys.stderr, msg else: register(plugin)
# Copyright (c) 2015 Riverbed Technology, Inc. # # This software is licensed under the terms and conditions of the MIT License # accompanying the software ("License"). This software is distributed "AS IS" # as set forth in the License. from steelscript.appfwk.apps.plugins import Plugin, register class WhoisReport(Plugin): title = 'Whois Report Plugin' description = 'Example Plugin providing report and helper script' version = '0.1' author = 'Riverbed Technology' enabled = True can_disable = True reports = ['reports'] libraries = ['libs'] register(WhoisReport)
# Copyright (c) 2015 Riverbed Technology, Inc. # # This software is licensed under the terms and conditions of the MIT License # accompanying the software ("License"). This software is distributed "AS IS" # as set forth in the License. from steelscript.appfwk.apps.plugins import Plugin, register class SolarwindsPlugin(Plugin): title = 'Solarwinds Datasource Plugin' description = 'A Portal datasource plugin with example report' version = '0.1' author = 'Riverbed Technology' enabled = False # turn this off by default can_disable = True devices = ['devices'] datasources = ['datasources'] reports = ['reports'] register(SolarwindsPlugin)
try: import sharepoint import ntlm import lxml except ImportError: note = """ <br><b>IMPORTANT NOTE</b>: additional python packages need to be installed in order to use this Plugin:<br> <blockquote> sharepoint>=0.3.2,<=0.4<br> python-ntlm==1.0.1<br> </blockquote> """ class SharepointPlugin(Plugin): title = 'Sharepoint Datasource Plugin' description = ('A Portal datasource plugin to interact with Sharepoint ' 'devices and services.<br>' + note) version = '0.1.1' author = 'Riverbed Technology' enabled = False can_disable = True devices = ['devices'] datasources = ['datasources'] reports = ['reports'] register(SharepointPlugin)
class MetricsPlugin(Plugin): title = 'Example Metrics Plugin' description = 'Plugin demonstrating how to utilize and extend metrics' version = '0.1' author = 'Riverbed Technology' enabled = True can_disable = True reports = ['reports'] libraries = ['libs'] register(MetricsPlugin) # # Custom Metrics - All code below goes in plugin models.py # def status_text(metric, status): """Create a consolidated status string for JS formatter. Takes a Metric object and a ``status`` text string for input. """ status_map = { None: 'gray', '': 'gray', 'None': 'gray', 'Operational': 'green',