Scenarios
I have 2 questions:
1) I have 20 scenarios which I want to trigger. Is there any way to see the running status of all the scenarios at once ? and any way to filter out all the scenarios which failed ?
2) (related to ques. 1 only). Is there any custom way to automatically re-trigger all the scenarios which failed in the initial run ?
Answers
-
Hi,
the public API has a https://doc.dataiku.com/dss/latest/python-api/client.html?highlight=list_running_scenarios#dataikuapi.DSSClient.list_running_scenarios call to know what's running. To know the last result of a scenario, the public python API also allows this with
import dataiku c = dataiku.api_client() p = c.get_default_project() for s in p.list_scenarios(as_type="objects"): try: r = s.get_last_finished_run() print("%s -> %s" % (s.id, r.outcome)) except: print("%s -> no run yet" % (s.id))
About the question of re-triggering, you can start scenarios from the public API too, with https://doc.dataiku.com/dss/latest/python-api/scenarios.html#dataikuapi.dss.scenario.DSSScenario.run_and_wait or run(). There are examples at https://doc.dataiku.com/dss/latest/python-api/scenarios.html .
But in such cases, if you want to run scenarios with retry capabilities, you should consider using a script-based scenario instead of a step-based one, and use https://doc.dataiku.com/dss/latest/python-api/scenarios-inside.html#dataiku.scenario.Scenario.run_scenario to start the 20 scenarios