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

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()
classmethod from_dict(connection, caches)
Parameters:
  • connection (Connection) –

  • caches (list[dict]) –

Return type:

list[’CubeCache’]

get_manipulation_status(manipulation_id)

Get manipulation status of cube cache.

Parameters:

manipulation_id (str) –

Return type:

dict

list_properties()

List properties for cube cache.

load()

Load cache.

unload()

Unload cache.

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 of CubeCache objects when parameter to_dictionary is set to False (default value) or list of dictionaries otherwise.

Return type:

list[’CubeCache’] | list[dict]