Dataiku applications#

For usage information and examples, see Dataiku Applications

class dataikuapi.dss.app.DSSApp(client, app_id)#

A handle to interact with an application on the DSS instance.

Important

Do not instantiate this class directly, instead use dataikuapi.DSSClient.get_app()

create_instance(instance_key, instance_name, wait=True)#

Create a new instance of this application.

Each instance must have a globally unique instance key, separate from any other project key across the whole DSS instance.

Parameters:
  • instance_key (string) – project key for the new created app instance

  • instance_name (string) – name for the new created app instance

  • wait (boolean) – if False, the method returns immediately with a dataikuapi.dss.future.DSSFuture on which to wait for the app instance to be created

Returns:

a handle to interact with the app instance

Return type:

DSSAppInstance

make_random_project_key()#

Create a new project key based on this app name.

This method suffixes the app’s name with a random string to generate a unique app instance key.

Returns:

a project key

Return type:

string

create_temporary_instance()#

Create a new temporary instance of this application.

The return value should be used as a Python context manager. Upon exit, the temporary app instance is deleted.

Returns:

an app instance

Return type:

TemporaryDSSAppInstance

list_instance_keys()#

List the keys of the existing instances of this app.

Returns:

a list of instance keys

Return type:

list[string]

list_instances()#

List the existing instances of this app.

:return a list of instances, each as a dict containing at least a “projectKey” field :rtype: list

get_instance(instance_key)#

Get a particular instance of this app.

Returns:

an app instance

Return type:

DSSAppInstance

get_manifest()#

Get the manifest of this app.

Returns:

an app manifest

Return type:

DSSAppManifest

class dataikuapi.dss.app.DSSAppListItem(client, data)#

An item in a list of apps.

Important

Do not instantiate this class, use dataikuapi.DSSClient.list_apps() instead

to_app()#

Get a handle corresponding to this app.

Returns:

a handle to interact with the app

Return type:

dataikuapi.dss.app.DSSApp

class dataikuapi.dss.app.DSSAppInstance(client, project_key)#

Handle on an instance of an app.

Important

Do not instantiate this class directly, use dataikuapi.dss.app.DSSApp.get_instance()

get_as_project()#

Get a handle on the project corresponding to this application instance.

Returns:

a handle on a DSS prohect

Return type:

dataikuapi.dss.project.DSSProject

get_manifest()#

Get the manifest of this app instance.

Returns:

an app manifest

Return type:

DSSAppManifest

class dataikuapi.dss.app.DSSAppManifest(client, raw_data, project_key=None)#

Handle on the manifest of an app or an app instance.

Important

Do not instantiate this class directly, use dataikuapi.dss.app.DSSApp.get_manifest() or dataikuapi.dss.app.DSSAppInstance.get_manifest()

get_raw()#

Get the raw definition of the manifest.

Usage example:

# list all app templates that anybody can instantiate
for app in client.list_apps(as_type="objects"):
    manifest = app.get_manifest()
    if manifest.get_raw()["instantiationPermission"] == 'EVERYBODY':
        print(app.app_id)            
Returns:

the definition of the manifest, as a dict. The definitions of the tiles of the app are inside the homepageSections field, which is a list of the sections displayed in the app. When the app is an app-as-recipe, the field useAsRecipeSettings is defined and contains the recipe-specific settings.

Return type:

dict

get_all_actions()#

Get the flat list of all actions.

Returns:

a list of action defintions, each one a dict. Each action has fields

  • type : the type of the action

  • prompt : label of the action in the form

  • help and helpTitle : metadata for showing a help button on the action

  • … and additional fields depending on the type, to hold the action’s setup

Return type:

list

get_runnable_scenarios()#

Get the scenario identifiers that are declared as actions for this app.

Returns:

a list of scenario identifiers

Return type:

list[string]

save()#

Save the changes to this manifest object back to the template project.

class dataikuapi.dss.app.TemporaryDSSAppInstance(client, project_key)#

Variant of DSSAppInstance that can be used as a Python context.

Important

Do not instantiate this class directly, use dataikuapi.dss.app.DSSApp.create_temporary_instance()

close()#

Delete the app instance.