Kibotos
API referenceHTTP endpoints

/v1/files

This page describes /v1/files on the node data plane. Its parameter names and limits are generated from the constants the Kibotos code implements it with.

Reads and writes the content of one file in the guest. Directories and metadata go through FilesystemService, and paths follow its rules: absolute, or relative to the home directory of the identity user selects.

Credential

  • Authorization: Bearer <credential>, with the credential of a data-plane session that has the scope the method needs.

Methods

MethodScopeDescription
GETDATA_PLANE_SCOPE_FILE_READReads the file. A single Range: bytes=… range, including one that counts from the end such as bytes=-500, answers 206 with Content-Range; several ranges answer 400 and a range beyond the file answers 416. If-Range is forwarded to the guest unchanged. The response carries Content-Type, Content-Length, Content-Range, Accept-Ranges, ETag and Last-Modified; ETag is an opaque string.
PUTDATA_PLANE_SCOPE_FILE_WRITEWrites the file from the request body. 200 means the file is on storage; the body reports what was written. A read-only directory answers 403 and an exhausted file system or quota answers 413, also for root; neither is retryable, and a file already at the path stays unchanged.

Query parameters

ParameterMethodsRequiredDescription
pathGET, PUTYesThe file: an absolute path in the guest, or a path relative to the home directory of user.
userGET, PUTThe guest identity the request runs as: empty for the account the Template declares, that account's name, or root.
modePUTThe permissions of a new file, in octal with permission bits only, such as 0644. Defaults to 0600.
create_onlyPUTtrue or 1 fails the request when the file exists; false, 0 or no value overwrites it.

Any other parameter, a parameter given twice, an invalid value, and mode or create_only on GET answer 400 (invalid_argument) before the request reaches the guest.

Bodies

PUT result

The body of a successful PUT. Compare the size and digest with what you sent.

FieldTypeDescription
pathstringThe cleaned absolute path written.
size_bytesnumberThe number of bytes written.
sha256stringThe SHA-256 digest of the bytes written, in lowercase hexadecimal.

Error body

The body of every error response, with Content-Type: application/json.

FieldTypeDescription
codestringThe name of the Connect error code, such as not_found.
detailobjectThe ErrorDetail of the error in protobuf JSON, with the field names of the proto file.

Status codes

HTTP statusConnect error codes
400invalid_argument
401unauthenticated
403permission_denied
404not_found
405unimplemented
409already_exists, failed_precondition, aborted
413resource_exhausted
499canceled
500unknown, out_of_range, internal, data_loss
503unavailable
504deadline_exceeded

An unsatisfiable range answers 416 with Content-Range: bytes */<size>.

A request whose body stalls for longer than the progress timeout answers 408.

Methods other than GET and PUT answer 405.

Limits

LimitValueDescription
Bytes per request1 GiBThe bytes of one GET response or PUT body. Read a larger file with several Range requests.
Rate64 MiB/sThe transfer rate of one request.
Burst1 MiBThe bytes one request may transfer above the rate at once.
Progress timeout5 sHow long the caller may send no request body, or read no response, before the node ends the request. Time the node spends waiting for the guest does not count.

See also

On this page