Skip to content

Oms API POST download model initiate

amc1999 edited this page Jan 20, 2023 · 5 revisions

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 in RiskPaths 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

Home

Getting Started

Model development in OpenM++

Using OpenM++

Model Development Topics

OpenM++ web-service: API and cloud setup

Using OpenM++ from Python and R

Docker

OpenM++ Development

OpenM++ Design, Roadmap and Status

OpenM++ web-service API

GET Model Metadata

GET Model Extras

GET Model Run results metadata

GET Model Workset metadata: set of input parameters

Read Parameters, Output Tables or Microdata values

GET Parameters, Output Tables or Microdata values

GET Parameters, Output Tables or Microdata as CSV

GET Modeling Task metadata and task run history

Update Model Profile: set of key-value options

Update Model Workset: set of input parameters

Update Model Runs

Update Modeling Tasks

Run Models: run models and monitor progress

Download model, model run results or input parameters

Upload model runs or worksets (input scenarios)

Download and upload user files

User: manage user settings

Model run jobs and service state

Administrative: manage web-service state

Clone this wiki locally