Oms API PATCH merge parameter from workset - openmpp/openmpp.github.io GitHub Wiki

Copy and insert or replace parameter values and parameter value notes from one workset to another.

If parameter with that name already exist in workset then existing values and parameter metadata replaced by new copy from source workset. There is similar method PUT copy parameter from workset to another which returns error if parameter already exist in workset.

  • Workset is a set of model input parameters (a.k.a. "scenario" input).
  • Workset can be used to run the model.
  • Workset must be read-only in order to run the model with this set of input parameters.
  • If user want to edit this set input parameters it must be read-write (not read-only status).

Method:

PATCH /api/model/:model/workset/:set/merge/parameter/:name/from-workset/:from-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 - (required) destination 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". Destination workset must be in read-write state (editable), use POST update workset read-only status method to make workset editable.

:name - (required) parameter name

If parameter with that name already exist in workset then it is delete and insert operation: existing parameter values and metadata will be replaced by copy from source workset.

:from-set - (required) source workset name

Source workset must be in read-only state.

Call examples:

curl -v -X PATCH http://localhost:4040/api/model/modelOne/workset/NewSet/merge/parameter/salaryFull/from-workset/Default

* Connected to localhost (::1) port 4040 (#0)
> PATCH /api/model/modelOne/workset/NewSet/merge/parameter/salaryFull/from-workset/Default HTTP/1.1
> Host: localhost:4040
> User-Agent: curl/7.55.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Location: /api/model/modelOne/workset/NewSet/parameter/salaryFull
< Content-Type: text/plain
< Date: Sat, 30 Oct 2021 02:59:59 GMT
< Content-Length: 0
<
* Connection #0 to host localhost left intact
⚠️ **GitHub.com Fallback** ⚠️