The Host of the running WebApp Python

Solved!
MYassine
Level 2
The Host of the running WebApp Python

Hi,

I am building a dataset with dataikuapi in a webapp with the code below in the designer node :

client = dataikuapi.DSSClient(DESIGNER_HOST,APIKEY)
project = client.get_default_project()
dataset = project.get_dataset(dataset_name)
dataset.build(job_type="RECURSIVE_BUILD")

 However i would like to deploy the webapp  to automation node and i  would like to know if it is possible to know with Dataikuapi in witch host the Webapp is running to call the right host.

Thanks in advance,

Yassine

 

0 Kudos
1 Solution
AlexT
Dataiker

Hi @MYassine ,

If I understand correctly you could define a global variable on both design and automation in global variables for example:

{"instance_hostname":"actual-hostname:port"}

Then use get_customer_variables()

instance_hostname=dataiku.get_custom_variables()['instance_hostname']

 

Screenshot 2021-11-04 at 17.43.42.png

Let me know if this would work in your case.

View solution in original post

0 Kudos
2 Replies
AlexT
Dataiker

Hi @MYassine ,

If I understand correctly you could define a global variable on both design and automation in global variables for example:

{"instance_hostname":"actual-hostname:port"}

Then use get_customer_variables()

instance_hostname=dataiku.get_custom_variables()['instance_hostname']

 

Screenshot 2021-11-04 at 17.43.42.png

Let me know if this would work in your case.

0 Kudos
MYassine
Level 2
Author

Thanks ๐Ÿ™‚ it will works 

0 Kudos