if (FALSE) {
# 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")
}
Run the code above in your browser using DataLab