Enterprise Asset Library¶
- class dataikuapi.dss.enterprise_asset_library.DSSEnterpriseAssetLibrary(client)¶
Handle to interact with the Enterprise Asset Library on the DSS instance.
Important
Do not create this class directly, use
dataikuapi.DSSClient.get_enterprise_asset_library()- list_collections()¶
Lists the collections you have read access to in the Enterprise Asset Library as dict. Each dict contains at least a field “id” indicating the identifier of this collection and “name”
- Returns:
a list of dict
- Return type:
list[dict]
- get_collection(collection_id)¶
Get a handle to interact with a specific Enterprise Asset Collection
- Parameters:
collection_id (str) – the id of the Enterprise Asset Collection to fetch
- Return type:
dataikuapi.dss.enterprise_asset_library.DSSEnterpriseAssetCollection
- list_prompts(restrict_collections=None)¶
Lists the prompts in the collections you have read access to
- Parameters:
restrict_collections ((optional) list[string]) – collection ids you want to get the prompts from
- Returns:
the list of prompts in the collections you have access to
- Return type:
list[dict]
- get_export_stream()¶
Export the Enterprise Asset Library collections that the caller can export.
Warning
You are responsible for closing the returned stream.
- Returns:
a stream of the export archive
- Return type:
file-like object
- export_collections_to_file(path)¶
Export the Enterprise Asset Library collections to a file.
- Parameters:
path (str) – the path of the file in which the exported archive should be saved
- import_collections(fp, conflict_resolution_strategy='MERGE')¶
Import Enterprise Asset Library collections from an archive.
- Parameters:
fp (object) – A file-like object pointing to an Enterprise Asset Library archive zip
conflict_resolution_strategy (str) –
how to handle existing conflicting collection ids. A conflict occurs when the archive contains a collection whose id already exists on the target DSS instance:
ABORT: if a conflict is found, the import is cancelled.MERGE: when a collection conflicts, new assets are added and existing assets with the same id are overwritten in the target collection.OVERWRITE: conflicting collections are overwritten.Warning
With
OVERWRITE, assets present in the target collection but absent from the imported archive are removed.SKIP: conflicting collections are skipped.
Defaults to
MERGEif not provided.
- Returns:
a future representing the import process
- Return type:
- class dataikuapi.dss.enterprise_asset_library.DSSEnterpriseAssetCollection(client, collection_id)¶
A handle to interact with an Enterprise Asset Collection on the DSS instance.
Do not create this class directly, instead use
dataikuapi.dss.enterprise_asset_library.DSSEnterpriseAssetLibrary.get_collection()- get_prompt(prompt_id)¶
Get a prompt from the Enterprise Asset Collection.
- Parameters:
prompt_id (str) – id of the Enterprise Prompt
- Returns:
the Enterprise Prompt
- Return type:
dataikuapi.dss.enterprise_asset_library.EnterpriseAssetLibraryPrompt
- create_prompt(name=None, description=None, content=None, tags=None, prompt=None)¶
Add a prompt to this Enterprise Asset Collection. This call requires at least contributor rights on the Enterprise Asset Collection.
- Parameters:
name (str) – name of the prompt to create
description (str) – description of the prompt to create
content (str) – content of the prompt to create
tags (list[string]) – tags of the prompt to create
prompt (
dict) – prompt to add to the Enterprise Asset Collection. If not provided, a prompt is built fromname,description,contentandtagsparameters. If both are provided, keyword arguments override values fromprompt.
- Returns:
the newly created Enterprise Prompt
- Return type:
dataikuapi.dss.enterprise_asset_library.EnterpriseAssetLibraryPrompt
- class dataikuapi.dss.enterprise_asset_library.EnterpriseAssetLibraryPrompt(collection, prompt)¶
A handle to interact with an Enterprise Prompt on the DSS instance.
Do not create this class directly, instead use
dataikuapi.dss.enterprise_asset_library.DSSEnterpriseAssetCollection.create_prompt()ordataikuapi.dss.enterprise_asset_library.DSSEnterpriseAssetCollection.get_prompt()- get_raw()¶
Get the raw prompt. This returns a reference to the raw prompt, not a copy, so changes made to the returned object will be reflected when saving.
- Returns:
the raw Enterprise Prompt
- Return type:
dict
- property id¶
The Enterprise Asset Collection id (read-only)
- Return type:
str
- property name¶
Get or set the name of the Enterprise Asset Collection
- Return type:
str
- property description¶
Get or set the description of the Enterprise Asset Collection
- Return type:
str
- property tags¶
Get or set the tags of the Enterprise Asset Collection
- Return type:
list[string]
- property content¶
Get or set the content of the Enterprise Asset Collection
- Return type:
string
- save()¶
Save the changes made on the prompt
This call requires at least contributor rights on the Enterprise Asset Collection.
- delete()¶
Delete this Enterprise Prompt
This call requires at least contributor rights on the Enterprise Asset Collection.
