Oms API POST download model initiate - openmpp/openmpp.github.io GitHub Wiki
POST model download request: server will prepare entire model data for download.
This method only avaliable if server configured to create downloads for user.
This is a beta version and may change in the future.
As result of this call oms
service will create:
- download archive, for example:
RiskPaths.zip
- model run
.csv
files for parameters and output tables inRiskPaths
folder - model run
.json
metadata files
Method:
POST /api/download/model/:model
Arguments:
:model - (required) model digest or model name
Model can be identified by digest or by model name. It is recommended to use digest because it is uniquely identifies model. It is possible to use model name, which is more human readable than digest, but if there are multiple models with same name in database than result is undefined.
Form body
Posted form can include optional JSON body:
{
"NoAccumulatorsCsv": true,
"NoMicrodata": true,
"Utf8BomIntoCsv": true
}
Use "NoAccumulatorsCsv": true
and "NoMicrodata": true
options to produce download faster.
By default this method create full Model.zip archive, which allow you to copy model into desktop database
by using dbcopy utilty
or even transfer it to the other server.
If you want only to analyze model run output CSV files then it maybe better to download run results without accumulators
(a.k.a. sub-samples or sub-values) and include only output table expressions.
For example, if you are only interested in output average value and don't want to analyze 32 sub-samples
then use "NoAccumulatorsCsv": true
option.
Also model run microdata can be huge and if you are not intersted in it then use "NoMicrodata": true
option to suppress it.
Use "Utf8BomIntoCsv": true
option to start CSV files with Byte Order Mark.
Byte order mark may be neccessary for some programs (e.g. Microsoft Excel) to correctly process UTF-8 files.
Call examples:
curl -v -X POST -H "Content-Type: application/json" http://localhost:4040/api/download/model/modelOne
curl -v -X POST -H "Content-Type: application/json" http://localhost:4040/api/download/model/c87bd08cc86da61332336384a491203b
curl -v -X POST -H "Content-Type: application/json" http://localhost:4040/api/download/model/modelOne -d @options.json