queenbee.plugin.plugin module¶
Queenbee Plugin class.
- class queenbee.plugin.plugin.DockerConfig(*, type: ConstrainedStrValue = 'DockerConfig', annotations: Dict[str, Any] = None, image: str, registry: str = None, workdir: str)[source]¶
Bases:
BaseModel
Plugin Configuration to run in a Docker container
- image: str¶
- registry: str¶
- type: ConstrainedStrValue¶
- workdir: str¶
- class queenbee.plugin.plugin.LocalConfig(*, type: ConstrainedStrValue = 'LocalConfig', annotations: Dict[str, Any] = None)[source]¶
Bases:
BaseModel
Plugin Configuration to run on a desktop.
- type: ConstrainedStrValue¶
- class queenbee.plugin.plugin.Plugin(*, type: ConstrainedStrValue = 'Plugin', annotations: Dict[str, Any] = None, api_version: ConstrainedStrValue = 'v1beta1', metadata: MetaData, config: PluginConfig, functions: List[Function])[source]¶
Bases:
BaseModel
A Queenbee Plugin.
A plugin contains runtime configuration for a Command Line Interface (CLI) and a list of functions that can be executed using this CLI tool.
- api_version: ConstrainedStrValue¶
- config: PluginConfig¶
- classmethod from_folder(folder_path: str)[source]¶
Generate a plugin from a folder
Note
Here is an example of a plugin folder:
. ├── functions │ ├── function-1.yaml │ ├── function-2.yaml │ ├── ....yaml │ └── function-n.yaml ├── config.yaml └── package.yaml
- Parameters:
folder (folder_path {str} -- Path to the) –
- Returns:
Plugin – A plugin
- classmethod sort_list(v: list) list [source]¶
Sort functions list by name
- Parameters:
functions (v {list} -- Unsorted list of) –
- Returns:
list – Sorted list of functions
- to_folder(folder_path: str, *, readme_string: Optional[str] = None)[source]¶
Write a plugin to a folder
Note
Here is an example of a plugin folder:
. ├── functions │ ├── function-1.yaml │ ├── function-2.yaml │ ├── ....yaml │ └── function-n.yaml ├── config.yaml └── package.yaml
- Parameters:
to (folder_path {str} -- Path to write the folder) –
- Keyword Arguments:
(default (readme_string {str} -- The README file string) – {None})
- type: ConstrainedStrValue¶
- class queenbee.plugin.plugin.PluginConfig(*, type: ConstrainedStrValue = 'PluginConfig', annotations: Dict[str, Any] = None, docker: DockerConfig, local: LocalConfig = None)[source]¶
Bases:
BaseModel
Plugin configuration.
The config is used to schedule functions on a desktop or in other contexts (ie: Docker).
- docker: DockerConfig¶
- local: LocalConfig¶
- type: ConstrainedStrValue¶