Convert an oci image
Resolves ref to its manifest for a firecracker host’s arch and
starts converting it to a rootfs on that host in the background.
Answers 202 with the image’s digest and state; poll
GET /v1/images/{digest} until it is ready, then create with
spec.image_digest. A create is pinned to a host where the image
is ready.
host_id and labels pick the host the way a create’s placement
does. Without them the same ref keeps landing on the same host, so
converting it again finds the earlier conversion: a ref that is
already converting or ready answers with that record, and one that
failed is retried.
Public registries only, and only apt and dnf based images convert. A qemu host cannot convert: pinning to one is a 400.
Each firecracker host caps the disk its converted images hold
(FC_IMAGE_CACHE_GB). A convert that would pass the cap first
evicts the least recently used ready images that no vm or
snapshot on the host was booted from; an evicted image reads as
404 again and a create naming it is a 409 until it is converted
again. When nothing can be evicted the convert is a 507.
The convert runs as an operation of kind image.convert: a retry
that carries the first call’s Idempotency-Key with the same
request attaches to the first convert instead of starting another,
and the same key with a different request is a 409. A convert that
answered 5xx (a 507 cache full, a 503) runs again on its retry.
/v1/imagesAuthorizationBearer token · headerrequiredfuse_sessionAPI key · cookierequiredwaitstringIdempotency-Keystringapplication/jsonrefstringrequiredhost_idstringregionstringlabelsobjectdigeststringrequiredrefstringrequiredmanifest_digeststringrequiredhost_idstringrequiredstatestringrequiredconvertingreadyfailederrorstringoperation_idstringrequiredoperationOperationrequiredShow propertiesHide properties
idstringrequiredkindstringrequiredcreatedestroyforkmigratesnapshotrestoredrainimage.convertstatestringrequiredrunningsucceededfailedstepstringstarted_atstring<date-time>requiredfinished_atstring<date-time>status_codeintegerresultobjecterrorobjectShow propertiesHide properties
codestringrequiredmessagestringrequireddetailsobjectretry_afterintegererrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjecterrorobjectrequiredShow propertiesHide properties
codestringrequirednot_foundroute_not_foundconflictinvalid_argumentunauthorizedforbiddenunavailableinternalunimplementedlockedmessagestringrequireddetailsobjectcurl -X POST "http://localhost:8080/v1/images" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"ref": "string",
"host_id": "string",
"region": "string",
"labels": {}
}'const response = await fetch("http://localhost:8080/v1/images", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"ref": "string",
"host_id": "string",
"region": "string",
"labels": {}
})
});import requests
response = requests.post(
"http://localhost:8080/v1/images",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"ref": "string",
"host_id": "string",
"region": "string",
"labels": {}
},
){
"digest": "string",
"ref": "string",
"manifest_digest": "string",
"host_id": "string",
"state": "converting",
"error": "string"
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}{
"error": {
"code": "not_found",
"message": "string",
"details": {}
}
}