SandboxesFiles

Watch file changes

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 in the guide.

GET
/v1/sandboxes/{sandboxId}/files/watch
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.

Default"."
recursive?boolean
include_entry?boolean

Attach the entry, as the list returns it, to every change but removed

exclude?array<string>

Skip entries that match, and everything under them; a name without / matches at any depth, a name with / matches a path relative to path

user?string

Response Body

application/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/watch"
{  "changes": [    {      "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      },      "old_path": "string",      "op": "created",      "path": "string",      "type": "file"    }  ],  "message": "string",  "path": "string",  "reason": "string",  "seq": 0,  "type": "ready"}