Skip to content

Commit

Permalink
Deprecated Threads endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
rclapp authored and MariusWirtz committed Nov 29, 2023
1 parent 7cfe2b5 commit 939d206
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion TM1py/Services/MonitoringService.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Tests/MonitoringService_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down

0 comments on commit 939d206

Please sign in to comment.