Discover this year's submissions to the Dataiku Frontrunner Awards and give kudos to your favorite use cases and success stories!READ MORE

dss url in macro

Solved!
NN
Neuron
Neuron
dss url in macro

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.

0 Kudos
1 Solution
Andrey
Dataiker Alumni

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

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

 

Andrey Avtomonov
R&D Engineer @ Dataiku

View solution in original post

0 Kudos
4 Replies
Andrey
Dataiker Alumni

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,

Andrey Avtomonov
R&D Engineer @ Dataiku
0 Kudos
NN
Neuron
Neuron
Author

@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.

0 Kudos
Andrey
Dataiker Alumni

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

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

 

Andrey Avtomonov
R&D Engineer @ Dataiku
0 Kudos
NN
Neuron
Neuron
Author

Thanks Andrey..

0 Kudos