connectapi
connectapi copied to clipboard
Implement client$runtimes to get all runtimes
We currently have client$server_settings_r
but I couldn't find a good way to get everything. Here's a possible implementation:
library(connectapi)
library(purrr)
client <- connect()
tidy_settings <- function(type = c("r", "python", "quarto")) {
type = match.arg(type)
settings = client$GET(paste0("v1/server_settings/", type))
out = map_dfr(settings$installations, ~as.data.frame(.))
out$runtime = type
return(out[, c("runtime", "version")])
}
map_dfr(c("python", "r", "quarto"), tidy_settings)