Parameter Types Client Methods#
This page lists all relevant methods for Dioptra Plugin Parameter Types 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
Plugin Parameter Types - CRUD methods#
After importing and initializing the client, these methods for creating, reading, updating, and deleting (CRUD) Plugin Parameter Types can be executed via client.plugin_parameter_types.METHOD_NAME().
Create Plugin Parameter Type#
- PluginParameterTypesCollectionClient.create(group_id: int, name: str, description: str | None = None, structure: dict[str, Any] | None = None) dioptra.client.plugin_parameter_types.T[source]#
Creates a plugin parameter type.
- Parameters
group_id – The id of the group that will own the plugin parameter type.
name – The name of the new plugin parameter type.
description – The description of the new plugin parameter type. Optional, defaults to None.
structure – Used to declare the internal structure of a plugin parameter type. If None, then the plugin parameter type is a simple type. Optional, defaults to None.
- Returns
The response from the Dioptra API.
Get Plugin Parameter Types#
- PluginParameterTypesCollectionClient.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.plugin_parameter_types.T[source]#
Get a list of plugin parameter types.
- Parameters
group_id – The group id the plugin parameter types belong to. If None, return plugin parameter types 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 plugin parameter types 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 plugin parameter types using the Dioptra API’s query language. Optional, defaults to None.
- Returns
The response from the Dioptra API.
Get Plugin Parameter Type by ID#
- PluginParameterTypesCollectionClient.get_by_id(plugin_parameter_type_id: str | int) dioptra.client.plugin_parameter_types.T[source]#
Get the plugin parameter type matching the provided id.
- Parameters
plugin_parameter_type_id – The plugin parameter type id, an integer.
- Returns
The response from the Dioptra API.
Modify Plugin Parameter Type#
- PluginParameterTypesCollectionClient.modify_by_id(plugin_parameter_type_id: str | int, name: str, description: str | None, structure: dict[str, Any] | None) dioptra.client.plugin_parameter_types.T[source]#
Modify the plugin parameter type matching the provided id.
- Parameters
plugin_parameter_type_id – The plugin parameter type id, an integer.
name – The new name of the plugin parameter type.
description – The new description of the plugin parameter type. To remove the description, pass None.
structure – The internal structure of a plugin type. If None, then the plugin parameter type is a simple type. To convert a structured type to a simple type, pass None. Optional, defaults to None.
- Returns
The response from the Dioptra API.
Delete Plugin Parameter Type#
- PluginParameterTypesCollectionClient.delete_by_id(plugin_parameter_type_id: str | int) dioptra.client.plugin_parameter_types.T[source]#
Delete the plugin parameter type matching the provided id.
- Parameters
plugin_parameter_type_id – The plugin parameter type id, an integer.
- Returns
The response from the Dioptra API.
Snapshots of Plugin Parameter Types - Methods#
Methods belonging to the SnapshotsSubCollectionClient can are accessed via the snapshots property of the Plugin Parameter Types Client (which points to SnapshotsSubCollectionClient)
Example - Get snapshots for a Plugin Parameter Type
client.plugin_parameter_types.snapshots.get(1)
See available methods for the SnapshotsSubCollectionClient: