Submit your inspiring success story or innovative use case to the 2022 Dataiku Frontrunner Awards! ENTER YOUR SUBMISSION

How to know if project has active bundle in automation

Solved!
arielma2304
Level 3
How to know if project has active bundle in automation

Hi

Is there a way go get thought API f project is active or not in automation? and if yes, can we tell which bundle is active now?

0 Kudos
1 Solution
daviddogneton
Dataiker
Dataiker

Hi,

With the REST API, you can call public/api/projects/{projectKey}on an automation node.

This will provide you with the active bundle if some - "activeBundleState": { "bundleId": "BUNDLE_ID", "activatedOn": "2021-01-27T10:49:21.926+0100" }

And for the Python API you have to use the  list_projects()method:

 

 

active_bundle = ""
for project in client.list_projects():
    if project['projectKey'] == "YOUR_PROJECT_KEY":
        if 'activeBundleState' in project:
            active_bundle = project['activeBundleState']
            break

 

 


Hope it helps,


David

View solution in original post

0 Kudos
1 Reply
daviddogneton
Dataiker
Dataiker

Hi,

With the REST API, you can call public/api/projects/{projectKey}on an automation node.

This will provide you with the active bundle if some - "activeBundleState": { "bundleId": "BUNDLE_ID", "activatedOn": "2021-01-27T10:49:21.926+0100" }

And for the Python API you have to use the  list_projects()method:

 

 

active_bundle = ""
for project in client.list_projects():
    if project['projectKey'] == "YOUR_PROJECT_KEY":
        if 'activeBundleState' in project:
            active_bundle = project['activeBundleState']
            break

 

 


Hope it helps,


David

0 Kudos

Labels

?
Labels (1)
A banner prompting to get Dataiku