11from datetime import datetime
2- import time
2+ import time , warnings
33from dataikuapi .utils import DataikuException
44from .discussion import DSSObjectDiscussions
55
@@ -158,6 +158,7 @@ def get_definition(self, with_status=True):
158158 actions' definition. If False, the definition doesn't contain the run status
159159 but has the scenario's actions definition
160160 """
161+ warnings .warn ("DSSScenario.get_definition is deprecated, please use get_settings" , DeprecationWarning )
161162 suffix = '/light' if with_status else ''
162163 return self .client ._perform_json (
163164 "GET" , "/projects/%s/scenarios/%s%s" % (self .project_key , self .id , suffix ))
@@ -170,6 +171,7 @@ def set_definition(self, definition, with_status=True):
170171 :param bool status: should be the same as the value passed to get_definition(). If True, the params,
171172 triggers and reporters fields of the scenario are ignored,
172173 """
174+ warnings .warn ("DSSScenario.set_definition is deprecated, please use get_settings" , DeprecationWarning )
173175 suffix = '/light' if with_status else ''
174176 return self .client ._perform_json (
175177 "PUT" , "/projects/%s/scenarios/%s%s" % (self .project_key , self .id , suffix ), body = definition )
@@ -181,6 +183,7 @@ def get_payload(self, extension='py'):
181183 Returns the payload of the scenario
182184 :param str extension: the type of script. Default is 'py' for python
183185 """
186+ warnings .warn ("DSSScenario.get_payload is deprecated, please use get_settings" , DeprecationWarning )
184187 return self .client ._perform_json (
185188 "GET" , "/projects/%s/scenarios/%s/payload" % (self .project_key , self .id )).get ('script' , '' )
186189
@@ -191,6 +194,7 @@ def set_payload(self, script, with_status=True):
191194 Updates the payload of this scenario
192195 :param str extension: the type of script. Default is 'py' for python
193196 """
197+ warnings .warn ("DSSScenario.set_payload is deprecated, please use get_settings" , DeprecationWarning )
194198 return self .client ._perform_json (
195199 "PUT" , "/projects/%s/scenarios/%s/payload" % (self .project_key , self .id ), body = {'script' : script })
196200
0 commit comments