Forked from
DM / dm-docs
261 commits behind, 496 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.
getExperimentsCli.py 914 B
#!/usr/bin/env python
from dm.ds_web_service.api.experimentRestApi import ExperimentRestApi
from dsWebServiceSessionCli import DsWebServiceSessionCli
class GetExperimentsCli(DsWebServiceSessionCli):
def __init__(self):
DsWebServiceSessionCli.__init__(self)
def runCommand(self):
self.parseArgs(usage="""
dm-get-experiments
Description:
Retrieves list of known experiments.
""")
api = ExperimentRestApi(self.getLoginUsername(), self.getLoginPassword(), self.getServiceHost(), self.getServicePort(), self.getServiceProtocol())
experiments = api.getExperiments()
for experiment in experiments:
print experiment.getDisplayString(self.getDisplayKeys(), self.getDisplayFormat())
#######################################################################
# Run command.
if __name__ == '__main__':
cli = GetExperimentsCli()
cli.run()