Programmatically access the plugin's state

Options
tomas
tomas Registered, Neuron 2022 Posts: 120 ✭✭✭✭✭

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?

Answers

Setup Info
    Tags
      Help me…