mstrio > project_objects > datasets > cube_cache

class mstrio.project_objects.datasets.cube_cache.CubeCache(connection, cache_id, cube_cache_dict=None)

Bases: Cache

Manage cube cache.

Parameters:
  • connection (Connection)

  • cache_id (str)

  • cube_cache_dict (dict | None)

classmethod from_dict(connection, caches)
Return type:

list[CubeCache]

Parameters:
__init__(connection, cache_id, cube_cache_dict=None)

Initialize the CubeCache object. If cube_cache_dict provided no I-Server request will be sent.

Parameters:
  • connection (Connection) – Strategy One connection object returned by connection.Connection().

  • cache_id (string) – cube cache id

  • cube_cache_dict (dict, optional) – dictionary with properties of cube cache object. If it is provided then cache dictionary will not be retrieved from I-Server.

activate()

Activate cube cache.

deactivate()

Deactivate cube cache.

delete(force=False)

Delete cube cache.

Parameters:

force (bool) – If True, then no additional prompt will be shown before deleting CubeCache.

Returns:

True for success. False otherwise.

fetch()
get_manipulation_status(manipulation_id)

Get manipulation status of cube cache.

Return type:

dict

Parameters:

manipulation_id (str)

list_properties()

List properties for cube cache.

load()

Load cache.

unload()

Unload cache.

property column_count
property creation_time
property creator_id
property creator_name
property data_languages
property database_connections
property file_name
property historic_hit_count
property hit_count
property id
property job_execution_statistics
property last_hit_time
property last_update_job
property last_update_time
property open_view_count
property project_id
property row_count
property size
property source
property state
mstrio.project_objects.datasets.cube_cache.delete_cube_cache(connection, id, force=False)

Delete single cube cache.

Parameters:
  • connection (Connection) – Strategy One connection object returned by connection.Connection().

  • id (string) – cube cache ID

  • force (bool, optional) – If True, then no additional prompt will be shown before deleting caches for given cube. Default is False.

Returns:

True for success. False otherwise.

mstrio.project_objects.datasets.cube_cache.delete_cube_caches(connection, loaded=False, force=False, nodes=None, cube_id=None, db_connection_id=None)

Delete all cube caches on a given node.

Optionally it is possible to specify for which cube or for which database connection caches will be deleted. It is also possible to delete only loaded caches.

You can specify from which nodes caches will be deleted. If nodes are None then all nodes are retrieved from cluster.

Parameters:
  • connection (Connection) – Strategy One connection object returned by connection.Connection().

  • nodes (list of strings or string, optional) – names of nodes from which caches will be deleted. By default it equals None and in that case all nodes names are loaded from the cluster.

  • cube_id (string, optional) – When provided, only caches for the cube with given ID will be deleted (if any).

  • db_connection_id (string, optional) – When provided, only caches for the database connection with given ID will be deleted (if any).

  • loaded (bool, optional) – If True then only loaded caches will be deleted. Otherwise all cubes will be returned.

  • force (bool, optional) – If True, then no additional prompt will be shown before deleting caches for given cube. Default is False.

Returns:

  • ‘succeeded’ - list with IDs of caches which were deleted

  • ’failed’ - list with IDS of caches which were not deleted

or None when user doesn’t agree for deletion when prompted

Return type:

Dictionary with two keys

mstrio.project_objects.datasets.cube_cache.list_cube_caches(connection, nodes=None, cube_id=None, loaded=False, db_connection_id=None, project_ids=None, to_dictionary=False, limit=None)

List cube caches. You can filter them by cube (cube_id), database connection (db_connection_id) and projects (project_ids). You can also obtain only loaded caches (loaded=True).

You can specify from which nodes caches will be retrieved. If nodes are None then all nodes are retrieved from the cluster.

Parameters:
  • connection (Connection) – Strategy One connection object returned by connection.Connection().

  • nodes (list of strings or string, optional) – names of nodes on which caches will be searched. By default, it equals None and in that case all nodes’ names are loaded from the cluster.

  • cube_id (string, optional) – When provided, only caches for the cube with given ID will be returned (if any).

  • loaded (bool, optional) – If True then only loaded caches will be retrieved. Otherwise, all cubes will be returned.

  • db_connection_id (string, optional) – When provided, only caches for the database connection with given ID will be returned (if any).

  • project_ids (list of string, optional) – When provided only caches for projects with given IDs will be returned (if any).

  • to_dictionary (bool, optional) – If True returns dict, by default (False) returns CubeCache objects

  • limit (integer, optional) – Cut-off value for the number of objects returned. Default value is None which means no limit.

Returns:

list[CubeCache] | list[dict] – List of CubeCache objects when parameter to_dictionary is set to False (default value) or list of dictionaries otherwise.

Return type:

list[CubeCache] | list[dict]