base Package¶
base
Package¶
manager
Module¶
- class lemur.plugins.base.manager.PluginManager(class_list=None, instances=True)
Bases:
InstanceManager
- all(version=1, plugin_type=None)
Returns a list of cached instances.
- first(func_name, *args, **kwargs)
- get(slug)
- register(cls)
- unregister(cls)
v1
Module¶
- class lemur.plugins.base.v1.IPlugin
Bases:
_local
Plugin interface. Should not be inherited from directly. A plugin should be treated as if it were a singleton. The owner does not control when or how the plugin gets instantiated, nor is it guaranteed that it will happen, or happen more than once. >>> from lemur.plugins import Plugin >>> >>> class MyPlugin(Plugin): >>> def get_title(self): >>> return ‘My Plugin’ As a general rule all inherited methods should allow
**kwargs
to ensure ease of future compatibility.- author: str | None = None
- author_url: str | None = None
- can_disable = True
- conf_key = None
- conf_title = None
- description: str | None = None
- enabled = True
- get_conf_key()
Returns a string representing the configuration keyspace prefix for this plugin.
- get_conf_title()
Returns a string representing the title to be shown on the configuration page.
- get_description()
Returns the description for this plugin. This is shown on the plugin configuration page. >>> plugin.get_description()
- get_option(name, options)
- get_resource_links()
Returns a list of tuples pointing to various resources for this plugin. >>> def get_resource_links(self): >>> return [ >>> (‘Documentation’, ‘https://lemur.readthedocs.io’), >>> (‘Bug Tracker’, ‘https://github.com/Netflix/lemur/issues’), >>> (‘Source’, ‘https://github.com/Netflix/lemur’), >>> ]
- get_server_options(name)
- get_title()
Returns the general title for this plugin. >>> plugin.get_title()
- get_user_option(name, options)
- is_enabled()
Returns a boolean representing if this plugin is enabled. If
project
is passed, it will limit the scope to that project. >>> plugin.is_enabled()
- options: List[Dict[str, Any]] = []
- resource_links = ()
- slug: str | None = None
- title: str | None = None
- validate_option_value(option_name, value)
- version = None
- class lemur.plugins.base.v1.Plugin
Bases:
IPlugin
A plugin should be treated as if it were a singleton. The owner does not control when or how the plugin gets instantiated, nor is it guaranteed that it will happen, or happen more than once.
- class lemur.plugins.base.v1.PluginMount(name, bases, attrs)
Bases:
type