oasislmf.computation.run.platform¶
Classes¶
Base platform class to handle opening a client connection |
|
Print version/info details of the connected Oasis Platform API server |
|
Return status and details from an Oasis Platform API server |
|
End to End - run model via the Oasis Platform API |
|
Delete either a 'model', 'portfolio' or an 'analysis' from the API's Database |
|
Download file(s) from the api |
|
Upload file(s) to the api |
|
Validate a portfolio's OED exposure files via the Oasis Platform API |
|
Run oasislmf exposure run on the server against a portfolio's exposure files |
|
Convert a portfolio's exposure data between OED and AIR via the Oasis Platform API |
|
Combine the ORD output of multiple RUN_COMPLETED analyses via the Oasis Platform API |
|
Cancel a running analysis (input generation or execution) via the Oasis Platform API |
|
List the sub-tasks of an analysis run via the Oasis Platform API |
|
Plot a Gantt chart of an analysis's sub-tasks, with a status summary, via the Oasis Platform API |
Module Contents¶
- class oasislmf.computation.run.platform.PlatformBase(**kwargs)[source]¶
Bases:
oasislmf.computation.base.ComputationStepBase platform class to handle opening a client connection
- load_credentials(login_arg, auth_type=None)[source]¶
Load credentials from JSON file or prompt interactively.
- Options:
1.’–server-login ./APIcredentials.json’ 2. Load credentials from default config file ‘-C oasislmf.json’ 3. Interactive prompt (menu skipped when auth_type is already known)
- try_connection(fail_safe=True, **kwargs)[source]¶
Helper to safely try connecting and return None if unauthorized.
- open_connection()[source]¶
Attempts connection in this order: 1. API_EXAMPLE_AUTH username/password (skipped when auth_type is oidc or m2m) 2. API_EXAMPLE_AUTH client_id/client_secret (skipped when auth_type is simple) 3. Prompt or load credentials
- print_portfolios_summary(items)[source]¶
The portfolios list endpoint doesn’t include validation_status/ exposure_status - those are only present on the per-portfolio detail GET, so fetch each one individually to fill them in.
- require_api_v2(feature_name)[source]¶
Guard for endpoints only available on the v2 (distributed) Platform API.
- poll_portfolio_field(portfolio_id, status_field, poll_interval, action_name)[source]¶
Poll a portfolio’s async status field (e.g. validation_status, exposure_status) until it settles on a terminal value.
A re-triggered run can end up back at the same terminal status it started at (e.g. RUN_COMPLETED -> STARTED -> RUN_COMPLETED), so completion can’t be detected by a status change alone - it must have passed through a pending state at least once since this run was triggered.
- class oasislmf.computation.run.platform.PlatformServerInfo(**kwargs)[source]¶
Bases:
PlatformBasePrint version/info details of the connected Oasis Platform API server
- class oasislmf.computation.run.platform.PlatformList(**kwargs)[source]¶
Bases:
PlatformBaseReturn status and details from an Oasis Platform API server
- class oasislmf.computation.run.platform.PlatformRun(**kwargs)[source]¶
Bases:
PlatformBaseEnd to End - run model via the Oasis Platform API
- class oasislmf.computation.run.platform.PlatformDelete(**kwargs)[source]¶
Bases:
PlatformBaseDelete either a ‘model’, ‘portfolio’ or an ‘analysis’ from the API’s Database
- class oasislmf.computation.run.platform.PlatformGet(**kwargs)[source]¶
Bases:
PlatformBaseDownload file(s) from the api
- class oasislmf.computation.run.platform.PlatformPost(**kwargs)[source]¶
Bases:
PlatformBaseUpload file(s) to the api
Portfolio files are uploaded to a single portfolio per invocation - give –portfolio-id to update an existing portfolio, or omit it (optionally with –portfolio-name) to create a new one.
- class oasislmf.computation.run.platform.PlatformValidate(**kwargs)[source]¶
Bases:
PlatformBaseValidate a portfolio’s OED exposure files via the Oasis Platform API
- class oasislmf.computation.run.platform.PlatformExposureRun(**kwargs)[source]¶
Bases:
PlatformBaseRun oasislmf exposure run on the server against a portfolio’s exposure files
- class oasislmf.computation.run.platform.PlatformExposureTransform(**kwargs)[source]¶
Bases:
PlatformBaseConvert a portfolio’s exposure data between OED and AIR via the Oasis Platform API
- class oasislmf.computation.run.platform.PlatformCombine(**kwargs)[source]¶
Bases:
PlatformBaseCombine the ORD output of multiple RUN_COMPLETED analyses via the Oasis Platform API
- class oasislmf.computation.run.platform.PlatformCancel(**kwargs)[source]¶
Bases:
PlatformBaseCancel a running analysis (input generation or execution) via the Oasis Platform API
- class oasislmf.computation.run.platform.PlatformSubTasks(**kwargs)[source]¶
Bases:
PlatformBaseList the sub-tasks of an analysis run via the Oasis Platform API
- class oasislmf.computation.run.platform.PlatformPlot(**kwargs)[source]¶
Bases:
PlatformBasePlot a Gantt chart of an analysis’s sub-tasks, with a status summary, via the Oasis Platform API