Skip to content

Oms API POST upload workset initiate

amc1999 edited this page May 5, 2022 · 5 revisions

POST model workset upload request: upload workset 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.

Workset is a set of model input parameters (a.k.a. "scenario" input). Workset can be used to run the model.

As result of workset upload oms service does:

  • upload archive, for example: RiskPaths.set.New-Data.zip
  • extract workset .csv files with parameters into RiskPaths.set.New-Data folder
  • extract workset .json metadata file
  • create new or update existing New-Data workset in RiskPaths model database

Workset .zip archive does not have to conatin workset .json metadata file, it can include only .csv files with parameter values. If workset .zip created by dbcopy utility or as result of UI download then it always contain workset .json metadata file, for example:

{
  "ModelName": "RiskPaths",
  "ModelDigest":"d90e1e9a49a06d972ecf1d50e684c62b",
  "Name": "New-Data",
  "IsReadonly": false,
  "Txt": [{
      "LangCode": "EN",
      "Descr": "Model modified set of input parameters",
      "Note": ""
    }, {
      "LangCode": "FR",
      "Descr": "Modèle modifié ensemble de paramètres d'entrée",
      "Note": "Remarques sur l'ensemble d'entrées modifiées par le modèle"
    }
  ],
  "Param": [{
      "Name": "AgeBySex",
      "SubCount": 1,
      "Txt": [{
          "LangCode": "EN",
          "Note": "Age by Sex modified values"
        }
      ]
    }
  ]
}

Method:

POST /api/upload/model/:model/workset
POST /api/upload/model/:model/workset/:set

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.

:set - (optional) workset name

Workset is uniquely identified by name (inside the model). Different models can have worksets with same name, i.e. each model can have workset with name "Default". This argument is and can ommited if workset .zip archive contain .json file with workset metadata, which must include name.

Multi-part form body

Posted multi-part form consists of two parts:

  • (optional) "workset-upload-options" part with JSON upload options;
  • (required) workset.zip file.

JSON upload options are:

{
  "NoDigestCheck": true
}

If NoDigestCheck is true then method calls dbcopy with -dbcopy.NoDigetCheck option. By default dbcopy imports workset only if ModelDigest from source json metadata identical to destination model digest. If you are using NoDigestCheck then dbcopy do ignore source digest and rely on model name only.

Call examples:

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

curl -v -X POST -F "[email protected]" -F "[email protected]" http://localhost:4040/api/upload/model/zz_201208171604590148_/workset

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