Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Added on July 16, 2024 2:03PM
Likes: 0
Replies: 1
I'm developing a plugin and I'd like to get the handle of the current plugin to get its name and settings. Similar to client.get_default_project() to get the current project.
Also, is there a way to know which scenario is triggering the plugin?
Is there any way to achieve this?
Not sure what you mean by "current plugin". This code will get you all plugins and their usage:
client = dataiku.api_client() plugins_list = client.list_plugins() for plugin in plugins_list:
plugin_id = plugin['id']
plugin_author = plugin['meta']['author']
plugin_license = plugin['meta']['licenseInfo']
plugin_version = plugin['version']
plugin_handle = client.get_plugin(plugin_id)
plugin_settings = plugin_handle.get_settings().get_raw()
plugin_name = plugin['meta']['label']
plugin_code_env = plugin_settings.get('codeEnvName')
plugin_usages = plugin_handle.list_usages(project_key=None).get_raw() print(f'{plugin_id} - {plugin_name} - {plugin_code_env}')