Programmatically access the plugin's state

Tomas
Tomas Registered, Neuron 2022 Posts: 121 ✭✭✭✭✭✭

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

  • YashasV
    YashasV Dataiker, Dataiku DSS Core Designer Posts: 9 Dataiker

    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!

  • Tomas
    Tomas Registered, Neuron 2022 Posts: 121 ✭✭✭✭✭✭

    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.

  • YashasV
    YashasV Dataiker, Dataiku DSS Core Designer Posts: 9 Dataiker

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

Setup Info
    Tags
      Help me…