oasislmf.platform_api.client¶
Classes¶
Used to Implement the default requests common to all Oasis API |
|
Used for JSON data End points. |
|
File Resources Endpoint for Upload / Downloading |
|
Used to Implement the default requests common to all Oasis API |
|
Used to Implement the default requests common to all Oasis API |
|
Used to Implement the default requests common to all Oasis API |
|
Module Contents¶
- class oasislmf.platform_api.client.ApiEndpoint(session, url_endpoint, logger=None)[source]¶
Bases:
object
Used to Implement the default requests common to all Oasis API End points.
- class oasislmf.platform_api.client.JsonEndpoint(session, url_endpoint, url_resource, logger=None)[source]¶
Bases:
object
Used for JSON data End points.
- class oasislmf.platform_api.client.FileEndpoint(session, url_endpoint, url_resource, logger=None)[source]¶
Bases:
object
File Resources Endpoint for Upload / Downloading
- class oasislmf.platform_api.client.API_models(session, url_endpoint)[source]¶
Bases:
ApiEndpoint
Used to Implement the default requests common to all Oasis API End points.
- class oasislmf.platform_api.client.API_portfolios(session, url_endpoint)[source]¶
Bases:
ApiEndpoint
Used to Implement the default requests common to all Oasis API End points.
- class oasislmf.platform_api.client.API_analyses(session, url_endpoint)[source]¶
Bases:
ApiEndpoint
Used to Implement the default requests common to all Oasis API End points.
- class oasislmf.platform_api.client.APIClient(api_url='http://localhost:8000', api_ver='V2', username='admin', password='password', timeout=25, logger=None, **kwargs)[source]¶
Bases:
object
- upload_inputs(portfolio_name=None, portfolio_id=None, location_fp=None, accounts_fp=None, ri_info_fp=None, ri_scope_fp=None)[source]¶
- upload_settings(analyses_id, settings)[source]¶
Upload an analyses run settings to an API
Method to post JSON data or upload a settings file containing JSON data
Parameters¶
- param analyses_id:
Analyses settings {id} from, v1/analyses/{id}/settings
- type analyses_id:
int
- param settings:
Either a valid filepath or dictionary holding the settings
- type settings:
[str, dict]
- return:
:rtype None
- run_generate(analysis_id, poll_interval=5)[source]¶
Generates the inputs for the analysis based on the portfolio. The analysis must have one of the following statuses, NEW, INPUTS_GENERATION_ERROR, INPUTS_GENERATION_CANCELLED, READY, RUN_COMPLETED, RUN_CANCELLED or RUN_ERROR.
- run_analysis(analysis_id, analysis_settings_fp=None, poll_interval=5)[source]¶
Runs all the analysis. The analysis must have one of the following statuses, NEW, RUN_COMPLETED, RUN_CANCELLED or RUN_ERROR
- download_output(analysis_id, download_path='', filename=None, clean_up=False, overwrite=True)[source]¶