diff --git a/NAMESPACE b/NAMESPACE index 340a2546..3c974f59 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -6,6 +6,7 @@ S3method(print,antares.api.logs) export(activateRES) export(activateST) export(adequacyOptions) +export(api_patch) export(backupStudy) export(checkRemovedArea) export(cleanUpOutput) @@ -106,7 +107,6 @@ importFrom(antaresRead,getAreas) importFrom(antaresRead,getLinks) importFrom(antaresRead,readBindingConstraints) importFrom(antaresRead,readClusterDesc) -importFrom(antaresRead,readClusterSTDesc) importFrom(antaresRead,readIni) importFrom(antaresRead,readIniFile) importFrom(antaresRead,readInputTS) @@ -134,6 +134,7 @@ importFrom(data.table,year) importFrom(doFuture,registerDoFuture) importFrom(future,plan) importFrom(grDevices,col2rgb) +importFrom(httr,PATCH) importFrom(httr,POST) importFrom(httr,accept_json) importFrom(httr,add_headers) @@ -153,6 +154,7 @@ importFrom(plyr,llply) importFrom(stats,as.formula) importFrom(stats,sd) importFrom(stats,setNames) +importFrom(utils,URLencode) importFrom(utils,getFromNamespace) importFrom(utils,head) importFrom(utils,modifyList) diff --git a/NEWS.md b/NEWS.md index 00728295..5c146da5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,11 +9,15 @@ * `removeArea()` : send a warning instead of a stop if an area is referenced in a binding constraint coefficient * `removeLink()` : send a warning instead of a stop if a link is referenced in a binding constraint coefficient * `removeCluster()` : send a warning instead of a stop if a cluster is referenced in a binding constraint coefficient +* `createClusterST()` : updated with new endpoint API (POST + PUT) +* `editClusterST()` : updated with new endpoint API (PATCH + PUT) +* `removeCluster()`/`removeClusterRES()`/`removeClusterST()` updated with new endpoint API (DELETE) NEW FEATURES (Antares v8.8) : * `updateOptimizationSettings()` allows the user to update solver.log property * `createClusterST()` / `editClusterST()` use new parameters and default values +* Add new function `api_patch()` to put PATCH (httr) request to API BUGFIXES : @@ -21,8 +25,6 @@ BUGFIXES : * `createBindingConstraint()` in API mode (for study 0) { - area_filter <- area - clusters_filtered <- clusters[clusters$area == tolower(area_filter) & - clusters$cluster == cluster_name,] - exists <- nrow(clusters_filtered) > 0 - } - if(exists) - stop("Cluster already exists. Edit it with editClusterST().") - } + ## + # POST only for properties (creation with default TS values) + ## - params_cluster$name <- cluster_name + # adapt parameter names + list_properties <- list("group" = params_cluster[["group"]], + "name" = cluster_name, + "injectionNominalCapacity" = params_cluster[["injectionnominalcapacity"]], + "withdrawalNominalCapacity" = params_cluster[["withdrawalnominalcapacity"]], + "reservoirCapacity" = params_cluster[["reservoircapacity"]], + "efficiency" = params_cluster[["efficiency"]], + "initialLevel" = params_cluster[["initiallevel"]], + "initialLevelOptim" = params_cluster[["initialleveloptim"]], + "enabled" = params_cluster[["enabled"]]) - cmd <- api_command_generate( - action = "create_st_storage", - area_id = area, - parameters = params_cluster - ) + list_properties <- dropNulls(list_properties) - api_command_register(cmd, opts = opts) - `if`( - should_command_be_executed(opts), - api_command_execute(cmd, opts = opts, text_alert = "{.emph create_st_storage}: {msg_api}"), - cli_command_registered("create_st_storage") - ) + # make json file + body <- jsonlite::toJSON(list_properties, + auto_unbox = TRUE) + + # send request (without coeffs/term) + result <- api_post(opts = opts, + endpoint = file.path(opts$study_id, + "areas", + area, + "storages"), + body = body, + encode = "raw") + + cli::cli_alert_success("Endpoint {.emph {'Create ST-storage (properties)'}} {.emph + {.strong {cluster_name}}} success") - for (i in names(storage_value)){ - if (!is.null(get(i))) { - # format name for API - data_param_name <- transform_name_to_id(storage_value[[i]]$string, - id_dash = TRUE) + ## + # PUT api call for each TS value + ## + + # adapt list name TS + list_value_ts <- list(pmax_injection = PMAX_injection, + pmax_withdrawal = PMAX_withdrawal, + inflows = inflows, + lower_rule_curve = lower_rule_curve, + upper_rule_curve = upper_rule_curve) + + list_value_ts <- dropNulls(list_value_ts) + + if(length(list_value_ts)!=0){ + lapply(names(list_value_ts), function(x){ + body = jsonlite::toJSON(list(data=list_value_ts[[x]], + index=0, + columns=0), + auto_unbox = FALSE) - currPath <- paste0("input/st-storage/series/%s/%s/",data_param_name) - cmd <- api_command_generate( - action = "replace_matrix", - target = sprintf(currPath, area, cluster_name), - matrix = get(i) - ) - api_command_register(cmd, opts = opts) - `if`( - should_command_be_executed(opts), - api_command_execute(cmd, - opts = opts, - text_alert = paste0("Writing ", - i, - " cluster's series: {msg_api}")), - cli_command_registered("replace_matrix") - ) - } + endpoint <- file.path(opts$study_id, + "areas", + area, + "storages", + cluster_name, + "series", + x) + + # update + api_put(opts = opts, + endpoint = endpoint, + body = body, + encode = "raw") + + cli::cli_alert_success("Endpoint {.emph {'Create ST-storage (TS value)'}} {.emph + {.strong {x}}} success") + }) + } - return(invisible(opts)) } ########################## - diff --git a/R/editClusterST.R b/R/editClusterST.R index 17fedc6d..d5a4e517 100644 --- a/R/editClusterST.R +++ b/R/editClusterST.R @@ -91,65 +91,78 @@ editClusterST <- function(area, # format name for API cluster_name <- transform_name_to_id(cluster_name) - # /!\ temporary solution /!\ - # as the endpoint does not return an error if the cluster does not exist - if(!is_api_mocked(opts)){ - exists <- FALSE - suppressWarnings( - clusters <- readClusterSTDesc(opts = opts) - ) - if (nrow(clusters) > 0) { - clusters_filtered <- clusters[clusters$area == tolower(area) & - clusters$cluster == cluster_name,] - exists <- nrow(clusters_filtered) > 0 - } - assertthat::assert_that(exists, - msg = paste0("Cluster '", - cluster_name, - "' does not exist. It can not be edited.")) - } + ## + # PATCH for properties + ## + # adapt parameter names + list_properties <- list("group" = params_cluster[["group"]], + "name" = cluster_name, + "injectionNominalCapacity" = params_cluster[["injectionnominalcapacity"]], + "withdrawalNominalCapacity" = params_cluster[["withdrawalnominalcapacity"]], + "reservoirCapacity" = params_cluster[["reservoircapacity"]], + "efficiency" = params_cluster[["efficiency"]], + "initialLevel" = params_cluster[["initiallevel"]], + "initialLevelOptim" = params_cluster[["initialleveloptim"]], + "enabled" = params_cluster[["enabled"]]) - # update parameters if something else than name - if (length(params_cluster) > 1) { - currPath <- "input/st-storage/clusters/%s/list/%s" - writeIni( - listData = params_cluster, - pathIni = sprintf(currPath, area, cluster_name), - opts = opts - ) + list_properties <- dropNulls(list_properties) + + if(length(list_properties)>1){ + # make json file + body <- jsonlite::toJSON(list_properties, + auto_unbox = TRUE) + + # send request (without coeffs/term) + result <- api_patch(opts = opts, + endpoint = file.path(opts$study_id, + "areas", + area, + "storages", + cluster_name), + body = body, + encode = "raw") + + cli::cli_alert_success("Endpoint {.emph {'Edit ST-storage (properties)'}} {.emph + {.strong {cluster_name}}} success") } - # update data - names_data_params <- c("PMAX_injection", - "PMAX_withdrawal", - "inflows", - "lower_rule_curve", - "upper_rule_curve") + ## + # PUT for TS values + ## + # adapt list name TS + list_value_ts <- list(pmax_injection = PMAX_injection, + pmax_withdrawal = PMAX_withdrawal, + inflows = inflows, + lower_rule_curve = lower_rule_curve, + upper_rule_curve = upper_rule_curve) - for (i in names_data_params){ - if (!is.null(get(i))) { - # format name for API - data_param_name <- transform_name_to_id(i, id_dash = TRUE) + list_value_ts <- dropNulls(list_value_ts) + + if(length(list_value_ts)!=0){ + lapply(names(list_value_ts), function(x){ + body = jsonlite::toJSON(list(data=list_value_ts[[x]], + index=0, + columns=0), + auto_unbox = FALSE) + + endpoint <- file.path(opts$study_id, + "areas", + area, + "storages", + cluster_name, + "series", + x) - currPath <- paste0("input/st-storage/series/%s/%s/",data_param_name) - cmd <- api_command_generate( - action = "replace_matrix", - target = sprintf(currPath, area, cluster_name), - matrix = get(i) - ) - api_command_register(cmd, opts = opts) - `if`( - should_command_be_executed(opts), - api_command_execute(cmd, - opts = opts, - text_alert = paste0("Update ", - i, - " cluster's series: {msg_api}")), - cli_command_registered("replace_matrix") - ) - } + # update + api_put(opts = opts, + endpoint = endpoint, + body = body, + encode = "raw") + + cli::cli_alert_success("Endpoint {.emph {'Edit ST-storage (TS value)'}} {.emph + {.strong {x}}} success") + }) } - return(invisible(opts)) } #####- diff --git a/R/removeCluster.R b/R/removeCluster.R index 7989543e..b94901c8 100644 --- a/R/removeCluster.R +++ b/R/removeCluster.R @@ -1,9 +1,10 @@ #' @title Remove a cluster #' #' @description -#' `r antaresEditObject:::badge_api_ok()` (thermal clusters only) +#' `r antaresEditObject:::badge_api_ok()` #' -#' Remove a cluster, thermal RES (renewable energy source) or short-term storage, and all its data. +#' Delete cluster(s), thermal, renewable (renewable energy source) or short-term storage, +#' along with all its data (properties + TS). #' #' #' @inheritParams createCluster @@ -75,38 +76,6 @@ removeClusterST <- function(area, ) } - -.api_command_generate_remove_cluster <- function(area, - cluster_name, - cluster_type = c("thermal", "renewables", "st-storage") - ) { - - cluster_type <- match.arg(cluster_type) - - remove_action <- switch(cluster_type, - "thermal" = "remove_cluster", - "renewables" = "remove_renewables_cluster", - "st-storage" = "remove_st_storage" - ) - - if (identical(cluster_type, "st-storage")) { - cmd <- api_command_generate( - action = remove_action, - area_id = area, - storage_id = cluster_name - ) - } else { - cmd <- api_command_generate( - action = remove_action, - area_id = area, - cluster_id = cluster_name - ) - } - - return(cmd) -} - - .removeCluster <- function(area, cluster_name, add_prefix = TRUE, @@ -118,29 +87,20 @@ removeClusterST <- function(area, area <- tolower(area) check_area_name(area, opts) api_study <- is_api_study(opts) - api_mocked <- is_api_mocked(opts) is_thermal <- identical(cluster_type, "thermal") - # check cluster short-term storage existence - if (identical(cluster_type,"st-storage")) { - # To avoid failure in an unit test (API is mocked) we add this block - if (api_study && api_mocked) { - cluster_exists <- TRUE - } else { - cluster_exists <- check_cluster_name(area_name = area, cluster_name = cluster_name, add_prefix = add_prefix, opts = opts) - } - assertthat::assert_that(cluster_exists, msg = "Cluster can not be removed. It does not exist.") - } - + # add prefix to cluster's name cluster_name <- generate_cluster_name(area, cluster_name, add_prefix) # check if the cluster can be removed safely, i.e. the cluster is not referenced in a binding constraint if (is_thermal) { - if (!api_study | (api_study && !api_mocked)) { - bc_not_remove <- detect_pattern_in_binding_constraint(pattern = paste0(area, ".", cluster_name), opts = opts) - if (!identical(bc_not_remove, character(0))) { - warning("The following binding constraints have the cluster to remove as a coefficient : ", paste0(bc_not_remove, collapse = ", ")) - } + if (!api_study) { + bc_not_remove <- detect_pattern_in_binding_constraint(pattern = paste0(area, ".", cluster_name), + opts = opts) + if (!identical(bc_not_remove, character(0))) + warning("The following binding constraints have the cluster to remove as a coefficient : ", + paste0(bc_not_remove, collapse = ", ")) + } } @@ -148,15 +108,29 @@ removeClusterST <- function(area, # format name for API cluster_name <- transform_name_to_id(cluster_name) - cmd <- .api_command_generate_remove_cluster(area, cluster_name, cluster_type) - - api_command_register(cmd, opts = opts) - `if`( - should_command_be_executed(opts), - api_command_execute(cmd, opts = opts, text_alert = paste0("{.emph ", cmd$action, "}: {msg_api}")), - cli_command_registered(cmd$action) + # adapt type for api + api_type <- switch( + cluster_type, + "thermal" = "clusters/thermal", + "renewables" = "clusters/renewable", + "st-storage" = "storages" ) + # body request + body <- jsonlite::toJSON(cluster_name) + + # delete + api_delete(opts = opts, + endpoint = file.path(opts$study_id, + "areas", + area, + api_type), + body = body, + encode = "raw") + + cli::cli_alert_success("Endpoint {.emph {'Delete Cluster'}} {.emph + [{cluster_type}] {.strong {cluster_name}}} success") + return(invisible(opts)) } diff --git a/R/utils.R b/R/utils.R index 060cacc3..bea73698 100644 --- a/R/utils.R +++ b/R/utils.R @@ -159,22 +159,6 @@ generate_cluster_name <- function(area, cluster_name, add_prefix) { } -#' @importFrom antaresRead readClusterSTDesc simOptions -check_cluster_name <- function(area_name, cluster_name, add_prefix, opts = simOptions()) { - - exists <- FALSE - - clusters <- readClusterSTDesc(opts = opts) - if (nrow(clusters) > 0) { - cluster_name <- generate_cluster_name(area = area_name, cluster_name = cluster_name, add_prefix = add_prefix) - clusters_filtered <- clusters[clusters$area == tolower(area_name) & clusters$cluster == cluster_name,] - exists <- nrow(clusters_filtered) > 0 - } - - return(exists) -} - - #' @title Format a value to a suitable format to rhs in an .ini file. #' #' @param value The value to format. diff --git a/man/api_patch.Rd b/man/api_patch.Rd new file mode 100644 index 00000000..42b51a21 --- /dev/null +++ b/man/api_patch.Rd @@ -0,0 +1,52 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/API-utils.R +\name{api_patch} +\alias{api_patch} +\title{API methods} +\usage{ +api_patch(opts, endpoint, ..., default_endpoint = "v1/studies") +} +\arguments{ +\item{opts}{Antares simulation options or a \code{list} with an \verb{host = } slot.} + +\item{endpoint}{API endpoint to interrogate, it will be added after \code{default_endpoint}. +Can be a full URL (by wrapping ìn \code{\link[=I]{I()}}), in that case \code{default_endpoint} is ignored.} + +\item{...}{Additional arguments passed to API method (\code{\link[httr:PATCH]{httr::PATCH()}}).} + +\item{default_endpoint}{Default endpoint to use.} +} +\value{ +Response from the API. +} +\description{ +API methods +} +\examples{ +\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") + +} +} diff --git a/man/removeCluster.Rd b/man/removeCluster.Rd index 912cb08a..60f4f7d2 100644 --- a/man/removeCluster.Rd +++ b/man/removeCluster.Rd @@ -41,9 +41,10 @@ removeClusterST( An updated list containing various information about the simulation. } \description{ -\ifelse{html}{\figure{badge_api_ok.svg}{options: alt='Antares API OK'}}{Antares API: \strong{OK}} (thermal clusters only) +\ifelse{html}{\figure{badge_api_ok.svg}{options: alt='Antares API OK'}}{Antares API: \strong{OK}} -Remove a cluster, thermal RES (renewable energy source) or short-term storage, and all its data. +Delete cluster(s), thermal, renewable (renewable energy source) or short-term storage, +along with all its data (properties + TS). } \examples{ \dontrun{ diff --git a/tests/testthat/test-createClusterST.R b/tests/testthat/test-createClusterST.R index 04b65c34..6afbff38 100644 --- a/tests/testthat/test-createClusterST.R +++ b/tests/testthat/test-createClusterST.R @@ -172,95 +172,6 @@ test_that("Create short-term storage cluster (new feature v8.6)",{ }) - -# API ---- - -test_that("API Command test for createClusterST", { - # Simulation parameters for api code - opts_mock <- mockSimulationAPI(force = TRUE, - antares_version = "860") - - # create complete cluster st-storage - - area_name <- "area01" - cluster_name <- "ClusTER01" - - # no casse sensitiv - createClusterST(area = area_name, - cluster_name = cluster_name, - group = "Other", - storage_parameters = storage_values_default(), - PMAX_injection = matrix(1,8760), - PMAX_withdrawal = matrix(0.5,8760), - inflows = matrix(0.25,8760), - lower_rule_curve = matrix(0.2,8760), - upper_rule_curve = matrix(0.9,8760)) - - # use getVariantCommands to catch information - # here (specific st-storage : `list` with 1 group (parameters) + 5 data parameters) - res_list <- getVariantCommands(last = 6) - - ## test first group of list for ini parameters - action_api_1 <- res_list[[1]] - - # name of api instruction/action - testthat::expect_equal(action_api_1$action, "create_st_storage") - # check names and values parameters - names_st_paramas <- names(storage_values_default()) - names_vector_parameters <-setdiff(names(action_api_1$args$parameters), - c("name", "group")) - # check if all parameters are present - testthat::expect_true(all(names_st_paramas - %in% names_vector_parameters)) - # check casse name cluster - name_ori <- paste0(area_name, "_", cluster_name) - - testthat::expect_equal(tolower(name_ori), - action_api_1$args$parameters$name) - - ## test other group for data - # search "replace_matrix" action - index_data <- lapply(res_list, `[[`, 1) %in% - "replace_matrix" - - data_list <- res_list[index_data] - - # test for every floor in "args" : - # "target" (path of txt file) - # "matrix" (data) - data_path_files <- lapply(data_list, function(x){ - x$args$target - }) - - # test for every path, the path destination + name of txt file - # name txt files corresponding data parameters of function `createClusterST()` - full_root_path_name <- file.path("input", "st-storage", "series", area_name, - tolower(name_ori)) - - # from code - # these names ares approved with antares desktop but not with API - names_file_list <- c("PMAX-injection", "PMAX-withdrawal", "inflows", - "lower-rule-curve", "upper-rule-curve") - - # reformat API - names_file_list <- transform_name_to_id(names_file_list, id_dash = TRUE) - - # check root path for every file - is_good_path <- lapply(data_path_files, function(x){ - grepl(pattern = full_root_path_name, x = x) - }) - - testthat::expect_true(all(unlist(is_good_path))) - - # check names of files - names_file_api <- lapply(data_path_files, function(x){ - regmatches(x,regexpr("([^\\/]+$)",x)) - }) - - testthat::expect_true(all(unlist(names_file_api) %in% - names_file_list)) -}) - # >=880 ---- test_that("Create short-term storage cluster (new feature v8.8.0)",{ diff --git a/tests/testthat/test-editClusterST.R b/tests/testthat/test-editClusterST.R index 6c57d5c6..2d67dec2 100644 --- a/tests/testthat/test-editClusterST.R +++ b/tests/testthat/test-editClusterST.R @@ -150,93 +150,6 @@ test_that("edit st-storage clusters (only for study >= v8.6.0" , { unlink(opts_test$studyPath, recursive = TRUE) }) - - -# API ---- - -test_that("API Command test for editClusterST", { - # Simulation parameters for api code - opts_mock <- mockSimulationAPI(force = TRUE, - antares_version = "860") - - # create complete cluster st-storage - area_name <- "area01" - cluster_name <- "ClusTER01" - - # create complete cluster st-storage - editClusterST(area = area_name, - cluster_name = cluster_name, - group = "Other1", - storage_parameters = storage_values_default(), - PMAX_injection = matrix(1,8760), - PMAX_withdrawal = matrix(0.5,8760), - inflows = matrix(0.25,8760), - lower_rule_curve = matrix(0.2,8760), - upper_rule_curve = matrix(0.9,8760)) - - # use getVariantCommands to catch information - # here (specific st-storage : list with 8 group (parameters) + 5 data parameters) - res_list <- getVariantCommands(last = 13) - - ## test first group of list for ini parameters - action_api_1 <- res_list[[1]] - - # name of api instruction/action - testthat::expect_equal(action_api_1$action, "update_config") - # check "args" name parameters (just for one parameter/one action) - param_target <- res_list[[3]]$args$target - param_target <- regmatches(param_target, regexpr("([^\\/]+$)",param_target)) - testthat::expect_equal(param_target, "efficiency") - - # check "data" (value of parameter) - testthat::expect_equal("1.000000", res_list[[3]]$args$data) - - ## test other group for data - # search "replace_matrix" action - index_data <- lapply(res_list, `[[`, 1) %in% - "replace_matrix" - - data_list <- res_list[index_data] - - # test for every floor in "args" : - # "target" (path of txt file) - # "matrix" (data) - data_path_files <- lapply(data_list, function(x){ - x$args$target - }) - - # test for every path, the path destination + name of txt file - # name txt files corresponding data parameters of function `editClusterST()` - # check casse of name cluster name in every path - name_ori <- paste0(area_name, "_", cluster_name) - - full_root_path_name <- file.path("input", "st-storage", "series", area_name, - tolower(name_ori)) - - # from code - # these names are approved with antares desktop but not with API - names_file_list <- c("PMAX-injection", "PMAX-withdrawal", "inflows", - "lower-rule-curve", "upper-rule-curve") - - # reformat API - names_file_list <- transform_name_to_id(names_file_list, id_dash = TRUE) - - # check root path for every file - is_good_path <- lapply(data_path_files, function(x){ - grepl(pattern = full_root_path_name, x = x) - }) - - testthat::expect_true(all(unlist(is_good_path))) - - # check names of files - names_file_api <- lapply(data_path_files, function(x){ - regmatches(x,regexpr("([^\\/]+$)",x)) - }) - - testthat::expect_true(all(unlist(names_file_api) %in% - names_file_list)) -}) - # v880 ---- test_that("Edit short-term storage cluster (new feature v8.8.0)",{ ## basics errors cases ---- diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 0f976911..ae291671 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -1,36 +1,3 @@ -test_that("Control the short-term storage existence",{ - - ant_version <- "8.7.0" - study_name <- paste0("my_study_870_", paste0(sample(letters,5),collapse = "")) - suppressWarnings(opts <- createStudy(path = pathstd, study_name = study_name, antares_version = ant_version)) - - nb_areas <- 5 - ids_areas <- seq(1,nb_areas) - my_areas <- paste0("zone",ids_areas) - - lapply(my_areas, FUN = function(area){createArea(name = area, opts = simOptions())}) - - st_clusters <- c("batterie", "pondage") - my_clusters <- expand.grid("area" = my_areas, "cluster_name" = st_clusters) - - apply(my_clusters[,c("area","cluster_name")], - MARGIN = 1, - FUN = function(row){ - createClusterST(area = as.character(row[1]), - cluster_name = as.character(row[2]), - add_prefix = FALSE, - opts = simOptions() - ) - } - ) - - createClusterST(area = "zone1", cluster_name = "vehicle", add_prefix = FALSE, opts = simOptions()) - exists_st_cluster <- check_cluster_name(area = "zone1", cluster_name = "vehicle", add_prefix = FALSE, opts = simOptions()) - expect_true(exists_st_cluster) - exists_st_cluster <- check_cluster_name(area = "zone3", cluster_name = "vehicle", add_prefix = FALSE, opts = simOptions()) - expect_false(exists_st_cluster) -}) - test_that("Control the basic behaviour of .format_ini_rhs()",{ diff --git a/vignettes/api-variant-management.Rmd b/vignettes/api-variant-management.Rmd index 6d9ffaa9..39b98fc6 100644 --- a/vignettes/api-variant-management.Rmd +++ b/vignettes/api-variant-management.Rmd @@ -231,9 +231,9 @@ getVariantCommands(last = TRUE) ``` -Remove a cluster with: +Remove a cluster with (`removeCluster()` has been updated with endpoint and no longer uses an api command ): -```{r remove_cluster} +```{r remove_cluster, eval=FALSE} createCluster( area = "area02", cluster_name = "clus000"