Oms API POST download model run initiate - openmpp/openmpp.github.io GitHub Wiki
POST model run download request: server will prepare model run 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.run.102.zip
- model run
.csv
files for parameters and output tables inRiskPaths.run.102
folder - model run
.json
metadata files
Method:
POST /api/download/model/:model/run/:run
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.
:run - (required) model run digest, run stamp or run name
Model run can be identified by run digest, run stamp or run name. It is recommended to use digest because it is uniquely identifies model run. Run stamp, if not explicitly specified as model run option, automatically generated as timestamp string, ex.: 2016_08_17_21_07_55_123. It is also possible to use name, which is more human readable than digest, but if there are multiple runs 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 ModelRun.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/run/Default
curl -v -X POST -H "Content-Type: application/json" http://localhost:4040/api/download/model/c87bd08cc86da61332336384a491203b/run/Default
curl -v -X POST -H "Content-Type: application/json" http://localhost:4040/api/download/model/c87bd08cc86da61332336384a491203b/run/D3f26c4492bad08b9d6c8373719ff53e7
curl -v -X POST -H "Content-Type: application/json" http://localhost:4040/api/download/model/modelOne/run/Default -d @options.json