Python API: Project metadata for bundle activations
JohnB
Registered Posts: 32 ✭✭✭✭✭
Is there a way to query via the API when the current project bundle was last activated?
I was wondering if I could use that data in a custom trigger to run a scenario when the bundle is activated.
DSS v8.0.3
Best Answer
-
Have found the answer via https://community.dataiku.com/t5/Using-Dataiku-DSS/How-to-know-if-project-has-active-bundle-in-automation/m-p/13670
..which leads me to this:
import dataiku
client = dataiku.api_client()
project_key = client.get_default_project().project_key
project_dict = [p for p in client.list_projects() if p['projectKey'] == project_key][0]
active_bundle_state = project_dict.get('activeBundleState',{})
print(active_bundle_state.get('activatedOn'))