Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
I have a requirement where I need to run a DSS scenario via Endpoint url and I have tried multiple ways to approach this but the issue seems to be while creating a client object.
Received the following error for point 2 and 3:
It would be really helpful if you can provide a solution for this. Any help is appreciated, Thankyou.
Code for your reference:
import pandas as pd, numpy as np
client = dataikuapi.DSSClient("http://http(s)://IP:16000", "personal_api_secret_key")
#client = dataiku.api_client()
project = client.get_project('project_name')
variables = project.get_variables()
variables["standard"]["param"] = param
scenario = project.get_scenario('scenario_name')
trigger_fire = scenario.run()
scenario_run = trigger_fire.wait_for_scenario_run()
if not scenario_run.running:
last_runs = scenario.get_last_runs(only_finished_runs=True)
if last_runs.outcome == 'SUCCESS':
val = 'SUCESS'
except Exception as e:
val = str(e)
The URL you passed to instantiate the client object seems to be malformed. For example, if your instance lives at https://example.com, the client object should be created as follows:
client = dataikuapi.DSSClient("https://example.com", "personal_api_secret_key")
If you usually access your instance directly via its IPv4 public address, then you should specify which port you are targeting, for example if the IP is 220.127.116.11 and the port is 16000:
client = dataikuapi.DSSClient("http://18.104.22.168:16000", "personal_api_secret_key")
Hope this helps.
Hi @HarizoR ,
Thankyou for you reply.
I tried both the URLs (http and http(s)) but got error in both:
Result: Invalid URL 'http(s)://22.214.171.124:16000/dip/publicapi/projects/PROJECT_NAME/variables/': No schema supplied. Perhaps you meant http://http(s)://126.96.36.199:16000/dip/publicapi/projects/PROJECT_NAME/variables/?
Could you please tell me if I am missing any step here?
Also, Is the method of generating API Id and secret key correct? Profile -> APIKey -> New Key -> id & secret key.
In a standard URL you specify either http or https, you can't have both at the same time. In practice, it means that a URL beginning with http://http(s):// is not valid. To make sure that you are using the correct URL to reach your DSS instance, please refer to the content of your browser's navigation bar when you visit it. Don't hesitate to ask the administrator of your DSS instance if you have further doubts.
As for the key generation process, I confirm that it is the correct one to create personal API keys.