Skip to content

Oms API POST upload model run initiate

amc1999 edited this page Jan 13, 2023 · 4 revisions

POST model run upload request: upload model run zip file on server and start copy it into database.

This method only avaliable if server configured to create uploads for user.

This is a beta version and may change in the future.

As result of model run upload oms service does:

  • upload archive, for example: RiskPaths.run.New-Run.zip
  • extract .csv files with all run parameters and output tables into RiskPaths.run.New-Run folder
  • extract model run metadata file: modelOne.run.New-Run.json
  • create new or update existing "New-Run" model run in RiskPaths model database

Model run .zip archive must contain .json metadata file, which is usually created by dbcopy utility. For example:

{
    "ModelName": "RiskPaths",
    "ModelDigest": "d90e1e9a49a06d972ecf1d50e684c62b",
    "Name": "RiskPaths_Default",
    "SubCount": 1,
    "SubStarted": 1,
    "SubCompleted": 1,
    "CreateDateTime": "2022-03-22 20:49:24.341",
    "Status": "s",
    "UpdateDateTime": "2022-03-22 20:49:25.017",
    "RunDigest": "feb022eed344533046de517bddea7d09",
    "ValueDigest": "0f454b3af0d30f9f0614a9ce23e5cbfd",
    "RunStamp": "2022_03_22_20_49_24_260",
    "Txt": [{
            "LangCode": "EN",
            "Descr": "scenario",
            "Note": ""
        }, {
            "LangCode": "FR",
            "Descr": "scenario",
            "Note": ""
        }
    ],
    "Opts": {
        "OpenM.LogFilePath": "RiskPaths.log",
        "OpenM.ProgressPercent": "25",
        "OpenM.RunId": "102",
        "OpenM.RunName": "RiskPaths_Default",
        "OpenM.RunStamp": "2022_03_22_20_49_24_260",
        "OpenM.SetId": "101",
        "OpenM.SetName": "Default"
    },
    "Param": [{
            "Name": "AgeBaselineForm1",
            "Txt": [],
            "SubCount": 1,
            "DefaultSubId": 0,
            "ValueDigest": "a9a4c2d9ef657aafd89bb098635f7098"
        }, {
            "Name": "AgeBaselinePreg1",
            ........
            ........
        }
    ],
    "Table": [{
            "Name": "T01_LifeExpectancy",
            "ValueDigest": "5db49f190e7e2e999f77e1a7f796e3bc"
        }, {
            "Name": "T02_TotalPopulationByYear",
            ........
            ........
        }
    ],
    "Progress": [{
            "SubId": 0,
            "CreateDateTime": "2022-03-22 20:49:24.399",
            "Status": "s",
            "UpdateDateTime": "2022-03-22 20:49:24.818",
            "Count": 100,
            "Value": 5000
        }
    ]
}

Method:

POST /api/upload/model/:model/run
POST /api/upload/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 - (optional) 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. This argument can committed because model run .zip archive must contain contain .json metadata file.

Call examples:

curl -v -X POST -F "[email protected]" http://localhost:4040/api/upload/model/modelOne/run/Default-4
curl -v -X POST -F "[email protected]" http://localhost:4040/api/upload/model/modelOne/run

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