Workflows Client Methods#
This page lists all relevant methods for Dioptra Workflows that are available via the Python Client.
Contents
Requirements#
Install Dioptra - an installation and deployment of Dioptra must be available
Set Up the Python Client - the Python client must be configured and initialized
Workflows - Resource Management#
After importing and initializing the client, these methods can be executed via client.workflows.METHOD_NAME().
Import Resources#
- WorkflowsCollectionClient.import_resources(group_id: int, source: str | dioptra.client.base.DioptraFile | list[dioptra.client.base.DioptraFile], config_path: str | None = None, resolve_name_conflicts_strategy: Optional[Literal['fail', 'update', 'overwrite']] = None)[source]#
Import resources from a archive file or git repository
- Parameters
group_id – The group to import resources into
source – The source to import from. Can be a str containing a git url, a DioptraFile containing an archive file or a list[DioptraFile] containing resource files.
config_path – The path to the toml configuration file in the import source. If None, the API will use “dioptra.toml” as the default. Defaults to None.
resolve_name_conflicts_strategy – The strategy for resolving name conflicts. Either “fail”, “update”, or “overwrite”. If None, the API will use “fail” as the default. Defaults to None.
- Raises
IllegalArgumentError – If more than one import source is provided or if no import source is provided.
Commit Draft#
- WorkflowsCollectionClient.commit_draft(draft_id: str | int) dioptra.client.workflows.T[source]#
Commit a draft as a new resource snapshot.
The draft can be a draft of a new resource or a draft modifications to an existing resource.
- Parameters
draft_id – The draft id, an intiger.
- Returns
A dictionary containing the contents of the new resource.
Workflows - Analysis and Validation#
These methods allow for the validation of entrypoint parameters and the analysis of plugin task signatures within the workflow context.
Validate Entrypoint#
- WorkflowsCollectionClient.validate_entrypoint(group_id: int, task_graph: str, plugin_snapshots: list[int], entrypoint_parameters: list[dict[str, Any]]) dioptra.client.workflows.T[source]#
Validate a set of proposed inputs for an entrypoint resource.
- Parameters
group_id – The ID of the group validating the entrypoint resource.
task_graph – The proposed task graph for the entrypoint resource.
plugin_snapshots – A list of identifiers for the plugin snapshots that will be attached to the Entrypoint resource.
entrypoint_parameters – The proposed list of parameters for the entrypoint resource.
- Returns
The response from the Dioptra API.
Analyze Plugin Task Signatures#
- WorkflowsCollectionClient.analyze_plugin_task_signatures(python_code: str) dioptra.client.workflows.T[source]#
Requests signature analysis for the functions in an annotated python file.
- Parameters
python_code – The contents of the python file.
filename – The name of the file.
- Returns
The response from the Dioptra API.