SandboxesFiles

Create a directory

Create path and its missing parents, like mkdir -p.

  • An existing directory, or a symlink to one, returns created=false and keeps its mode.
  • Any other existing entry returns 409 already_exists. A parent that is a file returns 400 not_a_directory.
  • 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.
PUT
/v1/sandboxes/{sandboxId}/files/directory
AuthorizationBearer <token>

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

In: header

Path Parameters

sandboxId*string

Sandbox ID (ULID)

Query Parameters

resume?boolean

Wake a paused sandbox to serve this request

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

mode?integer

Permission bits of the new directory as a decimal integer (493 is 0o755); 0 keeps the default. Missing parents get the default

Formatint32
Range0 <= value <= 4095
path*string

Directory to create, with its missing parents

Length1 <= length
user?string

Guest user to run as, by name or uid; defaults to the image user

Match^[a-z_][a-z0-9_-]{0,31}$|^[0-9]{1,10}$

Response Body

application/json

application/problem+json

curl -X PUT "https://example.com/v1/sandboxes/string/files/directory" \  -H "Content-Type: application/json" \  -d '{    "path": "string"  }'
{  "created": true,  "entry": {    "gid": 0,    "group": "string",    "mode": 0,    "modified_at": "2019-08-24T14:15:22Z",    "name": "string",    "owner": "string",    "path": "string",    "size": 0,    "symlink_target": "string",    "type": "file",    "uid": 0  }}

List files GET

Return the entry at `path` and, down to `depth`, the entries under it. - The listing is one traversal, not one snapshot. It walks depth first: each folder is followed by its entries, and names sort in byte order. - Symlinks are never followed. A broken link is listed. - `exclude` and `gitignore` skip an entry and everything under it. A skipped entry does not count against `limit`. - With `gitignore`, a work tree in which git ignores more than 20000 paths fails with 413 `too_large`. Use `exclude` there. - A listing with more than `limit` entries returns `pagination.next_cursor`. Pass it as `cursor`, with the same other parameters, to list the next page. An entry added after the cursor position shows up on a later page; one added before it is missed. - `truncated_paths` names the folders that miss entries that no page returns: a cut at `per_dir_limit`, a folder above 100,000 entries, or a folder that the user cannot read. - 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. See [Read files](https://docs.tektona.ai/files#read-files) in the guide.

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.