Programmatically access the plugin's state

tomas
Level 5
Programmatically access the plugin's state

Hi,

 the current (DSS11) version of DSS supports an API access to plugin settings. 

https://doc.dataiku.com/dss/latest/python-api/plugins.html

But it is not possible to get the information about the git repository or whether it is a store or git based plugin.

Tried:

def get_state(client, p):
    plugin = client.get_plugin(p['id'])
    plugin_settings = plugin.get_settings()
    # plugin_settings is a dict but does not contain the state info

The workaround seems to me to read directly from file systems these files:

${datadir}/plugins/installed/}/state.json
{
  "actions": [
    {
      "ts": 1665065293515,
      "action": "INSTALL",
      "user": "<user_id>"
    }
  ],
  "gitState": {
    "enabled": true,
    "repository": "<GIT URL>",
    "path": "dssplugins/<plugin id>",
    "checkout": "<branch name>"
  }
}

 

Or is there any other way how to report what is the source of the plugin?

3 Replies
YashasV
Developer Advocate

Hi @tomas, thanks for your question. It is indeed not possible to confirm whether a plugin is a store-downloaded or git-based or get the information about the git repository using the python API: https://doc.dataiku.com/dss/latest/python-api/plugins.html

What's your use case? It might make for a good Product Idea.

Cheers!

0 Kudos
tomas
Level 5
Author

My case is developing terraform like declarative way of plugins definitions (among other resources) to manage DSS servers, so that administrators do not need to interact with Administration section in UI but only run code-changes in version control and trigger CD workflows.

 

0 Kudos
YashasV
Developer Advocate

Hi @tomas, thanks for describing the use case. I'll log the interest in terraform-like templates with Product.

0 Kudos