Python API - get dss instance name

Options
JohnB
JohnB Registered Posts: 32 ✭✭✭✭✭

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

Best Answer

  • ATsao
    ATsao Dataiker Alumni, Registered Posts: 139 ✭✭✭✭✭✭✭✭
    edited July 17 Answer ✓
    Options

    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

Answers

  • JohnB
    JohnB Registered Posts: 32 ✭✭✭✭✭
    Options

    Hi Andrew,

    Thanks for the response.

    Does this require an admin account to access this?

    Regards,

    John

  • ATsao
    ATsao Dataiker Alumni, Registered Posts: 139 ✭✭✭✭✭✭✭✭
    Options

    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

Setup Info
    Tags
      Help me…