Sign up to take part
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Registered users can ask their own questions, contribute to discussions, and be part of the Community!
Hi all,
is there any script present which can help me modify the run as id for 100 of project in one go.
the exact situation is like within these 100 of project each project might have 2 to 3 scenarios so i want all these to be modified to a particular run as id.
can someone please suggest action on this appreciate your time and efforts.
Thanks !!!
Hi,
We have an example here on how to re-assigned a scenario runas to another user :
https://doc.dataiku.com/dss/latest/python-api/scenarios.html#reassign-scenarios-to-another-user
To loop trough all project you can do this:
import dataiku
client = dataiku.api_client()
projects = client.list_projects()
for p in projects:
project = client.get_project(p["projectKey"])
for scenario in project.list_scenarios(as_type="objects"):
settings = scenario.get_settings()
if settings.effective_run_as == "u1":
print("Scenario %s used to run as u1, reassigning it")
# To configure a run_as, we must use the run_as property.
# effective_run_as is read-only
settings.run_as = "u2"
settings.save()
Hi,
We have an example here on how to re-assigned a scenario runas to another user :
https://doc.dataiku.com/dss/latest/python-api/scenarios.html#reassign-scenarios-to-another-user
To loop trough all project you can do this:
import dataiku
client = dataiku.api_client()
projects = client.list_projects()
for p in projects:
project = client.get_project(p["projectKey"])
for scenario in project.list_scenarios(as_type="objects"):
settings = scenario.get_settings()
if settings.effective_run_as == "u1":
print("Scenario %s used to run as u1, reassigning it")
# To configure a run_as, we must use the run_as property.
# effective_run_as is read-only
settings.run_as = "u2"
settings.save()
@Alex thank you this should work