Entrypoints Client Methods#
This page lists all relevant methods for Dioptra Entrypoints 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
Entrypoints - CRUD methods#
After importing and initializing the client, these methods for creating, reading, updating, and deleting (CRUD) entrypoints can be executed via client.entrypoints.METHOD_NAME().
Create Entrypoint
~~~~~~~~~~~~~~~~~
- EntrypointsCollectionClient.create(group_id: int, name: str, task_graph: str, artifact_graph: str | None = None, description: str | None = None, parameters: list[dict[str, Any]] | None = None, artifact_parameters: list[dict[str, Any]] | None = None, queues: list[int] | None = None, plugins: list[int] | None = None, artifact_plugins: list[int] | None = None) dioptra.client.entrypoints.T[source]#
Creates a entrypoint.
- Parameters
group_id – The id of the group that will own the entrypoint.
name – The name of the new entrypoint.
task_graph – The task graph for the new entrypoint as a YAML-formatted string.
artifact_graph – The artifact graph for the new entrypoint as a YAML-formatted string. Optional, defaults to None. A None value indicates there are no produced artifacts that need to be stored.
description – The description of the new entrypoint. Optional, defaults to None.
parameters – The list of parameters for the new entrypoint. Optional, defaults to None.
artifact_parameters – The list of artifact parameters for the new entrypoint. Optional, defaults to None.
queues – A list of queue ids to associate with the new entrypoint. Optional, defaults to None.
plugins – A list of plugin ids to associate with the new entrypoint. Optional, defaults to None.
artifact_plugins – A list of artifact plugin ids to associate with the new entrypoint. Optional, defaults to None.
Example
Create an entrypoint called “hello_world” with artifact input parameters and artifact output graph.
entrypoint = client.entrypoints.create( group_id=GROUP_ID, name="hello_world", task_graph=TASK_GRAPH_YAML_STR, artifact_graph=ARTIFACT_TASK_GRAPH_YAML_STR, description="An entrypoint to run hello world task", parameters=[ { "name": "greeting", "defaultValue": "Hello", "parameterType": "string", }, { "name": "name", "defaultValue": "World", "parameterType": "string", }, ], artifact_parameters=[ { "name": "artifact_name", "outputParams": [ {"name": "value", "parameterType": STRING_PARAM_TYPE_ID} ], } ], queues=[QUEUE_ID_1], plugins=[PLUGIN_ID_1], artifact_plugins=[PLUGIN_ID_2], )
- Returns
The response from the Dioptra API.
Get Entrypoints#
- EntrypointsCollectionClient.get(group_id: int | None = None, index: int = 0, page_length: int = 10, sort_by: str | None = None, descending: bool | None = None, search: str | None = None) dioptra.client.entrypoints.T[source]#
Get a list of entrypoints.
- Parameters
group_id – The group id the entrypoints belong to. If None, return entrypoints from all groups that the user has access to. Optional, defaults to None.
index – The paging index. Optional, defaults to 0.
page_length – The maximum number of entrypoints to return in the paged response. Optional, defaults to 10.
sort_by – The field to use to sort the returned list. Optional, defaults to None.
descending – Sort the returned list in descending order. Optional, defaults to None.
search – Search for entrypoints using the Dioptra API’s query language. Optional, defaults to None.
- Returns
The response from the Dioptra API.
Get One Entrypoint#
Modify Entrypoint#
- EntrypointsCollectionClient.modify_by_id(entrypoint_id: str | int, name: str, task_graph: str, artifact_graph: str | None, description: str | None, parameters: list[dict[str, Any]] | None, artifact_parameters: list[dict[str, Any]] | None, queues: list[int] | None) dioptra.client.entrypoints.T[source]#
Modify the entrypoint matching the provided id.
- Parameters
entrypoint_id – The entrypoint id, an integer.
name – The new name of the entrypoint.
task_graph – The new task graph for the entrypoint as a YAML-formatted string.
artifact_graph – The artifact graph for the new entrypoint as a YAML-formatted string. To remove the artifact graph, pass None.
description – The new description of the entrypoint. To remove the description, pass None.
parameters – The new list of parameters for the entrypoint. To remove all parameters, pass None.
artifact_parameters – The list of artifact parameters for the new entrypoint. To remove all artifact parameters, pass None.
queues – The new list of queue ids to associate with the entrypoint. To remove all associated queues, pass None.
- Returns
The response from the Dioptra API.
Delete Entrypoint#
Entrypoint Plugins - Methods#
These methods exist within the class EntrypointPluginsSubCollectionClient, and are accessed via the plugins property of the Entrypoint Client (which points to EntrypointPluginsSubCollectionClient).
Example - Attach Plugins to Entrypoint
Attach Plugins to an Entrypoint
client.entrypoints.plugins.create(entrypoint_id=1, plugin_ids=[2,3])
Add Plugin to Entrypoint#
- EntrypointPluginsSubCollectionClient.create(entrypoint_id: str | int, plugin_ids: list[int]) dioptra.client.entrypoints.T[source]#
Adds one or more plugins to the entrypoint.
If a plugin id matches an plugin that is already attached to the entrypoint, then the entrypoint will update the plugin to the latest version.
- Parameters
entrypoint_id – The entrypoint id, an integer.
plugin_ids – A list of plugin ids that will be registered to the entrypoint.
- Returns
The response from the Dioptra API.
Get Plugins for Entrypoint#
Get One Plugin by ID#
- EntrypointPluginsSubCollectionClient.get_by_id(entrypoint_id: str | int, plugin_id: str | int) dioptra.client.entrypoints.T[source]#
Get the entrypoint plugin matching the provided id.
- Parameters
entrypoint_id – The entrypoint id, an integer.
plugin_id – The id for the plugin that will be removed.
- Returns
The response from the Dioptra API.
Delete One Plugin by ID#
- EntrypointPluginsSubCollectionClient.delete_by_id(entrypoint_id: str | int, plugin_id: str | int) dioptra.client.entrypoints.T[source]#
Remove a plugin from the entrypoint.
- Parameters
entrypoint_id – The entrypoint id, an integer.
plugin_id – The id for the plugin that will be removed.
- Returns
The response from the Dioptra API.
Entrypoint Artifact Plugins - Methods#
These methods exist within the class EntrypointArtifactPluginsSubCollectionClient, and are accessed via the artifact_plugins property of the Entrypoint Client.
Example - Attach Artifact Plugins to Entrypoint
client.entrypoints.artifact_plugins.create(entrypoint_id=1, artifact_plugin_ids=[5])
Add Artifact Plugin to Entrypoint#
- EntrypointArtifactPluginsSubCollectionClient.create(entrypoint_id: str | int, artifact_plugin_ids: list[int]) dioptra.client.entrypoints.T[source]#
Adds one or more artifact plugins to the entrypoint.
If a artifact plugin id matches an artifact plugin that is already attached to the entrypoint, then the entrypoint will update the artifact plugin to the latest version.
- Parameters
entrypoint_id – The entrypoint id, an integer.
artifact_plugin_ids – A list of artifact plugin ids that will be registered to the entrypoint.
- Returns
The response from the Dioptra API.
Get Artifact Plugins for Entrypoint#
Get One Artifact Plugin by ID#
- EntrypointArtifactPluginsSubCollectionClient.get_by_id(entrypoint_id: str | int, artifact_plugin_id: str | int) dioptra.client.entrypoints.T[source]#
Get the entrypoint plugin matching the provided id.
- Parameters
entrypoint_id – The entrypoint id, an integer.
artifact_plugin_id – The id for the plugin that will be retrieved.
- Returns
The response from the Dioptra API.
Delete One Artifact Plugin by ID#
- EntrypointArtifactPluginsSubCollectionClient.delete_by_id(entrypoint_id: str | int, artifact_plugin_id: str | int) dioptra.client.entrypoints.T[source]#
Remove an artifact plugin from the entrypoint.
- Parameters
entrypoint_id – The entrypoint id, an integer.
artifact_plugin_id – The id for the artifact plugin that will be removed.
- Returns
The response from the Dioptra API.
Entrypoint Queues - Methods#
These methods exist within the class EntrypointQueuesSubCollectionClient, and are accessed via the queues property of the Entrypoint Client.
Example - Attach Queues to Entrypoint
client.entrypoints.queues.create(entrypoint_id=1, queue_ids=[10])
Add Queue to Entrypoint#
- EntrypointQueuesSubCollectionClient.create(entrypoint_id: str | int, queue_ids: list[int]) dioptra.client.entrypoints.T[source]#
Adds one or more queues to the entrypoint.
- Parameters
entrypoint_id – The entrypoint id, an integer.
queue_ids – A list of queue ids that will be registered to the entrypoint.
- Returns
The response from the Dioptra API.
Get Queues for Entrypoint#
Replace Attached Queues#
- EntrypointQueuesSubCollectionClient.modify_by_id(entrypoint_id: str | int, queue_ids: list[int]) dioptra.client.entrypoints.T[source]#
Replaces the entrypoint’s full list of queues.
If an empty list is provided, then all queues will be removed from the entrypoint.
- Parameters
entrypoint_id – The entrypoint id, an integer.
queue_ids – A list of queue ids that will replace the current list of entrypoint queues.
- Returns
The response from the Dioptra API.
Delete All Attached Queues#
Delete One Queue by ID#
- EntrypointQueuesSubCollectionClient.delete_by_id(entrypoint_id: str | int, queue_id: str | int) dioptra.client.entrypoints.T[source]#
Remove a queue from the entrypoint.
- Parameters
entrypoint_id – The entrypoint id, an integer.
queue_id – The id for the queue that will be removed.
- Returns
The response from the Dioptra API.
Snapshots of Entrypoint - Methods#
Methods belonging to the EntrypointsSnapshotCollectionClient are accessed via the snapshots property of the Entrypoint Client.
Example - Get snapshots for an Entrypoint
Get snapshots for an Entrypoint
client.entrypoints.snapshots.get(1)
See available methods for the SnapshotsSubCollectionClient: