Skip to content

GET /api/images

Updated

List cloud images already cached on this Lite host.

PropertyValue
Scoperead
Request bodynone
Success200 OK

Endpoint

GET ${baseUrl}/api/images
read

List cloud images already cached on this Lite host.

Use your host URL and API key as shell variables:

baseUrl="https://agent.example.com"
VIRT_AGENT_API_KEY="<your-api-key>"

cURL template

curl --request GET "${baseUrl}/api/images" \
  --header "Authorization: Bearer ${VIRT_AGENT_API_KEY}"
LocationNameTypeRequiredDescription
HeaderAuthorizationbearer tokenyesBearer ${VIRT_AGENT_API_KEY}.

Returns an array of cached image objects.

FieldTypeDescription
image_idstringStable cache id used by POST /api/vms.image.image_id.
sha256stringSHA-256 digest of the cached image file.
size_bytesintegerSize of the cached file on disk.
pathstringAbsolute path on the Lite host. Use this as disk.base_path only from trusted automation.
distrostringNormalized distro label, or an empty string when unknown.
Terminal window
baseUrl="https://agent.example.com"
VIRT_AGENT_API_KEY="<your-api-key>"
curl "${baseUrl}/api/images" \
--header "Authorization: Bearer ${VIRT_AGENT_API_KEY}"
[
{
"image_id": "debian-13-x86_64",
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef",
"size_bytes": 8589934592,
"path": "/var/lib/virtainer/images/debian-13-x86_64.qcow2",
"distro": "debian"
}
]
StatusCodeDescription
401UNAUTHORIZEDAPI key is missing or invalid.
403FORBIDDENAPI key is valid but not allowed to access the endpoint.
500INTERNAL or STORAGE_ERRORThe host could not read the image cache.