API methods
api_patch(opts, endpoint, ..., default_endpoint = "v1/studies")
Antares simulation options or a list
with an host =
slot.
API endpoint to interrogate, it will be added after default_endpoint
.
Can be a full URL (by wrapping ìn I()
), in that case default_endpoint
is ignored.
Additional arguments passed to API method (httr::PATCH()
).
Default endpoint to use.
Response from the API.
if (FALSE) { # \dontrun{
# Simple example to update st-storages properties
# read existing study
opts <- setSimulationPath("path_to_the_study", "input")
# make list of properties
prop <- list(efficiency = 0.5,
reservoircapacity = 350,
initialleveloptim = TRUE)
# convert to JSON
body <- jsonlite::toJSON(prop,
auto_unbox = TRUE)
# send to server (see /apidoc)
api_patch(opts = opts,
endpoint = file.path(opts$study_id,
"areas",
area,
"storages",
cluster_name),
body = body,
encode = "raw")
} # }