tommy

Rendered from docs/openapi-files.json in the repository.

On this page

tommy files API v1

Accepts the files your application uploads over FTP, SFTP or TFTP instead of shipping them anywhere, and keeps them in a virtual filesystem you can browse, download from and assert against. Every upload, mkdir, delete and rename is also recorded as an event, so the tree shows what is there now and the log shows how it got that way.

These routes read back what tommy captured, in the shape this content type wants: filters that only mean something here, and the parts that are bytes rather than JSON. They read from the same store as the events API, so a client that sends and immediately fetches sees its own write, and every entry carries the id of the event behind it.

The events API - /api/v1/events, described in its own document - is the generic view of the same captures, and is the one to use when what you are asserting does not depend on the content type. The fake vendor endpoints are described nowhere here: they are the vendors' specifications, not tommy's.

This document is generated from the server's route table. It cannot describe a route that does not exist, and CI fails if the checked-in copy stops matching the code.

Server

  • /api/v1/files — This tommy's files API.

Operations

GET /content/{path} A file's bytes, streamed from the blob store with range support.

Parameters

NameInTypeDescription
path required path string Path inside the shared virtual filesystem. It may contain slashes: this is the whole remaining path, not one segment.

Responses

StatusBodyDescription
200 application/octet-stream
Success.
404 application/json · api.Error
No such resource, or it belongs to another plugin.
DELETE /content/{path} Delete one file, or a directory with ?recursive=1.

Parameters

NameInTypeDescription
path required path string Path inside the shared virtual filesystem. It may contain slashes: this is the whole remaining path, not one segment.
recursive query boolean Required to delete a directory, so a mistyped path cannot take a subtree with it.

Responses

StatusBodyDescription
204 no body Done. No body.
400 application/json · api.Error
A query parameter could not be parsed - a malformed since, a negative limit.
404 application/json · api.Error
No such resource, or it belongs to another plugin.
GET /stat/{path} One entry's metadata: size, mode, times, and which provider wrote it.

Parameters

NameInTypeDescription
path required path string Path inside the shared virtual filesystem. It may contain slashes: this is the whole remaining path, not one segment.

Responses

StatusBodyDescription
200 application/json · files.EntryView
Success.
404 application/json · api.Error
No such resource, or it belongs to another plugin.
GET /tree One directory of the shared virtual filesystem, or the whole subtree.

Parameters

NameInTypeDescription
path query string The directory to list; the root when omitted.
recursive query boolean List the whole subtree rather than one level.

Responses

StatusBodyDescription
200 application/json · files.TreeView
Success.
400 application/json · api.Error
A query parameter could not be parsed - a malformed since, a negative limit.
DELETE /tree Empty the virtual filesystem.

Responses

StatusBodyDescription
204 no body Done. No body.

Schemas

api.Error

PropertyType
error requiredstring

blob.Ref

PropertyType
content_typestring
filenamestring
id requiredstring
size requiredinteger

files.Crumb

PropertyType
name requiredstring
path requiredstring
url requiredstring

files.EntryView

PropertyType
blob requiredblob.Ref
content_typestring
dir requiredboolean
links requiredfiles.EntryLinks
mod_time requiredstring (date-time)
name requiredstring
path requiredstring
providerstring
size requiredinteger

files.Stats

PropertyType
bytes requiredinteger
dirs requiredinteger
files requiredinteger

files.TreeView

PropertyType
breadcrumb requiredarray of files.Crumb
entries requiredarray of files.EntryView
parentstring
path requiredstring
recursiveboolean
stats requiredfiles.Stats