Skip to content
Coritan Docs

Client API: Container Apps: Files

The 13 Client API operations for files.

View as Markdown

Part of Container Apps.

Method Path Summary
POST /api/v1/client/servers/{uuid}/files/chmod Set the mode of files under root: [{"file": name, "mode": "0644"}]
POST /api/v1/client/servers/{uuid}/files/compress Create a compressed archive of files
GET /api/v1/client/servers/{uuid}/files/contents Get contents of a file
POST /api/v1/client/servers/{uuid}/files/copy Duplicate a file next to itself; Wings picks the name copy suffix
POST /api/v1/client/servers/{uuid}/files/decompress Extract an archive on the server
POST /api/v1/client/servers/{uuid}/files/delete Delete a file
GET /api/v1/client/servers/{uuid}/files/download Stream one file from Wings through the platform, as an attachment
GET /api/v1/client/servers/{uuid}/files/list List files in a server directory
POST /api/v1/client/servers/{uuid}/files/mkdir Create a folder name under root
POST /api/v1/client/servers/{uuid}/files/pull Download and save a file from a URL
POST /api/v1/client/servers/{uuid}/files/rename Rename a file
POST /api/v1/client/servers/{uuid}/files/upload Multipart upload proxied to Wings, so the browser never talks to the node
POST /api/v1/client/servers/{uuid}/files/write Write content to a file

Set the mode of files under root: [{"file": name, "mode": "0644"}]

Section titled Set the mode of files under root: [{"file": name, "mode": "0644"}]

POST /api/v1/client/servers/{uuid}/files/chmod

Set the mode of files under root: [{"file": name, "mode": "0644"}].

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes

application/json (required)

Field Type Required
root string no
files array of object yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Create a compressed archive of files

Section titled Create a compressed archive of files

POST /api/v1/client/servers/{uuid}/files/compress

Create a compressed archive of files.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes

application/json (required)

Field Type Required
paths array of string yes
archive_name string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

GET /api/v1/client/servers/{uuid}/files/contents

Get contents of a file.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes
path query string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Duplicate a file next to itself; Wings picks the name copy suffix

Section titled Duplicate a file next to itself; Wings picks the name copy suffix

POST /api/v1/client/servers/{uuid}/files/copy

Duplicate a file next to itself; Wings picks the name copy suffix.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes

application/json (required)

Field Type Required
location string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Extract an archive on the server

Section titled Extract an archive on the server

POST /api/v1/client/servers/{uuid}/files/decompress

Extract an archive on the server.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes

application/json (required)

Field Type Required
archive_path string yes
destination string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

POST /api/v1/client/servers/{uuid}/files/delete

Delete a file.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes

application/json (required)

Field Type Required
path string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Stream one file from Wings through the platform, as an attachment

Section titled Stream one file from Wings through the platform, as an attachment

GET /api/v1/client/servers/{uuid}/files/download

Stream one file from Wings through the platform, as an attachment.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes
path query string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

List files in a server directory

Section titled List files in a server directory

GET /api/v1/client/servers/{uuid}/files/list

List files in a server directory.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required Description
uuid path string yes
directory query string no Default: /.
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Create a folder name under root

Section titled Create a folder name under root

POST /api/v1/client/servers/{uuid}/files/mkdir

Create a folder name under root.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes

application/json (required)

Field Type Required
root string no
name string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Download and save a file from a URL

Section titled Download and save a file from a URL

POST /api/v1/client/servers/{uuid}/files/pull

Download and save a file from a URL.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes

application/json (required)

Field Type Required
url string yes
destination_path string yes
filename string or null no
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

POST /api/v1/client/servers/{uuid}/files/rename

Rename a file.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes

application/json (required)

Field Type Required
old_path string yes
new_path string yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

Multipart upload proxied to Wings, so the browser never talks to the node

Section titled Multipart upload proxied to Wings, so the browser never talks to the node

POST /api/v1/client/servers/{uuid}/files/upload

Multipart upload proxied to Wings, so the browser never talks to the node.

A batch is written file by file; when a later file fails after earlier ones landed, the response names both lists rather than failing the whole request, so a retry does not have to guess what is already on disk.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required Description
uuid path string yes
directory query string no Default: /.

multipart/form-data (required)

Field Type Required
files array of string (binary) yes
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.

POST /api/v1/client/servers/{uuid}/files/write

Write content to a file.

Authentication: an access token, sent as Authorization: Bearer <token>.

Name In Type Required
uuid path string yes

application/json (required)

Field Type Required
path string yes
content string no
expected_hash string or null no
Status Meaning
200 Success.
422 The request is not valid. detail lists each problem.