Skip to content

Commit 21e1abd

Browse files
FChataignerlpenet
authored andcommitted
expose actions on instances
1 parent 6c901de commit 21e1abd

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
@@ -237,6 +237,44 @@ def delete(self):
237237
)
238238
return FMFuture.from_resp(self.client, future)
239239

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

0 commit comments

Comments
 (0)