Deleting Runtime Caches
Problem
You want to request the removal of a specified runtime cache.
Solution
You must specify the language, version, and image name for the runtime cache you wish to delete. See Viewing Runtime Caches to view runtime caches on your Connect server.
from posit import connect
= "Python"
LANGUAGE = "3.12.0"
VERSION = "Local"
IMAGE_NAME
= connect.Client()
client
= client.system.caches.runtime.destroy(
task = LANGUAGE,
language = VERSION,
version = IMAGE_NAME,
image_name
)
# Wait for cache deletion to complete
task.wait_for()
# Confirm runtime caches
= client.system.caches.runtime.find() caches
Note
This functionality requires connectapi
version 0.4.0 or later.
You must specify the language, version, and image name for the runtime cache you wish to delete. See Viewing Runtime Caches to view runtime caches on your Connect server.
library(connectapi)
<- "R"
LANGUAGE <- "4.3.0"
VERSION <- "Local"
IMAGE_NAME
<- connect()
client
<- connect()
client
<- delete_runtime_cache(
task
client,language = LANGUAGE,
version = VERSION,
image_name = IMAGE_NAME
)
Runtime cache deletion can take some time. A successful request indicates that deletion was started, and returns a task object. You can use the poll_task()
function to check the status of the deletion.
> poll_task(task)
Deleting runtime cache...
Successfully deleted runtime cache:
Posit Connect Task: ER6i7P1B664bt4KW Task ID