Skip to content

Bookmarks

Bookmarks are an easy way for a user to save certain 'favorite' assets that they want to reference. Bookmarks can also be set from the Resources service in the web portal. Bookmarks are private to the user, and to use any of the functions in this module authentication is required.

Bookmark

Reference to an asset on AI-on-Demand.

Attributes:

Name Type Description
identifier str

The identifier of the asset on AI-on-Demand, e.g., 'data_xyz...'

created datetime

The datetime when the bookmark was originally created.

register(identifier)

Bookmark the asset with identifier for the user.

Parameters:

Name Type Description Default
identifier str

The identifier of the asset on AI-on-Demand, e.g., 'data_xyz...'

required

Returns:

Type Description
Bookmark

A Bookmark that denotes the time the bookmark was created.

Raises:

Type Description
KeyError

If the identifier is not recognized by AI-on-Demand.

ServerError

If any other server-side error occurs.

delete(identifier)

Remove the bookmark for the asset with identifier for the user.

This method does not raise an error if the identifier is not recognized by AI-on-Demand, or if the identifier is valid but the user has not bookmarked it.

Parameters:

Name Type Description Default
identifier str

The identifier of the asset on AI-on-Demand, e.g., 'data_xyz...'

required

Raises:

Type Description
ServerError

If any other server-side error occurs.

get_list()

Return a list of the user's bookmarks.

Returns:

Type Description
list[Bookmark]

The list of bookmarks.