Skip to content

Commit e8436b0

Browse files
committed
expose actions on instances
1 parent d1a7c3f commit e8436b0

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

dataikuapi/fm/instances.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,44 @@ def delete(self):
229229
)
230230
return FMFuture.from_resp(self.client, future)
231231

232+
def get_initial_password(self):
233+
"""
234+
Get the initial DSS admin password.
235+
236+
Can only be called once
237+
238+
:return: a password for the 'admin' user.
239+
"""
240+
return self.client._perform_tenant_json(
241+
"GET", "/instances/%s/actions/get-initial-password" % self.id
242+
)
243+
244+
def reset_user_password(self, username, password):
245+
"""
246+
Reset the password for a user on the DSS instance
247+
248+
:param string username: login
249+
:param string password: new password
250+
:return: A :class:`~dataikuapi.fm.future.FMFuture` representing the password reset process
251+
:rtype: :class:`~dataikuapi.fm.future.FMFuture`
252+
"""
253+
future = self.client._perform_tenant_json(
254+
"GET", "/instances/%s/actions/reset-user-password" % self.id, params={ 'userName':username, 'password':password }
255+
)
256+
return FMFuture.from_resp(self.client, future)
257+
258+
def replay_setup_actions(self):
259+
"""
260+
Replay the setup actions on the DSS instance
261+
262+
:return: A :class:`~dataikuapi.fm.future.FMFuture` representing the replay process
263+
:rtype: :class:`~dataikuapi.fm.future.FMFuture`
264+
"""
265+
future = self.client._perform_tenant_json(
266+
"GET", "/instances/%s/actions/replay-setup-actions" % self.id
267+
)
268+
return FMFuture.from_resp(self.client, future)
269+
232270
def set_automated_snapshots(self, enable, period, keep=0):
233271
"""
234272
Set the automated snapshots policy for this instance

0 commit comments

Comments
 (0)