dss url in macro

NN
NN Neuron, Registered, Neuron 2022, Neuron 2023 Posts: 145 Neuron

Hi All,

Can someone guide me, is there a way to get the dss url in a macro ?

I am on v8.0.1
And i have a macro which is suppose to work across multiple instances of DSS
In the output HTML of the macro i want to include a url link to the dss instance and object created by the macro.
But i am unable to find how to get the url of the instance where this macro is currently running.

Best Answer

  • Andrey
    Andrey Dataiker Alumni Posts: 119 ✭✭✭✭✭✭✭
    edited July 17 Answer ✓

    In case the external URL is specified in the settings it's available by calling:

    self.client.get_general_settings().get_raw().get('studioExternalUrl')

Answers

  • Andrey
    Andrey Dataiker Alumni Posts: 119 ✭✭✭✭✭✭✭
    edited July 17

    Hi,

    In the macro code you can refer to the environment variables set by DSS, for example you can add:

    import os
    print("Dataiku url: ", os.environ.get('DKU_BACKEND_EXT_HOST') + ":" + os.environ.get('DKU_BASE_PORT'))

    However, this approach isn't 100% reliable because depending on your setup there could be an additional proxy between DSS and end-users so the DKU_BACKEND_EXT_HOST + PORT could be unreachable for them.

    Regards,

  • NN
    NN Neuron, Registered, Neuron 2022, Neuron 2023 Posts: 145 Neuron

    @Andrey

    Thanks . What you said seems right. It seems a proxy might be the reason the url i get from your solution is not a 100% match with the url we use.

    We do however mention the actual url in the instance settings>> Notifications and Integrations >> DSS URL

    Is there a way to call this value?
    I know i can use ${dssURL} in the Scenario variables but was just wondering if there was a way to call the same in a macro as well.

  • NN
    NN Neuron, Registered, Neuron 2022, Neuron 2023 Posts: 145 Neuron

    Thanks Andrey..

Setup Info
    Tags
      Help me…