Oms API PATCH update workset parameter value Ids - openmpp/openmpp.github.io GitHub Wiki
Update existing parameter values in workset.
Workset is a set of model input parameters (a.k.a. "scenario" input). Workset can be used to run the model.
This method replace existing parameter values by new values. Typical use of this method is a parameter editing through UI when only
small part of parameter rows replaced. Input data are json-encoded and expected to be the same as Page
part of JSON
return from Read parameter values from workset (enum id's) method.
Dimension(s) and enum-based parameter values expected as enum id, not enum codes.
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.
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 is a beta version and may change in the future.
Method:
PATCH /api/model/:model/workset/:set/parameter/:name/new/value-id
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 - (required) 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".
:name - (required) parameter name
Call examples:
curl -v -X PATCH -H "Content-Type: application/json" http://localhost:4040/api/model/modelOne/workset/modelOne_set/parameter/ageSex/new/value-id -d @test.json
curl -v -X PATCH -H "Content-Type: application/json" http://localhost:4040/api/model/_201208171604590148_/workset/modelOne_set/parameter/ageSex/new/value-id -d @test.json
JSON body:
It is expected to be same as Page
part of JSON return from Read parameter values from workset (enum id's) method.
For example (test.json file):
[
{"DimIds":[10,0],"IsNull":false,"Value":9876.1,"SubId":0}
,{"DimIds":[10,1],"IsNull":false,"Value":5432.2,"SubId":0}
]