SandboxesFiles

Read file content

Stream the file bytes, at any size.

  • An unconditioned read of a file up to 1 MiB has a strong ETag.
  • A Range response has no ETag, unless If-Range carries the strong ETag of the file. Then the range comes with the ETag, and a file that changed meanwhile gets the whole file with 200.
  • If-Range with a date, a weak ETag or a file above 1 GiB always gets the whole file.

See Read files in the guide.

GET
/v1/sandboxes/{sandboxId}/files/content
AuthorizationBearer <token>

API key starting with tektona_. Create one at app-dev.tektona.ai under API Keys.

In: header

Path Parameters

sandboxId*string

Query Parameters

path*string

Absolute, or relative to the sandbox working directory. A path that starts with ~ or ~/ names the home directory of the user that the operation runs as. ~name returns 422.

user?string
resume?boolean

Header Parameters

If-None-Match?string
Range?string
If-Range?string

Response Body

application/octet-stream

application/octet-stream

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

application/problem+json

curl -X GET "https://example.com/v1/sandboxes/string/files/content?path=string"

The body is not JSON: application/octet-stream

Move a file or directory PUT

Rename `from` to `to`. - An existing destination returns 409 `already_exists`, unless `overwrite=true`. - Runs in the sandbox as the image user, or as `user` when set. Setting `user` needs write access to the sandbox. - Served at the access endpoint of the sandbox (`access_endpoint` of `GET /v1/sandboxes/{sandboxId}`), not at the API host. - A paused sandbox returns 409, unless `resume=true`. A sandbox that started before its files server existed returns 409 `sandbox_update_required` until it restarts. - A refused operation returns its code as the problem type. - A path that starts with `~` or `~/` names the home directory of the user that the operation runs as. `~name` returns 422.

Set a file mode PUT

Set the permission bits of `path`, like `chmod`. - A final symlink is followed. The change is not recursive. - Only the owner or root can change a mode. Another user gets 403 `permission_denied`. - Needs write access to the sandbox. - Runs in the sandbox as the image user, or as `user` when set. Setting `user` needs write access to the sandbox. - Served at the access endpoint of the sandbox (`access_endpoint` of `GET /v1/sandboxes/{sandboxId}`), not at the API host. - A paused sandbox returns 409, unless `resume=true`. A sandbox that started before its files server existed returns 409 `sandbox_update_required` until it restarts. - A refused operation returns its code as the problem type. - A path that starts with `~` or `~/` names the home directory of the user that the operation runs as. `~name` returns 422.