Write file content
Stream bytes to a temporary file, then replace the target.
- An interrupted transfer keeps the old file.
- With
mode, the file gets those permission bits before it replaces the target, so it never appears without them. Withoutmode, a replaced file keeps its mode.
See Write files in the guide.
Authorization
apiKey API key starting with tektona_. Create one at app-dev.tektona.ai under API Keys.
In: header
Path Parameters
Query Parameters
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.
Permission bits as a decimal integer (493 is 0o755)
0 <= value <= 4095Header Parameters
Value in
- "*"
Request Body
application/octet-stream
TypeScript Definitions
Use the request body type in TypeScript.
binaryResponse Body
application/json
application/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
application/problem+json
curl -X PUT "https://example.com/v1/sandboxes/string/files/content?path=string" \ -H "Content-Type: application/octet-stream" \ -d 'string'{ "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 }, "etag": "string"}{ "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 }, "etag": "string"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}{ "detail": "Property foo is required but is missing.", "errors": [ { "location": "string", "message": "string", "value": null } ], "instance": "https://example.com/error-log/abc123", "status": 400, "title": "Bad Request", "type": "https://example.com/errors/example"}Watch file changes GET
Upgrade to WebSocket and receive `SandboxFilesWatchFrame` JSON text frames. - Wait for `ready`. Then list or read what you need. Then apply the `changes` frames that arrived meanwhile, and the ones after. - `seq` counts the frames of this subscriber. A skipped `seq`, a frame that is not valid, or a close without `end` means lost changes: open a new watch and list again. - On `resync`, list again. `end` is the last frame. - Close code 4001 means the watch expired after 15 minutes. 1001 means the server shut down. - Needs read access. `user` needs write access. - Served at the access endpoint of the sandbox (`access_endpoint` of `GET /v1/sandboxes/{sandboxId}`). A browser offers the credential as the WebSocket protocol `Bearer-<token>`. See [Watch for changes](https://docs.tektona.ai/files#watch-for-changes) in the guide.
Add a git remote POST
Add a remote with an HTTPS `url` that holds no credentials. - An existing name returns 409 `already_exists`. - Local git writes on one work tree run one at a time. A write through the files endpoints does not wait for them. After a timeout, the outcome is unknown: the command can have run. - Runs in the sandbox as the image user. Needs write access to the sandbox, because git runs the repository's own config and filters. - 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.