Forked from
DM / dm-docs
261 commits behind, 746 commits ahead of the upstream repository.
-
sveseli authored
add first functional DS web service with user, experiment and auth controllers that allow retrieving user and experiment information from the db, start/stop experiment, and principal authorization; added corresponding API and CLI classes; added storage manager skeleton
sveseli authoredadd first functional DS web service with user, experiment and auth controllers that allow retrieving user and experiment information from the db, start/stop experiment, and principal authorization; added corresponding API and CLI classes; added storage manager skeleton
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
getUsersCli.py 847 B
#!/usr/bin/env python
from dm.ds_web_service.api.userRestApi import UserRestApi
from dsWebServiceSessionCli import DsWebServiceSessionCli
class GetUsersCli(DsWebServiceSessionCli):
def __init__(self):
DsWebServiceSessionCli.__init__(self)
def runCommand(self):
self.parseArgs(usage="""
dm-get-users
Description:
Retrieves list of registered users.
""")
api = UserRestApi(self.getLoginUsername(), self.getLoginPassword(), self.getServiceHost(), self.getServicePort(), self.getServiceProtocol())
users = api.getUsers()
for user in users:
print user.getDisplayString(self.getDisplayKeys(), self.getDisplayFormat())
#######################################################################
# Run command.
if __name__ == '__main__':
cli = GetUsersCli()
cli.run()