tryCatch(http_config(), error = identity)
# Custom HTTP configuration example:
http_config(
url = "https://api.example.com/launch",
method = "POST",
headers = function() c(
Authorization = sprintf("Bearer %s", Sys.getenv("MY_API_KEY")),
`X-API-Version` = "2"
),
data = '{"command": "%s"}'
)
if (FALSE) {
# Launch 2 daemons using http config default (for Posit Workbench):
daemons(n = 2, url = host_url(), remote = http_config())
# Customise the default Posit Workbench launch (named cluster and profile):
daemons(
n = 2,
url = host_url(),
remote = http_config(cluster = "Kubernetes", resource_profile = "rstudio")
)
# Or specify custom resources (4 CPUs, 8 GB memory):
daemons(
n = 2,
url = host_url(),
remote = http_config(cluster = "Kubernetes", cpus = 4, memory = 8192)
)
}
Run the code above in your browser using DataLab