API reference

Trees

A working tree as a Merkle tree of content digests: which blobs the cell lacks, and how to send and fetch them.

POST/v1/ci/trees/blobs

Store small tree blobs

Store small tree blobs from one body.

Permission: ci:blobs.write

Request body

blobsarray of objectsRequired
blobs[].data_b64stringRequired
blobs[].digeststringRequired
sha-256 digest as sha256:<64 hex>

Response201 Created

storedarray of strings
curl -X POST "$CIRESK_API/v1/ci/trees/blobs" \
  -H "Authorization: Bearer $CIRESK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "blobs": [
      {
        "data_b64": "acme/platform",
        "digest": "sha256:c21fa32a40d82233c44e76e6ae776b4d403ac1a564ca26de95a14c6bb47eaf49"
      }
    ]
  }'
POST/v1/ci/trees/delta

Get a tree's missing manifests

The manifests of a tree that the worker's held trees lack, inline.

Permission: ci:blobs.read

Request body

havearray of strings
the roots the worker's slots of the repository hold; the first TREE_DELTA_MAX_HAVE count
rootstringRequired
the root digest of a working tree: sha-256 of the root directory manifest

Response200 OK

completeboolean
every manifest of root outside the have trees is in manifests; false when the delta passed TREE_DELTA_MAX_MANIFESTS or the cell no longer holds a manifest, and the worker walks the tree level by level
manifestsarray of objects
manifests[].data_b64stringRequired
manifests[].digeststringRequired
sha-256 digest as sha256:<64 hex>
curl -X POST "$CIRESK_API/v1/ci/trees/delta" \
  -H "Authorization: Bearer $CIRESK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "have": [
      "sha256:0db7fed5a18ebe9d0e3049448d5ec65f6a1ea5a38a77b61105bdd8e14b9bef83"
    ],
    "root": "sha256:4827d3132b09e1cedc07788771ef7bca9c1140b2dff2ac370fc8433a94de43e5"
  }'
POST/v1/ci/trees/download

Get tree blob downloads

Presigned downloads for a page of tree blobs.

Permission: ci:blobs.read

Request body

cursorstring or null
digestsarray of stringsRequired

Response200 OK

blobsarray of objects
blobs[].digeststringRequired
sha-256 digest as sha256:<64 hex>
blobs[].downloadobjectRequired
a presigned get
blobs[].download.expires_atstring (date-time)Required
blobs[].download.urlstringRequired
blobs[].sizeintegerRequired
next_cursorstring or null
curl -X POST "$CIRESK_API/v1/ci/trees/download" \
  -H "Authorization: Bearer $CIRESK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cursor": "eyJOi5k8U45exDKu22IvXLqJ7m7",
    "digests": [
      "sha256:c21fa32a40d82233c44e76e6ae776b4d403ac1a564ca26de95a14c6bb47eaf49"
    ]
  }'
POST/v1/ci/trees/missing

Check which tree blobs are missing

Which of these blobs the tenant's cas lacks, with presigned uploads.

Permission: ci:blobs.write

Request body

cursorstring or null
digestsarray of objectsRequired
digests[].digeststringRequired
sha-256 digest as sha256:<64 hex>
digests[].sizeintegerRequired

Response200 OK

missingarray of objects
missing[].digeststringRequired
sha-256 digest as sha256:<64 hex>
missing[].sizeintegerRequired
missing[].uploadobjectRequired
how one missing blob gets to the tenant's cas, bound to the tenant and the submitting principal
missing[].upload.modestringRequired
One of chunked
missing[].upload.uploadobject
a presigned put
missing[].upload.upload.expires_atstring (date-time)Required
missing[].upload.upload.headersmap of string
missing[].upload.upload.methodstringRequired
missing[].upload.upload.urlstringRequired
missing[].upload.completeobject
a presigned put
missing[].upload.complete.expires_atstring (date-time)Required
missing[].upload.complete.headersmap of string
missing[].upload.complete.methodstringRequired
missing[].upload.complete.urlstringRequired
missing[].upload.partsarray of objects
missing[].upload.parts[].indexintegerRequired
missing[].upload.parts[].lenintegerRequired
missing[].upload.parts[].offsetintegerRequired
missing[].upload.parts[].uploadobjectRequired
a presigned put
missing[].upload.upload_idstring
next_cursorstring or null
curl -X POST "$CIRESK_API/v1/ci/trees/missing" \
  -H "Authorization: Bearer $CIRESK_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "cursor": "eyJOi5k8U45exDKu22IvXLqJ7m7",
    "digests": [
      {
        "digest": "sha256:c21fa32a40d82233c44e76e6ae776b4d403ac1a564ca26de95a14c6bb47eaf49",
        "size": 18432000
      }
    ]
  }'