Plugins#
The API offers methods to:
Install plugins
Uninstall plugins and list their usages
Update plugins
Read and write plugin settings
Create and update plugin code envs
List macros that can be run
Run macros
Installing plugins#
From a Zip file#
with open("myplugin.zip", "rb") as f:
client.install_plugin_from_archive(f)
From the Dataiku plugin store#
future = client.install_plugin_from_store("googlesheets")
future.wait_for_result()
From a Git repository#
future = client.install_plugin_from_git("[email protected]:myorg/myrepo")
future.wait_for_result()
Uninstalling plugins#
Listing usages of a plugin#
plugin = client.get_plugin('my-plugin-id')
usages = plugin.list_usages()
Uninstalling a plugin#
plugin = client.get_plugin('my-plugin-id')
future = plugin.delete()
Plugin deletion fails if a usage is detected. It can be forced with force=True
:
plugin = client.get_plugin('my-plugin-id')
future = plugin.delete(force=True)
Managing code envs#
plugin = client.get_plugin("myplugin")
# Start creating the code env, and wait for it to be done
future = plugin.create_code_env()
result = future.wait_for_result()
# NB: If the plugin requires Python 3.9 for example, you will use something like:
# future = plugin.create_code_env(python_interpreter="PYTHON39")
# result = future.wait_for_result()
# Now the code env is created, but we still need to configure the plugin to use it
settings = plugin.get_settings()
settings.set_code_env(result["envName"])
settings.save()
Handling settings#
plugin = client.get_plugin("myplugin")
# Obtain the current settings
settings = plugin.get_settings()
raw_settings = settings.get_raw()
# Modify the settings
# ...
# And save them back
settings.save()
Reference documentation#
Classes#
|
A future represents a long-running task on a DSS instance. |
|
A macro on the DSS instance. |
Information on a type not found while analyzing usages of a plugin. |
|
|
A plugin on the DSS instance. |
The settings of a plugin. |
|
A parameter set in a plugin. |
|
Information on a usage of an element of a plugin. |
|
Information on a type not found while analyzing usages of a plugin. |
|
Information on the usages of a plugin. |
Functions#
|
Start the creation of the code env of the plugin. |
|
Delete a plugin. |
|
Get a handle to interact with a specific plugin |
Get the plugin-level settings. |
|
Install a plugin from a plugin archive (as a file object) |
|
|
Install a plugin from a Git repository. |
|
Install a plugin from the Dataiku plugin store |
|
Get the list of usages of the plugin. |
|
Save the settings to DSS. |
|
Set the name of the code env to use for this plugin. |
Waits for the completion of the long-running task, and returns its result. |