Submit your innovative use case or inspiring success story to the 2023 Dataiku Frontrunner Awards! LET'S GO

create publicly accessible read only variable

Solved!
tomas
create publicly accessible read only variable
Hi,

I would like to set on the instance level of the DSS a variable what will be readable by everyone in python. When I store something on the global variables section it is readable only by admins. Other users get:

client=dataiku.api_client()
print(client.get_variables().get('env_specific'))

dataikuapi.utils.DataikuException: com.dataiku.dip.exceptions.UnauthorizedException: Action forbidden, you are not admin

Thanks for any tips/advise,
0 Kudos
1 Solution
Alex_Combessie
Dataiker Alumni

Hi,



You can use:




import dataiku
dataiku.get_custom_variables()


Cheers,



Alex

View solution in original post

4 Replies
Alex_Combessie
Dataiker Alumni

Hi,



You can use:




import dataiku
dataiku.get_custom_variables()


Cheers,



Alex

tomas
Author
Supplem question: if I want to store a variable what is visible only for admins, how can I achieve this? Thanks
0 Kudos
Alex_Combessie
Dataiker Alumni
There is no such concept as "a variable visible only for an admin" as an instance variable. You would need to emulate that behavior by creating a project accessible only to the admin group, and store your variables in there as project variables.
0 Kudos
tomas
Author
Thanks!
0 Kudos