Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List and cleanup application instances #6

Open
dima-naboka opened this issue Jan 6, 2021 · 0 comments
Open

List and cleanup application instances #6

dima-naboka opened this issue Jan 6, 2021 · 0 comments
Assignees
Labels

Comments

@dima-naboka
Copy link

An example of listing and deleting all Application instances in 'current' project. Works in notebook, if required I can test outside DSS and introduce additional criteria for 'deletion' step

import dataikuapi
import dataiku

client = dataiku.api_client()
#AppID for any project is 'PROJECT_MYPROJECTID'
app = dataikuapi.DSSClient.get_app(client,'PROJECT_'+ dataiku.get_custom_variables()["projectKey"])

app.list_instance_keys()
for project_key in app.list_instance_keys():
    project = client.get_project(project_key)
    print ('deleting application instance ' + project_key)
    project.delete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants