Plugin usage restriction

vishet Registered Posts: 17 ✭✭✭✭


Is there a way to restrict the plugin usage? I mean, limit the plugin usage to say 10 API calls a day or something of the sort?

Also, would it be possible to remove that limit at a later point in time? If so, could you give me some insight on the same? I understand that there is a functionality called as resource keys, but I am not too sure on how to apply them on my use case.

Best Answer

  • tim-wright
    tim-wright Partner, L2 Designer, Snowflake Advanced, Neuron 2020, Registered, Neuron 2021, Neuron 2022 Posts: 77 Partner
    Answer ✓

    , Are you referring to a plugin you are developing or that you plan to develop? Or one that is already being used? Would you mind explaining why you're attempting to do this?

    I am not aware of an inbuilt feature to do this, though one may exist. A workaround that I can see potentially working (if you are somewhat famiilar with the dataiku APIs) is the following. This limit would be at the global level - not on a per-user basis.

    1. Set a global variable with the "remaining_daily_plugin_x_limit" you want (e.g. 10)

    2. In your plugin embed the logic to check the "remaining_daily_plugin_x_limit" is >0, run the plugin logic and then decrement the "remaining_daily_plugin_x_limit" variable by 1 each time it is used (will require you to use dataiku APIs).

    3. Write a scenario that runs each night at midnight (or some other time) to reset the "remaining_daily_plugin_x_limit" back to 10 (or whatever your limit is)

    This would enable you to simply modify the scenario in step 3. to whatever limit (or time interval) you see fit in the future.

Setup Info
      Help me…