hansken_extraction_plugin.api.plugin_info
This module contains all definitions to describe meta data of a plugin, a.k.a. PluginInfo.
Classes
|
The author of an Extraction Plugin. |
|
This class represents the maturity level of an extraction plugin. |
|
Identifier of a plugin, consisting of domain, category and name. |
|
This information is used by Hansken to identify and run the plugin. |
|
PluginResources contains information about how many resources will be used for a plugin. |
- class Author(name: str, email: str, organisation: str)[source]
Bases:
object
The author of an Extraction Plugin.
This information can be retrieved by an end-user from Hansken.
- name: str
- email: str
- organisation: str
- class MaturityLevel(value)[source]
Bases:
Enum
This class represents the maturity level of an extraction plugin.
- PROOF_OF_CONCEPT = 0
- READY_FOR_TEST = 1
- PRODUCTION_READY = 2
- class PluginId(domain: str, category: str, name: str)[source]
Bases:
object
Identifier of a plugin, consisting of domain, category and name. Needs to be unique among all tools/plugins.
- domain: str
- category: str
- name: str
- class PluginResources(maximum_cpu: float | None = None, maximum_memory: int | None = None, maximum_workers: int | None = None)[source]
Bases:
object
PluginResources contains information about how many resources will be used for a plugin.
- maximum_cpu: float | None = None
CPU resources are measured in cpu units. One cpu is equivalent to 1 vCPU/Core for cloud providers and 1 hyperthread on bare-metal Intel processors. Also, fractional requests are allowed. A plugin that asks 0.5 CPU uses half as much CPU as one that asks for 1 CPU.
- maximum_memory: int | None = None
Max usable memory for a plugin, measured in megabytes.
- maximum_workers: int | None = None
The number of concurrent workers(i.e. traces that can be processed).
- class PluginInfo(id: PluginId, version: str, description: str, author: Author, maturity: MaturityLevel, matcher: str, webpage_url: str, license: str | None = None, deferred_iterations: int = 1, resources: PluginResources | None = None)[source]
Bases:
object
This information is used by Hansken to identify and run the plugin.
Note that the build_plugin.py build script is used to build a plugin docker image with PluginInfo docker labels.
- version: str
version of the plugin
- description: str
short description of the functionality of the plugin
- maturity: MaturityLevel
maturity level, see MaturityLevel
- matcher: str
this matcher selects the traces offered to the plugin
- webpage_url: str
plugin url
- license: str | None = None
license of this plugin
- deferred_iterations: int = 1
number of deferred iterations (1 to 20), nly for deferred plugins (optional)
- resources: PluginResources | None = None
resources to be reserved for a plugin (optional)