From 939d206915945160c82e45458996dce37df53e5d Mon Sep 17 00:00:00 2001 From: Ryan Date: Thu, 3 Aug 2023 17:56:12 +0000 Subject: [PATCH] Deprecated Threads endpoints --- TM1py/Services/MonitoringService.py | 3 ++- Tests/MonitoringService_test.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/TM1py/Services/MonitoringService.py b/TM1py/Services/MonitoringService.py index 422a060b..fda62e75 100644 --- a/TM1py/Services/MonitoringService.py +++ b/TM1py/Services/MonitoringService.py @@ -6,7 +6,7 @@ from TM1py.Objects.User import User from TM1py.Services.ObjectService import ObjectService from TM1py.Services.RestService import RestService -from TM1py.Utils import format_url, case_and_space_insensitive_equals, require_admin +from TM1py.Utils import format_url, case_and_space_insensitive_equals, require_admin, deprecated_in_version class MonitoringService(ObjectService): @@ -17,6 +17,7 @@ class MonitoringService(ObjectService): def __init__(self, rest: RestService): super().__init__(rest) + @deprecated_in_version(version="12.0.0") def get_threads(self, **kwargs) -> List: """ Return a dict of the currently running threads from the TM1 Server diff --git a/Tests/MonitoringService_test.py b/Tests/MonitoringService_test.py index 5b299f09..52d4987d 100644 --- a/Tests/MonitoringService_test.py +++ b/Tests/MonitoringService_test.py @@ -4,6 +4,7 @@ from TM1py.Services import TM1Service from TM1py.Utils import case_and_space_insensitive_equals +from .Utils import skip_if_deprecated_in_version class TestMonitoringService(unittest.TestCase): @@ -20,6 +21,7 @@ def setUpClass(cls): cls.config.read(Path(__file__).parent.joinpath('config.ini')) cls.tm1 = TM1Service(**cls.config['tm1srv01']) + @skip_if_deprecated_in_version(version="12.0.0") def test_get_threads(self): threads = self.tm1.monitoring.get_threads() self.assertTrue(any(thread["Function"] == "GET /api/v1/Threads" for thread in threads)