Oms API POST delete runs - openmpp/openmpp.github.io GitHub Wiki

Delete multiple model runs from database, including output table values, input parameters and microdata.

Method:

POST /api/model/:model/delete-runs

This method is asynchronous: it starts runs delete return a response immediately. You need to check the results later by using GET list of model runs or other methods to make sure model runs are deleted and no longer exist in the list of model runs.

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.

JSON body request:

Array of model run digests, run stamps or run names, for example:

[
  "ae4546791da1b828a4fe0c0ca0935e7a",
  "2023_12_29_23_46_19_255",
  "First Task Run_modelOne_other",
  "Task Run with Suppressed Tables_modelOne_other"
]

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.

Call example:

curl -v -X POST -H "Content-Type: application/json" http://localhost:4040/api/model/modelOne/delete-runs -d @del_m1_runs.json

Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying [::1]:4040...
* Connected to localhost (::1) port 4040
> POST /api/model/modelOne/delete-runs HTTP/1.1
> Host: localhost:4040
> User-Agent: curl/8.4.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 172
>
< HTTP/1.1 200 OK
< Content-Location: /api/model/modelOne/delete-runs/4
< Content-Type: text/plain
< Date: Wed, 24 Jan 2024 04:02:54 GMT
< Content-Length: 0
<
* Connection #0 to host localhost left intact
⚠️ **GitHub.com Fallback** ⚠️