Source code for oasislmf.cli.api
from argparse import RawDescriptionHelpFormatter
from .command import OasisBaseCommand, OasisComputationCommand
[docs]
class ListApiCmd(OasisComputationCommand):
"""
Issue API GET requests via the command line
"""
[docs]
computation_name = 'PlatformList'
[docs]
class RunApiCmd(OasisComputationCommand):
"""
Run a model via the Oasis Platoform API end to end
"""
[docs]
computation_name = 'PlatformRun'
[docs]
class RunLossApiCmd(OasisComputationCommand):
"""
Run a model via the Oasis Platoform API end to end
"""
[docs]
computation_name = 'PlatformRunLosses'
[docs]
class DeleteApiCmd(OasisComputationCommand):
"""
Delete items from the Platform API
"""
[docs]
computation_name = 'PlatformDelete'
[docs]
class GetApiCmd(OasisComputationCommand):
"""
Download files from the Oasis Platoform API
"""
[docs]
computation_name = 'PlatformGet'
[docs]
class ApiCmd(OasisBaseCommand):
[docs]
sub_commands = {
'list': ListApiCmd,
'run': RunApiCmd,
'generate-oasis-files': RunInputApiCmd,
'generate-losses': RunLossApiCmd,
'delete': DeleteApiCmd,
'get': GetApiCmd,
}