api_patch | R Documentation |
API methods
api_patch(opts, endpoint, ..., default_endpoint = "v1/studies")
opts |
Antares simulation options or a |
endpoint |
API endpoint to interrogate, it will be added after |
... |
Additional arguments passed to API method ( |
default_endpoint |
Default endpoint to use. |
Response from the API.
## Not run:
# 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")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.