Skip to content

List and cleanup application instances #6

Description

@dima-naboka

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()

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions