Client API: Container Apps: Files
The 13 Client API operations for files.
Part of Container Apps.
Operations
Section titled Operations| 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>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
root |
string | no |
files |
array of object | yes |
Responses
Section titled Responses| 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 filesPOST /api/v1/client/servers/{uuid}/files/compress
Create a compressed archive of files.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
paths |
array of string | yes |
archive_name |
string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Get contents of a file
Section titled Get contents of a fileGET /api/v1/client/servers/{uuid}/files/contents
Get contents of a file.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
path |
query | string | yes |
Responses
Section titled Responses| 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 suffixPOST /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>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
location |
string | yes |
Responses
Section titled Responses| 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 serverPOST /api/v1/client/servers/{uuid}/files/decompress
Extract an archive on the server.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
archive_path |
string | yes |
destination |
string | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Delete a file
Section titled Delete a filePOST /api/v1/client/servers/{uuid}/files/delete
Delete a file.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
path |
string | yes |
Responses
Section titled Responses| 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 attachmentGET /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>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
path |
query | string | yes |
Responses
Section titled Responses| 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 directoryGET /api/v1/client/servers/{uuid}/files/list
List files in a server directory.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
uuid |
path | string | yes | |
directory |
query | string | no | Default: /. |
Responses
Section titled Responses| 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 rootPOST /api/v1/client/servers/{uuid}/files/mkdir
Create a folder name under root.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
root |
string | no |
name |
string | yes |
Responses
Section titled Responses| 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 URLPOST /api/v1/client/servers/{uuid}/files/pull
Download and save a file from a URL.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
url |
string | yes |
destination_path |
string | yes |
filename |
string or null | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Rename a file
Section titled Rename a filePOST /api/v1/client/servers/{uuid}/files/rename
Rename a file.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
old_path |
string | yes |
new_path |
string | yes |
Responses
Section titled Responses| 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 nodePOST /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>.
Parameters
Section titled Parameters| Name | In | Type | Required | Description |
|---|---|---|---|---|
uuid |
path | string | yes | |
directory |
query | string | no | Default: /. |
Request body
Section titled Request bodymultipart/form-data (required)
| Field | Type | Required |
|---|---|---|
files |
array of string (binary) | yes |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |
Write content to a file
Section titled Write content to a filePOST /api/v1/client/servers/{uuid}/files/write
Write content to a file.
Authentication: an access token, sent as Authorization: Bearer <token>.
Parameters
Section titled Parameters| Name | In | Type | Required |
|---|---|---|---|
uuid |
path | string | yes |
Request body
Section titled Request bodyapplication/json (required)
| Field | Type | Required |
|---|---|---|
path |
string | yes |
content |
string | no |
expected_hash |
string or null | no |
Responses
Section titled Responses| Status | Meaning |
|---|---|
200 |
Success. |
422 |
The request is not valid. detail lists each problem. |