Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature update cache controls #1070

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions TM1py/Services/CubeService.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,3 +378,31 @@ def get_random_intersection(self, cube_name: str, unique_names: bool = False) ->
element = '[{}].[{}]'.format(dimension, element)
elements.append(element)
return elements

@require_data_admin
@require_version(version="11.8.20")
def get_vmm(self, cube_name: str):
url = format_url("/Cubes('{}')?$select=ViewStorageMaxMemory", cube_name)
response = self._rest.GET(url)
return response.json()["ViewStorageMaxMemory"]

@require_data_admin
@require_version(version="11.8.20")
def set_vmm(self, cube_name: str, vmm: int):
url = format_url("/Cubes('{}')", cube_name)
payload = {"ViewStorageMaxMemory": vmm}
response = self._rest.PATCH(url=url, data=json.dumps(payload))

@require_data_admin
@require_version(version="11.8.20")
def get_vmt(self, cube_name: str):
url = format_url("/Cubes('{}')?$select=ViewStorageMinTime", cube_name)
response = self._rest.GET(url)
return response.json()["ViewStorageMinTime"]

@require_data_admin
@require_version(version="11.8.20")
def set_vmt(self, cube_name: str, vmt: int):
url = format_url("/Cubes('{}')", cube_name)
payload = {"ViewStorageMinTime": vmt}
response = self._rest.PATCH(url=url, data=json.dumps(payload))
1 change: 1 addition & 0 deletions TM1py/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@
from TM1py.Services.MonitoringService import MonitoringService

from TM1py.Utils import Utils
from TM1py.Services.JobService import JobService

__version__ = "2.0.1"