Community Conundrum 10: The Titanic is now live Learn more

Python API - get dss instance name

Level 2
Python API - get dss instance name

How can I obtain the DSS Instance Name as a variable that I see in DSS Settings?

0 Kudos
3 Replies
Dataiker
Dataiker

Hi John,

You will want to use the get_general_settings() call as can be found in our Python API documentation here:

https://doc.dataiku.com/dss/latest/python-api/rest-api-client/other-administration.html

For example, something like the following should retrieve you the DSS instance name (found under Administration > Settings > Themes & Customizations > DSS instance name)

 

# Instantiate client (assuming code is run from inside DSS)
import dataiku
client = dataiku.api_client()

# Retrieve name from raw settings definition
settings = client.get_general_settings()
name = settings.get_raw()['nodeName']

 

Hopefully, this helps and is what you are looking for! 

Best,

Andrew

Level 2
Author

Hi Andrew,

Thanks for the response.

Does this require an admin account to access this?

Regards,

John

0 Kudos
Dataiker
Dataiker

Hi John,

Yep, that is correct. What you can do through the API is simply an extension of what you can do through the UI with your user. In this case, since only global admin users can view and update general settings, you'll need to be using an admin account or generate a global admin API key if using the APIs outside of DSS.

Thanks,

Andrew 

0 Kudos