Workflows Client Methods#

This page lists all relevant methods for Dioptra Workflows that are available via the Python Client.

Requirements#

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 – A public github.com or gitlab.com HTTPS repository URL, a DioptraFile containing an archive file, or a list[DioptraFile] containing resource files. Repository URLs accept an optional .git suffix and #REF for a branch, tag, or commit. Omitting #REF selects the default branch. Repository imports download a tar snapshot; semicolon path selections are not supported.

  • 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. This path is relative to the import root. Plugin and entrypoint paths are relative to the config directory and must stay inside the import root.

  • 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#

Use the workflow method below to analyze plugin task signatures.

Validate Entrypoint#

For entrypoint dry runs, use client.entrypoints.create(..., validate_only=True) or client.entrypoints.modify_by_id(..., validate_only=True). See Entrypoints - Validation Dry Runs for the supported interface and its validation behavior.

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.